From d245ce61328ea996a59e598e40a602ad2ad92df4 Mon Sep 17 00:00:00 2001 From: Sam Goodwin Date: Fri, 20 Nov 2026 23:29:25 -0800 Subject: [PATCH 1/6] feat(slack)!: typed error for every documented error slug --- packages/slack/package.json | 2 +- packages/slack/scripts/convert.ts | 131 +- packages/slack/scripts/generate.ts | 17 +- packages/slack/src/protocol.ts | 9 +- packages/slack/src/services/admin.ts | 10739 ++++++++++++++--- packages/slack/src/services/agents.ts | 1154 +- packages/slack/src/services/apps.ts | 2018 +++- packages/slack/src/services/assistant.ts | 302 +- packages/slack/src/services/auth.ts | 53 +- packages/slack/src/services/blocks.ts | 70 +- packages/slack/src/services/bookmarks.ts | 470 +- packages/slack/src/services/bots.ts | 64 +- packages/slack/src/services/calls.ts | 296 +- packages/slack/src/services/canvases.ts | 357 +- packages/slack/src/services/chat.ts | 2311 +++- packages/slack/src/services/conversations.ts | 2953 ++++- packages/slack/src/services/dialog.ts | 145 +- packages/slack/src/services/dnd.ts | 227 +- packages/slack/src/services/emoji.ts | 32 +- packages/slack/src/services/entity.ts | 256 +- packages/slack/src/services/files.ts | 1442 ++- packages/slack/src/services/functions.ts | 443 +- packages/slack/src/services/lists.ts | 1164 +- packages/slack/src/services/migration.ts | 32 +- packages/slack/src/services/oauth.ts | 808 +- packages/slack/src/services/openid.ts | 208 +- packages/slack/src/services/pins.ts | 266 +- packages/slack/src/services/reactions.ts | 331 +- packages/slack/src/services/reminders.ts | 206 +- packages/slack/src/services/rtm.ts | 55 +- packages/slack/src/services/search.ts | 31 +- packages/slack/src/services/slackbot.ts | 452 +- packages/slack/src/services/stars.ts | 187 +- packages/slack/src/services/team.ts | 394 +- packages/slack/src/services/tooling.ts | 36 +- packages/slack/src/services/usergroups.ts | 484 +- packages/slack/src/services/users.ts | 824 +- packages/slack/src/services/views.ts | 236 +- packages/slack/src/services/workflows.ts | 485 +- 39 files changed, 25887 insertions(+), 3803 deletions(-) diff --git a/packages/slack/package.json b/packages/slack/package.json index 8dd35032de..a61886297e 100644 --- a/packages/slack/package.json +++ b/packages/slack/package.json @@ -84,7 +84,7 @@ "effect": "catalog:" }, "distilled": { - "generatedAt": "2026-11-10", + "generatedAt": "2026-11-21", "specUpdatedAt": "2026-11-07" } } diff --git a/packages/slack/scripts/convert.ts b/packages/slack/scripts/convert.ts index 94a9f01799..e8d5a7491a 100644 --- a/packages/slack/scripts/convert.ts +++ b/packages/slack/scripts/convert.ts @@ -34,8 +34,9 @@ * • Every response rides Slack's envelope: `{ "ok": true, …payload }` at * the SAME level as the payload, so the response schema is the documented * output plus a required `ok: boolean`, and failures (`ok: false`) are - * the protocol's job (src/protocol.ts), not typed per-op errors — the - * documented error slugs land in the operation's doc comment instead. + * the protocol's job (src/protocol.ts). Each documented error slug + * becomes a typed error class on the operations that list it, matched + * on the envelope's `/error` member. * • `admin.analytics.getFile` answers with a gzipped NDJSON FILE, not * JSON — its output converts as a bare Document and the protocol hands * back the raw bytes. @@ -43,7 +44,7 @@ import * as fs from "node:fs"; import * as path from "node:path"; import { clearModels, writeModel } from "@distilled.cloud/dev/codegen/models"; -import { convertOpenApiToSmithy } from "@distilled.cloud/dev/codegen/openapi"; +import { convertOpenApiToSmithy, ERROR_MATCHERS_TRAIT } from "@distilled.cloud/dev/codegen/openapi"; import { finalizeConvert } from "@distilled.cloud/dev/codegen/patches"; import { resolveSpecPath } from "@distilled.cloud/dev/codegen/spec-path"; @@ -277,7 +278,7 @@ const buildDescription = (name: string, page: MethodPage): string => { const errors = Object.entries(page.errors ?? {}); if (errors.length > 0) { parts.push( - `Method-specific errors (the \`error\` slug on the SlackError):\n` + + `Method-specific errors (each a typed error named after its slug):\n` + errors.map(([slug, e]) => ` - \`${slug}\`${e?.desc ? ` — ${e.desc}` : ""}`).join("\n"), ); } @@ -434,6 +435,118 @@ const buildOutputSchema = (name: string, page: MethodPage): Record }; }; +// ============================================================================ +// Documented error slugs → typed error classes +// ============================================================================ + +/** + * Slugs the protocol already maps onto shared classes (src/protocol.ts): + * credential failures become `Unauthorized`, Slack-side hiccups the + * retryable server errors, and throttling `SlackRateLimited`. A per-operation + * class for one of these would win the match and lose that mapping, so they + * stay untyped here. + */ +const PROTOCOL_SLUGS = new Set([ + "not_authed", + "invalid_auth", + "account_inactive", + "token_revoked", + "token_expired", + "internal_error", + "fatal_error", + "service_unavailable", + "request_timeout", + "rate_limited", + "ratelimited", +]); + +/** `channel_not_found` → `ChannelNotFound`; a leading digit gets a `Slack` prefix. */ +const errorClassName = (slug: string): string => { + const name = toPascal(slug); + return /^[0-9]/.test(name) ? `Slack${name}` : name; +}; + +/** + * Categories a slug's wording states: `*_not_found` is a missing resource, + * `already_*` / `*_taken` a conflict with one that exists. + */ +const slugCategories = (slug: string): string[] => + /(^|_)not_found$/.test(slug) + ? ["NotFoundError"] + : /^already_|_taken$|_exists$/.test(slug) + ? ["AlreadyExistsError"] + : []; + +/** + * Every method page documents the `error` slugs it can answer with + * (`{ "ok": false, "error": "channel_not_found" }`, usually at HTTP 200). + * Each slug becomes one error structure per family — shared by every + * operation that lists it — matched on the envelope's `/error` member, so + * callers branch with `Effect.catchTag("ChannelNotFound", ...)` instead of + * reading a string off `SlackError`. Slugs a page doesn't list still arrive + * as `SlackError`; live findings add them with a patch. + */ +const addDocumentedErrors = ( + model: { shapes: Record }, + family: string, + errorsByUri: ReadonlyMap>, +): number => { + const namespace = `com.slack.${family.toLowerCase()}`; + const shapeId = (name: string) => `${namespace}#${name}`; + const slugByClass = new Map(); + let added = 0; + for (const shape of Object.values(model.shapes)) { + if (shape?.type !== "operation") continue; + const uri = shape.traits?.["smithy.api#http"]?.uri as string | undefined; + const errors = uri === undefined ? undefined : errorsByUri.get(uri); + if (errors === undefined) continue; + const targets: Array<{ target: string }> = []; + for (const [slug, entry] of Object.entries(errors).sort(([a], [b]) => a.localeCompare(b))) { + if (PROTOCOL_SLUGS.has(slug)) continue; + let name = errorClassName(slug); + const owner = slugByClass.get(name); + if (owner !== undefined && owner !== slug) { + throw new Error(`family "${family}": slugs "${owner}" and "${slug}" both name ${name}`); + } + if (owner === undefined && model.shapes[shapeId(name)] !== undefined) { + // The name is taken by a payload shape; keep the error distinct. + name = `${name}Error`; + if (model.shapes[shapeId(name)] !== undefined) { + throw new Error(`family "${family}": no free shape name for error slug "${slug}"`); + } + } + if (owner === undefined) { + slugByClass.set(name, slug); + const categories = slugCategories(slug); + model.shapes[shapeId(name)] = { + type: "structure", + members: { + message: { target: "smithy.api#String" }, + needed: { target: "smithy.api#String" }, + provided: { target: "smithy.api#String" }, + }, + traits: { + "smithy.api#error": "client", + "smithy.api#documentation": `\`${slug}\`${entry?.desc ? ` — ${entry.desc}` : ""}`, + [ERROR_MATCHERS_TRAIT]: [{ body: { "/error": slug } }], + ...(categories.length > 0 ? { "distilled.errors#categories": categories } : {}), + }, + }; + added++; + } + targets.push({ target: shapeId(name) }); + } + if (targets.length > 0) { + const existing = (shape.errors ?? []) as Array<{ target: string }>; + shape.errors = [ + ...existing, + ...targets.filter((t) => !existing.some((e) => e.target === t.target)), + ]; + } + } + return added; +}; + // ============================================================================ // 1. Read the index and bucket methods by family // ============================================================================ @@ -478,6 +591,7 @@ clearModels(outDir); let written = 0; let totalOps = 0; let totalPaginated = 0; +let totalErrorClasses = 0; for (const family of [...families.keys()].sort()) { const methods = families.get(family)!; @@ -536,6 +650,13 @@ for (const family of [...families.keys()].sort()) { } totalPaginated += paginatedCount; + // One typed error class per documented `error` slug, attached to every + // operation whose page lists it (see `addDocumentedErrors`). + const errorsByUri = new Map( + methods.map(({ name, page }) => [`/${name}`, page.errors ?? {}] as const), + ); + totalErrorClasses += addDocumentedErrors(model, family, errorsByUri); + const opCount = Object.values(model.shapes).filter((s: any) => s.type === "operation").length; if (opCount === 0) continue; writeModel(path.join(outDir, `${family.toLowerCase()}.json`), model); @@ -544,7 +665,7 @@ for (const family of [...families.keys()].sort()) { } console.log( - `✅ ${written} Smithy models (${totalOps} operations, ${totalPaginated} cursor-paginated) → ${outDir}`, + `✅ ${written} Smithy models (${totalOps} operations, ${totalPaginated} cursor-paginated, ${totalErrorClasses} typed errors) → ${outDir}`, ); await finalizeConvert({ root: rootDir }); diff --git a/packages/slack/scripts/generate.ts b/packages/slack/scripts/generate.ts index 7d628dc30b..33c236c5d2 100644 --- a/packages/slack/scripts/generate.ts +++ b/packages/slack/scripts/generate.ts @@ -18,9 +18,10 @@ import { runGeneratorCli } from "@distilled.cloud/dev/codegen/cli"; * • Operations export under lowerCamel of their `operationId` (the method * name minus its family prefix: `chat.postMessage` → `postMessage`, * `admin.analytics.getFile` → `analyticsGetFile`), the compiler default. - * • No per-operation error classes: Slack failures are `ok: false` - * envelopes dispatched by slug in SlackProtocol; every operation shares - * `SlackError` / `SlackRateLimited` plus core's HTTP classes. + * • Per-operation error classes come from each method page's documented + * `error` slugs (scripts/convert.ts), matched on the envelope's `/error`. + * Every operation also shares `SlackError` (undocumented slugs) and + * `SlackRateLimited` plus core's HTTP classes. * • No pagination profiles yet: Slack's cursor methods take `cursor` and * answer `response_metadata.next_cursor`, which stays a plain response * member for callers to thread. @@ -93,6 +94,16 @@ const spec: SdkSpec = { retry: "Retry.Retry", }, + // Error classes carry the envelope's `message` (the detail, or the slug + // when there is none) plus the `needed`/`provided` scope detail that only + // `missing_scope`-style envelopes send -- so those two are optional. + errors: { + field: (name) => + name === "message" + ? ` message: S.String,` + : ` ${name}: /*@__PURE__*/ S.optional(S.String),`, + }, + sourceNote: ".generated-specs (docs.slack.dev JSON twins)", // Sensitive member types reference Redacted; pull the import in when used. diff --git a/packages/slack/src/protocol.ts b/packages/slack/src/protocol.ts index 68587db50d..112087e7c1 100644 --- a/packages/slack/src/protocol.ts +++ b/packages/slack/src/protocol.ts @@ -218,11 +218,10 @@ const decode = ({ slug ?? (json === undefined && text.trim() ? text.trim() : `HTTP ${status}`); - // 1. Per-operation typed error (matcher metadata on the class -- none - // are generated today, but model patches can add them). Slack's - // error codes are string slugs, and matcher `code`s are numeric -- - // a patch-declared class matches on `status`/`message` instead - // (`message` is the slug when the envelope carries no detail). + // 1. Per-operation typed error. The converter generates one class per + // documented slug, matched on the envelope body's `/error` member + // (matcher `code`s are numeric, Slack's are string slugs); patches + // add the slugs a page doesn't document. const typed = matchTypedError(errorClasses, status, [{ message }], { body: json === undefined ? text : json, headers, diff --git a/packages/slack/src/services/admin.ts b/packages/slack/src/services/admin.ts index 72768d16f9..68cd9fabd4 100644 --- a/packages/slack/src/services/admin.ts +++ b/packages/slack/src/services/admin.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,4552 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `access_denied` -- This actor does not have access to the permissions on this resource. */ +export class AccessDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AccessDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "access_denied" } }], + ) {} + +/** `action_already_in_progress` -- Another bulk action request is currently in progress */ +export class ActionAlreadyInProgress + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ActionAlreadyInProgress", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "action_already_in_progress" } }], + ) {} + +/** `admin_analytics_disabled` -- We're having issues returning your analytics. Please wait and try again. */ +export class AdminAnalyticsDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AdminAnalyticsDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "admin_analytics_disabled" } }], + ) {} + +/** `admin_unauthorized` -- The token provided doesn't have permission to revoke a session. */ +export class AdminUnauthorized + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AdminUnauthorized", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "admin_unauthorized" } }], + ) {} + +/** `already_archived` -- This channel has already been archived. */ +export class AlreadyArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_archived" } }], + ) {} + +/** `already_in_team` -- The user is already on the team. */ +export class AlreadyInTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyInTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_in_team" } }], + ) {} + +/** `already_in_team_invited_user` -- The user has already been invited to the team. */ +export class AlreadyInTeamInvitedUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyInTeamInvitedUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_in_team_invited_user" } }], + ) {} + +/** `already_processed` -- The `invite_request_id` passed has already been approved or denied. */ +export class AlreadyProcessed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyProcessed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_processed" } }], + ) {} + +/** `analytics_unavailable` -- We were unable to find analytics for you. */ +export class AnalyticsUnavailable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AnalyticsUnavailable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "analytics_unavailable" } }], + ) {} + +/** `app_acl_not_found` -- This app does not have an ACL. */ +export class AppAclNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppAclNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "app_acl_not_found" } }], + ) {} + +/** `app_acl_write_failed` -- A transient database error (e.g. a deadlock) prevented the permission change from being saved. No change was applied; retry the request. */ +export class AppAclWriteFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppAclWriteFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_acl_write_failed" } }], + ) {} + +/** `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. */ +export class AppManagementAppNotInstalledOnOrg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "AppManagementAppNotInstalledOnOrg", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "app_management_app_not_installed_on_org" } }], + ) {} + +/** `app_not_eligible_for_auto_install` -- The app does not have the required scope to be eligible for auto-install rule creation. */ +export class AppNotEligibleForAutoInstall + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotEligibleForAutoInstall", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_not_eligible_for_auto_install" } }], + ) {} + +/** `app_not_found` -- This app does not exist. */ +export class AppNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "app_not_found" } }], + ) {} + +/** `app_restricted_org_wide` -- The app is already restricted org wide. */ +export class AppRestrictedOrgWide + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppRestrictedOrgWide", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_restricted_org_wide" } }], + ) {} + +/** `at_least_one_session_setting_required` -- At least one session setting is required. */ +export class AtLeastOneSessionSettingRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "AtLeastOneSessionSettingRequired", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "at_least_one_session_setting_required" } }], + ) {} + +/** `audience_too_large` -- Validating this audience requires more than 1,000 member checks across the requested groups. Overlapping members count once per group. Select a smaller audience, or share the canvas org-wide if that access is intended, before retrying. */ +export class AudienceTooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AudienceTooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "audience_too_large" } }], + ) {} + +/** `auto_install_rule_creation_failed` -- The app was approved successfully, but the auto-install AAA rule could not be created. Please create the rule manually. */ +export class AutoInstallRuleCreationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AutoInstallRuleCreationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "auto_install_rule_creation_failed" } }], + ) {} + +/** `auto_provision_failure` -- A failure occurred while assigning IDP group members to a specific workspace; see `errors` element for a list of failed team IDs. */ +export class AutoProvisionFailure + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AutoProvisionFailure", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "auto_provision_failure" } }], + ) {} + +/** `auto_provision_required` -- The IDP group requires a mandatory workspace link, so `auto_provision` must be `true`. */ +export class AutoProvisionRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AutoProvisionRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "auto_provision_required" } }], + ) {} + +/** `bad_url` -- Invalid URL. Note that domains can be at most 21 characters. */ +export class BadUrl + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadUrl", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_url" } }], + ) {} + +/** `barrier_already_exists` -- There already exists another barrier restricting activity between two or more of your requested usergroups. */ +export class BarrierAlreadyExists + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BarrierAlreadyExists", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "barrier_already_exists" } }], + ) {} + +/** `barriered_from_usergroups_not_found` -- One or more of the ids passed in for barriered_from_usergroup_ids can't be found. */ +export class BarrieredFromUsergroupsNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "BarrieredFromUsergroupsNotFound", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ).pipe(C.withNotFoundError), + [{ body: { "/error": "barriered_from_usergroups_not_found" } }], + ) {} + +/** `barrier_not_found` -- The barrier you're trying to delete cannot be found. */ +export class BarrierNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BarrierNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "barrier_not_found" } }], + ) {} + +/** `bots_not_allowed` -- Bot users may not have their settings cleared. */ +export class BotsNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BotsNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bots_not_allowed" } }], + ) {} + +/** `cannot_add_legacy_disconnected_channel_to_workspaces` -- Cannot add legacy disconnected channel to workspaces */ +export class CannotAddLegacyDisconnectedChannelToWorkspaces + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "CannotAddLegacyDisconnectedChannelToWorkspaces", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "cannot_add_legacy_disconnected_channel_to_workspaces" } }], + ) {} + +/** `cannot_add_more_channels_to_group` -- The maximum number of channels have already been linked to the group. */ +export class CannotAddMoreChannelsToGroup + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotAddMoreChannelsToGroup", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_add_more_channels_to_group" } }], + ) {} + +/** `cannot_add_more_groups_to_channel` -- The maximum number of groups have already been linked to the channel. */ +export class CannotAddMoreGroupsToChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotAddMoreGroupsToChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_add_more_groups_to_channel" } }], + ) {} + +/** `cannot_invalidate_primary_owner` -- Only the primary owner of an organization can invalidate a primary owner's sessions. */ +export class CannotInvalidatePrimaryOwner + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotInvalidatePrimaryOwner", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_invalidate_primary_owner" } }], + ) {} + +/** `cannot_kick_home_team` -- The originating workspace cannot be kicked from the channel. */ +export class CannotKickHomeTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotKickHomeTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_kick_home_team" } }], + ) {} + +/** `cannot_kick_team` -- Only the originating workspace for a connected channel may remove other workspaces from the channel. */ +export class CannotKickTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotKickTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_kick_team" } }], + ) {} + +/** `cannot_modify_external_guest` -- The user is an external huddle guest, whose expiration can't be changed. */ +export class CannotModifyExternalGuest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotModifyExternalGuest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_modify_external_guest" } }], + ) {} + +/** `cannot_modify_pref_after_creation` -- This preference can only be set when the group is created and cannot be changed afterward. */ +export class CannotModifyPrefAfterCreation + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotModifyPrefAfterCreation", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_modify_pref_after_creation" } }], + ) {} + +/** `cannot_modify_primary_owner` -- The primary owner cannot be modified. */ +export class CannotModifyPrimaryOwner + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotModifyPrimaryOwner", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_modify_primary_owner" } }], + ) {} + +/** `cannot_modify_role_admin` -- The user does not have permission to modify the admin role. */ +export class CannotModifyRoleAdmin + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotModifyRoleAdmin", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_modify_role_admin" } }], + ) {} + +/** `cannot_move_local_channel` -- This API cannot be used to move a local channel from one workspace to another. */ +export class CannotMoveLocalChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotMoveLocalChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_move_local_channel" } }], + ) {} + +/** `cannot_reset_bot` -- Cannot reset bot users */ +export class CannotResetBot + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotResetBot", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_reset_bot" } }], + ) {} + +/** `cannot_reset_primary_owner` -- Only primary owner can reset primary owner's sessions */ +export class CannotResetPrimaryOwner + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotResetPrimaryOwner", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_reset_primary_owner" } }], + ) {} + +/** `cannot_resolve_alias` -- The alias emoji could not be resolved */ +export class CannotResolveAlias + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotResolveAlias", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_resolve_alias" } }], + ) {} + +/** `cannot_set_org_admin_to_regular_at_workspace_level` -- Org admins cannot be set to regular at the workspace level. Change their user type at the org level instead. */ +export class CannotSetOrgAdminToRegularAtWorkspaceLevel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "CannotSetOrgAdminToRegularAtWorkspaceLevel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "cannot_set_org_admin_to_regular_at_workspace_level" } }], + ) {} + +/** `cannot_set_this_guest_to_regular_at_team_level` -- This guest cannot be set to regular because they are active on multiple workspaces. */ +export class CannotSetThisGuestToRegularAtTeamLevel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "CannotSetThisGuestToRegularAtTeamLevel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "cannot_set_this_guest_to_regular_at_team_level" } }], + ) {} + +/** `can_not_uninstall` -- This application can not be uninstalled via the API. */ +export class CanNotUninstall + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanNotUninstall", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "can_not_uninstall" } }], + ) {} + +/** `cant_archive_general` -- You cannot archive the 'general' channel. */ +export class CantArchiveGeneral + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantArchiveGeneral", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_archive_general" } }], + ) {} + +/** `channel_already_exists` -- Object is linked to a different channel. */ +export class ChannelAlreadyExists + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelAlreadyExists", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "channel_already_exists" } }], + ) {} + +/** `channel_cannot_be_unshared` -- Channel cannot be unshared from this workspace. */ +export class ChannelCannotBeUnshared + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelCannotBeUnshared", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_cannot_be_unshared" } }], + ) {} + +/** `channel_conversion_incomplete` -- An active channel conversion is preventing linking. */ +export class ChannelConversionIncomplete + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelConversionIncomplete", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_conversion_incomplete" } }], + ) {} + +/** `channel_ids_required` -- channel_ids is required when channel_restriction_mode is specific_channels or all_channels_except. */ +export class ChannelIdsRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelIdsRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_ids_required" } }], + ) {} + +/** `channel_is_archived` -- Channel is archived. */ +export class ChannelIsArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelIsArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_is_archived" } }], + ) {} + +/** `channel_is_not_private` -- The channel is a public channel, a multi-party direct message, a direct message, or is externally-shared. */ +export class ChannelIsNotPrivate + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelIsNotPrivate", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_is_not_private" } }], + ) {} + +/** `channel_mention_sync_required` -- If setting channel mention restriction prefs, both mention prefs must be passed and they must be the same value. */ +export class ChannelMentionSyncRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelMentionSyncRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_mention_sync_required" } }], + ) {} + +/** `channel_not_archived` -- The passed channel is not currently archived. */ +export class ChannelNotArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_not_archived" } }], + ) {} + +/** `channel_not_found` -- The specified channel was not found. */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `channel_not_org_wide_shared` -- Channel is not Org-wide shared. */ +export class ChannelNotOrgWideShared + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotOrgWideShared", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_not_org_wide_shared" } }], + ) {} + +/** `channel_owner_restriction` -- away-side SC conversion fails due to home-side being private */ +export class ChannelOwnerRestriction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelOwnerRestriction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_owner_restriction" } }], + ) {} + +/** `channel_restriction_requires_app_access` -- Channel access cannot be configured while the app is set to no_one, since the app can't be used in any channel. */ +export class ChannelRestrictionRequiresAppAccess + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "ChannelRestrictionRequiresAppAccess", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "channel_restriction_requires_app_access" } }], + ) {} + +/** `channel_restrictions_not_available` -- Channel restrictions are not available for this workspace. */ +export class ChannelRestrictionsNotAvailable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "ChannelRestrictionsNotAvailable", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "channel_restrictions_not_available" } }], + ) {} + +/** `channel_shared_with_nonapproved_team` -- Channel is shared with a non-approved external team. */ +export class ChannelSharedWithNonapprovedTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "ChannelSharedWithNonapprovedTeam", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "channel_shared_with_nonapproved_team" } }], + ) {} + +/** `channel_type_not_supported` -- The value passed for `channel` was an MPDM, DM, or the 'general' channel. */ +export class ChannelTypeNotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelTypeNotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_type_not_supported" } }], + ) {} + +/** `config_not_found` -- Missing record configuration. */ +export class ConfigNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ConfigNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "config_not_found" } }], + ) {} + +/** `connected_team_passed_in_is_not_top_level_team` -- One of the orgs provided in the external connected teams filter is not a top level team. Pass the connected org's top-level ID. */ +export class ConnectedTeamPassedInIsNotTopLevelTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "ConnectedTeamPassedInIsNotTopLevelTeam", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "connected_team_passed_in_is_not_top_level_team" } }], + ) {} + +/** `could_not_archive_channel` -- The provided channel could not be archived. */ +export class CouldNotArchiveChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotArchiveChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_archive_channel" } }], + ) {} + +/** `could_not_convert_channel` -- This channel could not be converted to private. */ +export class CouldNotConvertChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotConvertChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_convert_channel" } }], + ) {} + +/** `could_not_create_channel` -- The channel could not be created. */ +export class CouldNotCreateChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotCreateChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_create_channel" } }], + ) {} + +/** `could_not_create_workspace` -- The workspace could not be created. */ +export class CouldNotCreateWorkspace + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotCreateWorkspace", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_create_workspace" } }], + ) {} + +/** `could_not_delete_channel` -- The channel could not be deleted. */ +export class CouldNotDeleteChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotDeleteChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_delete_channel" } }], + ) {} + +/** `could_not_export` -- For some reason, the export could not be started */ +export class CouldNotExport + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotExport", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_export" } }], + ) {} + +/** `could_not_get_conversation_prefs` -- There was an error getting the conversation preferences for this channel. */ +export class CouldNotGetConversationPrefs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotGetConversationPrefs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_get_conversation_prefs" } }], + ) {} + +/** `could_not_get_retention` -- The retention policy could not be retrieved. */ +export class CouldNotGetRetention + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotGetRetention", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_get_retention" } }], + ) {} + +/** `could_not_get_teams` -- Could not fetch the workspaces that the channel is shared with in this organization. */ +export class CouldNotGetTeams + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotGetTeams", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_get_teams" } }], + ) {} + +/** `could_not_remove_retention` -- The retention policy could not be removed. */ +export class CouldNotRemoveRetention + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotRemoveRetention", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_remove_retention" } }], + ) {} + +/** `could_not_rename_channel` -- The channel could not be renamed. */ +export class CouldNotRenameChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotRenameChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_rename_channel" } }], + ) {} + +/** `could_not_set_channel_pref` -- Setting the preference or permission failed. */ +export class CouldNotSetChannelPref + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotSetChannelPref", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_set_channel_pref" } }], + ) {} + +/** `could_not_set_retention` -- The retention policy could not be set. */ +export class CouldNotSetRetention + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotSetRetention", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_set_retention" } }], + ) {} + +/** `could_not_set_teams_for_channel` -- The requested `channel_id` has not been shared with the target workspace. */ +export class CouldNotSetTeamsForChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotSetTeamsForChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_set_teams_for_channel" } }], + ) {} + +/** `could_not_unarchive_channel` -- The channel could not be unarchived. */ +export class CouldNotUnarchiveChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CouldNotUnarchiveChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "could_not_unarchive_channel" } }], + ) {} + +/** `custom_integration_not_allowed_at_enterprise` -- Returned when the install request is for custom integration app. */ +export class CustomIntegrationNotAllowedAtEnterprise + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "CustomIntegrationNotAllowedAtEnterprise", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "custom_integration_not_allowed_at_enterprise" } }], + ) {} + +/** `data_not_available` -- The `date` was before the API became available. */ +export class DataNotAvailable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DataNotAvailable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "data_not_available" } }], + ) {} + +/** `deactivation_failed` -- The deactivation operation failed. */ +export class DeactivationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DeactivationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "deactivation_failed" } }], + ) {} + +/** `default_channel_restricted` -- The channel is a default channel on the workspace. */ +export class DefaultChannelRestricted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DefaultChannelRestricted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "default_channel_restricted" } }], + ) {} + +/** `default_org_wide_channel` -- The default org-wide channel cannot be archived. */ +export class DefaultOrgWideChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DefaultOrgWideChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "default_org_wide_channel" } }], + ) {} + +/** `different_team_owns_message_metadata_for_channel` -- Message metadata must be accessed by an actor from the same team that owns the channel. This may be the org or a specific enterprise workspace. */ +export class DifferentTeamOwnsMessageMetadataForChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "DifferentTeamOwnsMessageMetadataForChannel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "different_team_owns_message_metadata_for_channel" } }], + ) {} + +/** `disallowed_action` -- This property cannot be set on DMs or MPDMs. */ +export class DisallowedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DisallowedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "disallowed_action" } }], + ) {} + +/** `discoverability_setting_invalid` -- The given discoverability setting is invalid. */ +export class DiscoverabilitySettingInvalid + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DiscoverabilitySettingInvalid", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "discoverability_setting_invalid" } }], + ) {} + +/** `domain_taken` -- The requested domain is taken. */ +export class DomainTaken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DomainTaken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "domain_taken" } }], + ) {} + +/** `emoji_limit_reached` -- Unable to add emoji due to limit reached. */ +export class EmojiLimitReached + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EmojiLimitReached", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "emoji_limit_reached" } }], + ) {} + +/** `emoji_not_found` -- Value passed for `name` was invalid. */ +export class EmojiNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EmojiNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "emoji_not_found" } }], + ) {} + +/** `endpoint_unavailable` -- The requested endpoint is currently unavailable. */ +export class EndpointUnavailable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EndpointUnavailable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "endpoint_unavailable" } }], + ) {} + +/** `enterprise_not_found` -- Returned when enterprise id is not found. */ +export class EnterpriseNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EnterpriseNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "enterprise_not_found" } }], + ) {} + +/** `entities_not_supported` -- user_ids or usergroup_ids were provided, but the permission_type does not accept named entities. Only named_entities and named_entities_exclude do. */ +export class EntitiesNotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EntitiesNotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "entities_not_supported" } }], + ) {} + +/** `entity_not_found` -- At least one `entity_id` was not found. */ +export class EntityNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EntityNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "entity_not_found" } }], + ) {} + +/** `error_adding_collaborators` -- There were one or more errors adding workflow collaborators */ +export class ErrorAddingCollaborators + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorAddingCollaborators", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_adding_collaborators" } }], + ) {} + +/** `error_bad_format` -- Invalid image data was provided. */ +export class ErrorBadFormat + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorBadFormat", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_bad_format" } }], + ) {} + +/** `error_bad_name_i18n` -- Value passed for `name` was invalid. */ +export class ErrorBadNameI18n + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorBadNameI18n", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_bad_name_i18n" } }], + ) {} + +/** `error_bad_upload` -- There was an error uploading the image. */ +export class ErrorBadUpload + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorBadUpload", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_bad_upload" } }], + ) {} + +/** `error_bad_wide` -- The image width or height is too large. */ +export class ErrorBadWide + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorBadWide", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_bad_wide" } }], + ) {} + +/** `error_invalid_alias` -- Value passed for `alias_for` does not exist. */ +export class ErrorInvalidAlias + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorInvalidAlias", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_invalid_alias" } }], + ) {} + +/** `error_invalid_emoji_to_rename` -- Value passed for `name` was invalid. */ +export class ErrorInvalidEmojiToRename + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorInvalidEmojiToRename", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_invalid_emoji_to_rename" } }], + ) {} + +/** `error_lower_case_names_only` -- Capital letters are not allowed in emoji names. */ +export class ErrorLowerCaseNamesOnly + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorLowerCaseNamesOnly", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_lower_case_names_only" } }], + ) {} + +/** `error_missing_name` -- Value passed for `name` is missing or empty. */ +export class ErrorMissingName + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorMissingName", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_missing_name" } }], + ) {} + +/** `error_name_taken` -- Value passed for `name` already exists. */ +export class ErrorNameTaken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorNameTaken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "error_name_taken" } }], + ) {} + +/** `error_name_taken_i18n` -- Value passed for `name` already exists. */ +export class ErrorNameTakenI18n + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorNameTakenI18n", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_name_taken_i18n" } }], + ) {} + +/** `error_no_image` -- Empty image data was provided. */ +export class ErrorNoImage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorNoImage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_no_image" } }], + ) {} + +/** `error_removing_collaborators` -- There were one or more errors adding workflow collaborators */ +export class ErrorRemovingCollaborators + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorRemovingCollaborators", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_removing_collaborators" } }], + ) {} + +/** `error_too_big` -- The image file size is too large. */ +export class ErrorTooBig + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorTooBig", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_too_big" } }], + ) {} + +/** `error_unpublishing_workflows` -- There were one or more errors unpublishing workflows */ +export class ErrorUnpublishingWorkflows + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorUnpublishingWorkflows", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_unpublishing_workflows" } }], + ) {} + +/** `external_channel_migrating` -- This external channel is migrating, so it can't be converted to private. */ +export class ExternalChannelMigrating + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExternalChannelMigrating", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "external_channel_migrating" } }], + ) {} + +/** `external_limited_restriction` -- away-side SC conversion fails due to being under Limited Access ("external_limited" aka "can only post") */ +export class ExternalLimitedRestriction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExternalLimitedRestriction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "external_limited_restriction" } }], + ) {} + +/** `externally_shared_or_disconnected_channel` -- The channel is or was externally shared. */ +export class ExternallySharedOrDisconnectedChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "ExternallySharedOrDisconnectedChannel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "externally_shared_or_disconnected_channel" } }], + ) {} + +/** `external_team_not_connected_to_this_org` -- One of the teams provided in the external connected teams filter is not connected to the org. */ +export class ExternalTeamNotConnectedToThisOrg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "ExternalTeamNotConnectedToThisOrg", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "external_team_not_connected_to_this_org" } }], + ) {} + +/** `failed_for_all_users` -- All users could not be removed from the channel. Check `failed_user_ids` for details. */ +export class FailedForAllUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedForAllUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_for_all_users" } }], + ) {} + +/** `failed_for_some_entities` -- At least one role scope ID was invalid */ +export class FailedForSomeEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedForSomeEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_for_some_entities" } }], + ) {} + +/** `failed_for_some_skills` -- Some skills failed. `failed_skills` lists each distinct failed skill ID and its error: `skill_not_found`, `method_not_supported_for_skill_type`, `restricted_action`, or `internal_error`. Missing, deleted, non-skill, and other organizations' files all return `skill_not_found`. */ +export class FailedForSomeSkills + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedForSomeSkills", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_for_some_skills" } }], + ) {} + +/** `failed_for_some_users` -- The method failed for a subset of the users passed. */ +export class FailedForSomeUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedForSomeUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_for_some_users" } }], + ) {} + +/** `failed_for_some_users_and_entities` -- At least one role scope ID was invalid */ +export class FailedForSomeUsersAndEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedForSomeUsersAndEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_for_some_users_and_entities" } }], + ) {} + +/** `failed_job_enqueue` -- The access change could not be queued. Retry the request. */ +export class FailedJobEnqueue + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedJobEnqueue", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_job_enqueue" } }], + ) {} + +/** `failed_looking_up_user` -- We couldn't find the requested user. */ +export class FailedLookingUpUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedLookingUpUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_looking_up_user" } }], + ) {} + +/** `failed_to_add_emoji` -- Failed to add the specified emoji. */ +export class FailedToAddEmoji + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToAddEmoji", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_add_emoji" } }], + ) {} + +/** `failed_to_alias_emoji` -- Failed to alias the specified emoji. */ +export class FailedToAliasEmoji + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToAliasEmoji", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_alias_emoji" } }], + ) {} + +/** `failed_to_fetch_active_team` -- There are no active teams on the org and we need at least one. */ +export class FailedToFetchActiveTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToFetchActiveTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_fetch_active_team" } }], + ) {} + +/** `failed_to_fetch_info` -- There was an error fetching info for this workspace. */ +export class FailedToFetchInfo + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToFetchInfo", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_fetch_info" } }], + ) {} + +/** `failed_to_remove_emoji` -- Failed to remove the specified emoji. */ +export class FailedToRemoveEmoji + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToRemoveEmoji", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_remove_emoji" } }], + ) {} + +/** `failed_to_remove_group_users` -- Returned when could not remove the users in the channel of the group being removed */ +export class FailedToRemoveGroupUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToRemoveGroupUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_remove_group_users" } }], + ) {} + +/** `failed_to_remove_user_from_workspace` -- Removing this user from the workspace failed. */ +export class FailedToRemoveUserFromWorkspace + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "FailedToRemoveUserFromWorkspace", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "failed_to_remove_user_from_workspace" } }], + ) {} + +/** `failed_to_rename_emoji` -- The emoji could not be renamed. */ +export class FailedToRenameEmoji + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToRenameEmoji", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_rename_emoji" } }], + ) {} + +/** `failed_to_send_invite` -- The actual invite (separate from approval) failed to process. This may happen because the user is disabled, already in the team, etc. */ +export class FailedToSendInvite + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSendInvite", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_send_invite" } }], + ) {} + +/** `failed_to_set_admin_on_workspaces` -- Failed to set the user as an admin on all workspaces. */ +export class FailedToSetAdminOnWorkspaces + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetAdminOnWorkspaces", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_admin_on_workspaces" } }], + ) {} + +/** `failed_to_set_default_channels` -- We encountered an error while trying to set the default channel. */ +export class FailedToSetDefaultChannels + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetDefaultChannels", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_default_channels" } }], + ) {} + +/** `failed_to_set_description` -- There was an error setting the description. */ +export class FailedToSetDescription + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetDescription", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_description" } }], + ) {} + +/** `failed_to_set_discoverability` -- There was an error setting the discoverability of this workspace. */ +export class FailedToSetDiscoverability + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetDiscoverability", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_discoverability" } }], + ) {} + +/** `failed_to_set_expiration` -- The expiration could not be set for the user. */ +export class FailedToSetExpiration + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetExpiration", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_expiration" } }], + ) {} + +/** `failed_to_set_icon` -- Setting the url in the database failed. This may be transient, please try again soon. */ +export class FailedToSetIcon + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetIcon", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_icon" } }], + ) {} + +/** `failed_to_set_name` -- Returned when there is an error to set the name */ +export class FailedToSetName + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetName", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_name" } }], + ) {} + +/** `failed_to_set_owner_on_workspaces` -- Failed to set the user as an owner on all workspaces. */ +export class FailedToSetOwnerOnWorkspaces + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetOwnerOnWorkspaces", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_owner_on_workspaces" } }], + ) {} + +/** `failed_to_set_user_to_admin` -- Designating this user as an admin failed. */ +export class FailedToSetUserToAdmin + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetUserToAdmin", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_user_to_admin" } }], + ) {} + +/** `failed_to_set_user_to_owner` -- The change to the user's role failed. */ +export class FailedToSetUserToOwner + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetUserToOwner", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_user_to_owner" } }], + ) {} + +/** `failed_to_set_user_to_regular` -- Changing a user to a regular member failed. */ +export class FailedToSetUserToRegular + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToSetUserToRegular", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_set_user_to_regular" } }], + ) {} + +/** `failed_to_unlink_channel` -- Removing the link in the database failed. Please retry. */ +export class FailedToUnlinkChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToUnlinkChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_unlink_channel" } }], + ) {} + +/** `failed_to_update_channels` -- An error occurred while updating the channel restriction list. */ +export class FailedToUpdateChannels + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToUpdateChannels", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_update_channels" } }], + ) {} + +/** `failed_to_validate_caller` -- The token calling this method doesn't have permission to invite a user. */ +export class FailedToValidateCaller + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToValidateCaller", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_validate_caller" } }], + ) {} + +/** `failed_to_validate_channels` -- `channel_ids` was invalid. */ +export class FailedToValidateChannels + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToValidateChannels", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_validate_channels" } }], + ) {} + +/** `failed_to_validate_custom_message` -- `extra_message` was invalid. */ +export class FailedToValidateCustomMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToValidateCustomMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_validate_custom_message" } }], + ) {} + +/** `failed_to_validate_expiration` -- `expiration_ts` was invalid. */ +export class FailedToValidateExpiration + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToValidateExpiration", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_validate_expiration" } }], + ) {} + +/** `failed_to_validate_team` -- The team calling this method was invalid. */ +export class FailedToValidateTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToValidateTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_validate_team" } }], + ) {} + +/** `failure_removing_emoji` -- This emoji could not be removed. It might be part of the standard Unicode set or the default Slack package. */ +export class FailureRemovingEmoji + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailureRemovingEmoji", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failure_removing_emoji" } }], + ) {} + +/** `feature_not_available` -- The user token does not belong to an Enterprise or Business+ team. */ +export class FeatureNotAvailable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FeatureNotAvailable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "feature_not_available" } }], + ) {} + +/** `feature_not_enabled` -- This feature is not enabled on your workspace. */ +export class FeatureNotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FeatureNotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "feature_not_enabled" } }], + ) {} + +/** `file_not_found` -- The analytics data for the `date` specified weren't found. */ +export class FileNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_not_found" } }], + ) {} + +/** `file_not_yet_available` -- The analytics data for the `date` isn't available yet. */ +export class FileNotYetAvailable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileNotYetAvailable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_not_yet_available" } }], + ) {} + +/** `function_not_found` -- The referenced function does not exist. */ +export class FunctionNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FunctionNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "function_not_found" } }], + ) {} + +/** `group_already_linked_to_channel` -- The IDP group is already linked to the channel */ +export class GroupAlreadyLinkedToChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("GroupAlreadyLinkedToChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "group_already_linked_to_channel" } }], + ) {} + +/** `group_must_not_be_empty` -- The IDP group is currently empty. */ +export class GroupMustNotBeEmpty + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("GroupMustNotBeEmpty", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "group_must_not_be_empty" } }], + ) {} + +/** `group_not_found` -- `group_id` can't be found. */ +export class GroupNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("GroupNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "group_not_found" } }], + ) {} + +/** `handle_already_exists` -- The handle specified is used by another usergroup or entity and cannot be created. */ +export class HandleAlreadyExists + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("HandleAlreadyExists", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "handle_already_exists" } }], + ) {} + +/** `include_deactivated_user_workspaces_invalid` -- `include_deactivated_user_workspaces` only applies with org token and no team_id. */ +export class IncludeDeactivatedUserWorkspacesInvalid + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "IncludeDeactivatedUserWorkspacesInvalid", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "include_deactivated_user_workspaces_invalid" } }], + ) {} + +/** `insufficient_permissions_to_share_channel` -- The authenticated user isn't an org admin or owner and tried to add or remove an unlisted workspace that isn't visible to them. Ask an org admin or owner with permission to manage the channel to make this change. */ +export class InsufficientPermissionsToShareChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "InsufficientPermissionsToShareChannel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "insufficient_permissions_to_share_channel" } }], + ) {} + +/** `invalid_actor` -- The provided actor_id is not a valid user or application */ +export class InvalidActor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidActor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_actor" } }], + ) {} + +/** `invalid_app` -- App ID provided is not valid for team and user. */ +export class InvalidApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidApp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_app" } }], + ) {} + +/** `invalid_app_id` -- App ID provided is not valid. */ +export class InvalidAppId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAppId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_app_id" } }], + ) {} + +/** `invalid_approved_acl` -- The `approved_acl` passed is invalid, or can't be applied to this request. The app was not approved. */ +export class InvalidApprovedAcl + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidApprovedAcl", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_approved_acl" } }], + ) {} + +/** `invalid_args` -- Required arguments either were not provided or contain invalid values. */ +export class InvalidArgs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArgs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_args" } }], + ) {} + +/** `invalid_arguments` -- Arguments weren't fully provided. For example, the `date` argument wasn't passed. */ +export class InvalidArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_arguments" } }], + ) {} + +/** `invalid_category` -- The category isn't one of the supported skill categories. */ +export class InvalidCategory + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCategory", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_category" } }], + ) {} + +/** `invalid_channel` -- The channel can't be linked to an IDP group (i.e., it's a public channel or external shared channel). */ +export class InvalidChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_channel" } }], + ) {} + +/** `invalid_channel_id` -- `channel_id` was invalid. */ +export class InvalidChannelId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChannelId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_channel_id" } }], + ) {} + +/** `invalid_channel_restriction_mode` -- Cannot add channels when channel_restriction_mode is all_channels. Use set to configure a restriction mode first. */ +export class InvalidChannelRestrictionMode + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChannelRestrictionMode", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_channel_restriction_mode" } }], + ) {} + +/** `invalid_channels_limit` -- The number of channel IDs passed in is larger than 100. */ +export class InvalidChannelsLimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChannelsLimit", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_channels_limit" } }], + ) {} + +/** `invalid_channel_type` -- Channel type cannot be linked. */ +export class InvalidChannelType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChannelType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_channel_type" } }], + ) {} + +/** `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_date` -- The `date` argument was invalid. */ +export class InvalidDate + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidDate", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_date" } }], + ) {} + +/** `invalid_domains` -- At least one URL or email is invalid */ +export class InvalidDomains + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidDomains", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_domains" } }], + ) {} + +/** `invalid_duration` -- Retention `duration_days` must be an integer greater than 0 days and less than 36500 days (100 years). */ +export class InvalidDuration + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidDuration", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_duration" } }], + ) {} + +/** `invalid_email` -- Email address was not valid. */ +export class InvalidEmail + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEmail", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_email" } }], + ) {} + +/** `invalid_enterprise` -- Enterprise does not exist */ +export class InvalidEnterprise + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEnterprise", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_enterprise" } }], + ) {} + +/** `invalid_entities` -- Invalid entities. */ +export class InvalidEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_entities" } }], + ) {} + +/** `invalid_field_or_data` -- user attempted to write and invalid field or data to the team config */ +export class InvalidFieldOrData + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidFieldOrData", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_field_or_data" } }], + ) {} + +/** `invalid_limit` -- The value passed for `limit` was not valid. */ +export class InvalidLimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidLimit", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_limit" } }], + ) {} + +/** `invalid_name` -- The value passed for `name` was invalid. */ +export class InvalidName + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidName", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_name" } }], + ) {} + +/** `invalid_named_entities` -- Named entities visibility requires a valid set of named entities to be specified */ +export class InvalidNamedEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidNamedEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_named_entities" } }], + ) {} + +/** `invalid_name_maxlength` -- The channel name exceeds the maximum allowed length. */ +export class InvalidNameMaxlength + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidNameMaxlength", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_name_maxlength" } }], + ) {} + +/** `invalid_name_specials` -- Value passed for `name` contained unallowed special characters or upper case characters. */ +export class InvalidNameSpecials + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidNameSpecials", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_name_specials" } }], + ) {} + +/** `invalid_permission` -- Invalid value for permission */ +export class InvalidPermission + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidPermission", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_permission" } }], + ) {} + +/** `invalid_permissions` -- This method is only accessible by org owners and admins. */ +export class InvalidPermissions + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidPermissions", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_permissions" } }], + ) {} + +/** `invalid_permission_set` -- This permission set is invalid. */ +export class InvalidPermissionSet + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidPermissionSet", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_permission_set" } }], + ) {} + +/** `invalid_permission_type` -- The permission_type value is not valid. */ +export class InvalidPermissionType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidPermissionType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_permission_type" } }], + ) {} + +/** `invalid_request` -- The `invite_request_id` passed is invalid. */ +export class InvalidRequest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRequest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_request" } }], + ) {} + +/** `invalid_request_id` -- The `request_id` passed is invalid. */ +export class InvalidRequestId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRequestId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_request_id" } }], + ) {} + +/** `invalid_restricted_subjects` -- The restricted subjects provided are invalid or not currently supported. */ +export class InvalidRestrictedSubjects + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRestrictedSubjects", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_restricted_subjects" } }], + ) {} + +/** `invalid_role_for_user` -- The requested status is incompatible with the user's role on another workspace. */ +export class InvalidRoleForUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRoleForUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_role_for_user" } }], + ) {} + +/** `invalid_role_id` -- The role type passed does not exist. */ +export class InvalidRoleId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRoleId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_role_id" } }], + ) {} + +/** `invalid_scopes` -- Some of the provided scopes do not exist. */ +export class InvalidScopes + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidScopes", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_scopes" } }], + ) {} + +/** `invalid_search_channel_type` -- An invalid `search_channel_types` arg was passed. Make sure there are no spaces between your args and that each is one of the enumerated options listed above. */ +export class InvalidSearchChannelType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidSearchChannelType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_search_channel_type" } }], + ) {} + +/** `invalid_setting` -- The `app_collaborators` setting is not allowed for apps not owned by your team/org. */ +export class InvalidSetting + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidSetting", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_setting" } }], + ) {} + +/** `invalid_sort` -- The provided `sort` argument wasn't valid. */ +export class InvalidSort + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidSort", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_sort" } }], + ) {} + +/** `invalid_sort_dir` -- The provided `sort_dir` argument wasn't valid. */ +export class InvalidSortDir + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidSortDir", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_sort_dir" } }], + ) {} + +/** `invalid_target_team` -- Target workspace is invalid. */ +export class InvalidTargetTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTargetTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_target_team" } }], + ) {} + +/** `invalid_team` -- Team ID provided is not valid */ +export class InvalidTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_team" } }], + ) {} + +/** `invalid_team_id` -- The team ID passed is invalid */ +export class InvalidTeamId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTeamId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_team_id" } }], + ) {} + +/** `invalid_team_ids` -- One or more team IDs provided were invalid; see the `errors` field in the response for the list of invalid team IDs. */ +export class InvalidTeamIds + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTeamIds", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_team_ids" } }], + ) {} + +/** `invalid_type` -- The analytics data for the `type` specified weren't found. */ +export class InvalidType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_type" } }], + ) {} + +/** `invalid_url` -- Invalid url. */ +export class InvalidUrl + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidUrl", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_url" } }], + ) {} + +/** `invalid_user` -- Value passed for `user_id` was not valid */ +export class InvalidUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_user" } }], + ) {} + +/** `invalid_usergroup` -- A usergroup with the specified ID does not exist. */ +export class InvalidUsergroup + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidUsergroup", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_usergroup" } }], + ) {} + +/** `invalid_users` -- One or more users provided can not be added to the usergroup. */ +export class InvalidUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_users" } }], + ) {} + +/** `invalid_value` -- Value passed for the preferences are invalid */ +export class InvalidValue + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidValue", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_value" } }], + ) {} + +/** `invalid_visibility` -- Invalid value for visibility. */ +export class InvalidVisibility + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidVisibility", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_visibility" } }], + ) {} + +/** `invalid_workflow_auth_strategy` -- workflow auth strategy is invalid */ +export class InvalidWorkflowAuthStrategy + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidWorkflowAuthStrategy", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_workflow_auth_strategy" } }], + ) {} + +/** `invited_user_not_created` -- The invited user could not be created. */ +export class InvitedUserNotCreated + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvitedUserNotCreated", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invited_user_not_created" } }], + ) {} + +/** `invited_user_not_reactivated` -- The invited user could not be reactivated. */ +export class InvitedUserNotReactivated + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvitedUserNotReactivated", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invited_user_not_reactivated" } }], + ) {} + +/** `inviter_email_not_verified` -- The user is still invited, and the user whose token is calling this method has not verified the email address on their own account. They must verify it before adding an invited user to a workspace. */ +export class InviterEmailNotVerified + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviterEmailNotVerified", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "inviter_email_not_verified" } }], + ) {} + +/** `invitor_cannot_see_channel` -- The invitor is not part of one or many channels that the user was requested to be added to */ +export class InvitorCannotSeeChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvitorCannotSeeChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invitor_cannot_see_channel" } }], + ) {} + +/** `is_idp_managed` -- The channel cannot be converted because it is IDP Managed */ +export class IsIdpManaged + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("IsIdpManaged", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "is_idp_managed" } }], + ) {} + +/** `leaving_team_not_in_channel` -- The workspace being removed is not connected to the channel. */ +export class LeavingTeamNotInChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("LeavingTeamNotInChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "leaving_team_not_in_channel" } }], + ) {} + +/** `leaving_team_required` -- There are more than two teams in the channel--you must supplied a `leaving_team_id` parameter. */ +export class LeavingTeamRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("LeavingTeamRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "leaving_team_required" } }], + ) {} + +/** `link_not_found` -- There was no link found between the specified channel and the IDP group. */ +export class LinkNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("LinkNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "link_not_found" } }], + ) {} + +/** `managed_channel_not_supported` -- Cannot unshare a managed channel */ +export class ManagedChannelNotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ManagedChannelNotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "managed_channel_not_supported" } }], + ) {} + +/** `member_analytics_disabled` -- Member analytics are disabled for your organization. */ +export class MemberAnalyticsDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MemberAnalyticsDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "member_analytics_disabled" } }], + ) {} + +/** `member_count_would_exceed_visible_limit` -- The usergroup is visible and the member count would exceed the limit. */ +export class MemberCountWouldExceedVisibleLimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "MemberCountWouldExceedVisibleLimit", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "member_count_would_exceed_visible_limit" } }], + ) {} + +/** `metadata_not_available` -- Metadata not available for the analytics `type` you provided. */ +export class MetadataNotAvailable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MetadataNotAvailable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "metadata_not_available" } }], + ) {} + +/** `metadata_only_does_not_support_date` -- The `metadata_only` field gets the latest metadata file. The `date` field is not supported. */ +export class MetadataOnlyDoesNotSupportDate + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "MetadataOnlyDoesNotSupportDate", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "metadata_only_does_not_support_date" } }], + ) {} + +/** `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. */ +export class MethodNotSupportedForChannelType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "MethodNotSupportedForChannelType", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "method_not_supported_for_channel_type" } }], + ) {} + +/** `method_not_supported_for_skill_type` -- Only canvas skills can be deployed. */ +export class MethodNotSupportedForSkillType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "MethodNotSupportedForSkillType", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "method_not_supported_for_skill_type" } }], + ) {} + +/** `missing_args` -- Either app_ids or rich_link_preview_types must be provided */ +export class MissingArgs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_args" } }], + ) {} + +/** `missing_record_channel_config` -- Record Channels are not enabled for the given object type. */ +export class MissingRecordChannelConfig + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingRecordChannelConfig", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_record_channel_config" } }], + ) {} + +/** `missing_scope` -- This token doesn't have the scope required. */ +export class MissingScope + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingScope", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_scope" } }], + ) {} + +/** `missing_team` -- A `team_id` must be provided with a `user_id`. */ +export class MissingTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_team" } }], + ) {} + +/** `missing_user` -- A `user_id` must be provided with a `team_id`. */ +export class MissingUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_user" } }], + ) {} + +/** `multi_workspace_restriction` -- The IDP group has members that cannot be linked to more than one workspace. */ +export class MultiWorkspaceRestriction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MultiWorkspaceRestriction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "multi_workspace_restriction" } }], + ) {} + +/** `must_provide_team_domain` -- No team domain has been provided. */ +export class MustProvideTeamDomain + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MustProvideTeamDomain", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "must_provide_team_domain" } }], + ) {} + +/** `must_provide_team_name` -- No team name has been provided. */ +export class MustProvideTeamName + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MustProvideTeamName", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "must_provide_team_name" } }], + ) {} + +/** `must_revoke_access` -- Organization-deployed apps cannot be uninstalled from specific workspaces using this API. */ +export class MustRevokeAccess + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MustRevokeAccess", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "must_revoke_access" } }], + ) {} + +/** `name_already_exists` -- The name specified is used by another usergroup and cannot be created. */ +export class NameAlreadyExists + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NameAlreadyExists", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "name_already_exists" } }], + ) {} + +/** `named_entities_cannot_be_empty` -- Must pass at least one valid named entity when permission_type is named_entities or named_entities_exclude. */ +export class NamedEntitiesCannotBeEmpty + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NamedEntitiesCannotBeEmpty", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "named_entities_cannot_be_empty" } }], + ) {} + +/** `name_taken` -- A private channel cannot be created with the given name. */ +export class NameTaken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NameTaken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "name_taken" } }], + ) {} + +/** `name_taken_in_org` -- The team with the specified name already exists in the org. */ +export class NameTakenInOrg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NameTakenInOrg", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "name_taken_in_org" } }], + ) {} + +/** `no_active_sessions` -- No active sessions were found. */ +export class NoActiveSessions + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoActiveSessions", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_active_sessions" } }], + ) {} + +/** `no_alias_selected` -- Value passed for `alias_for` was invalid. */ +export class NoAliasSelected + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoAliasSelected", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_alias_selected" } }], + ) {} + +/** `no_channel_memberships` -- The channel has no members. */ +export class NoChannelMemberships + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoChannelMemberships", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_channel_memberships" } }], + ) {} + +/** `no_domains_provided` -- At least one allowed domain must be specified if populating the argument */ +export class NoDomainsProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoDomainsProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_domains_provided" } }], + ) {} + +/** `no_image_uploaded` -- No image data was provided. */ +export class NoImageUploaded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoImageUploaded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_image_uploaded" } }], + ) {} + +/** `no_local_user_on_team` -- The workspace provided had no users. */ +export class NoLocalUserOnTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoLocalUserOnTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_local_user_on_team" } }], + ) {} + +/** `no_perms` -- User does not have appropriate permissions. */ +export class NoPerms + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoPerms", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_perms" } }], + ) {} + +/** `no_resolution_found` -- No existing resolutions were found for the given `team` and `app_id`. */ +export class NoResolutionFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoResolutionFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_resolution_found" } }], + ) {} + +/** `not_allowed` -- The user is not allowed to access this API method */ +export class NotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_allowed" } }], + ) {} + +/** `not_allowed_for_grid_workspace` -- Channel type is not allowed for this Enterprise org workspace. */ +export class NotAllowedForGridWorkspace + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAllowedForGridWorkspace", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_allowed_for_grid_workspace" } }], + ) {} + +/** `not_allowed_to_create_automation_rule` -- The actor does not have permission to create AAA automation rules. The app was approved but the auto-install rule was not created. */ +export class NotAllowedToCreateAutomationRule + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "NotAllowedToCreateAutomationRule", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "not_allowed_to_create_automation_rule" } }], + ) {} + +/** `not_an_admin` -- The user token does not have admin privileges. */ +export class NotAnAdmin + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAnAdmin", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_an_admin" } }], + ) {} + +/** `not_an_enterprise` -- The user token does not belong to an enterprise. */ +export class NotAnEnterprise + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAnEnterprise", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_an_enterprise" } }], + ) {} + +/** `no_team_ids_given` -- The `team_ids` parameter was empty. */ +export class NoTeamIdsGiven + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoTeamIdsGiven", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_team_ids_given" } }], + ) {} + +/** `no_team_or_enterprise_provided` -- Must provide team ID or enterprise ID */ +export class NoTeamOrEnterpriseProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoTeamOrEnterpriseProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_team_or_enterprise_provided" } }], + ) {} + +/** `no_teams_to_disconnect` -- This channel is not shared, so there are no workspaces to disconnect. */ +export class NoTeamsToDisconnect + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoTeamsToDisconnect", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_teams_to_disconnect" } }], + ) {} + +/** `not_enabled` -- The API endpoint is not enabled for your team. */ +export class NotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_enabled" } }], + ) {} + +/** `not_permitted` -- This action is not permitted */ +export class NotPermitted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotPermitted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_permitted" } }], + ) {} + +/** `not_supported` -- Conversion to public channel is not supported for this channel. */ +export class NotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_supported" } }], + ) {} + +/** `no_valid_channels` -- All input channels are invalid */ +export class NoValidChannels + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoValidChannels", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_valid_channels" } }], + ) {} + +/** `no_valid_entities` -- None of the entities passed were valid. */ +export class NoValidEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoValidEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_valid_entities" } }], + ) {} + +/** `no_valid_named_entities` -- None of the provided named entities were valid. */ +export class NoValidNamedEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoValidNamedEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_valid_named_entities" } }], + ) {} + +/** `no_valid_teams` -- The team_ids argument doesn't contain any valid teams */ +export class NoValidTeams + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoValidTeams", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_valid_teams" } }], + ) {} + +/** `no_valid_users` -- None of the users passed were valid. */ +export class NoValidUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoValidUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_valid_users" } }], + ) {} + +/** `one_or_more_invalid_channels` -- One or more of the passed channel IDs was invalid. */ +export class OneOrMoreInvalidChannels + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OneOrMoreInvalidChannels", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "one_or_more_invalid_channels" } }], + ) {} + +/** `org_level_email_display_disabled` -- This API is unavailable for organizations with a _'Hide email addresses'_ policy. */ +export class OrgLevelEmailDisplayDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OrgLevelEmailDisplayDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "org_level_email_display_disabled" } }], + ) {} + +/** `org_resolution_required` -- The `team_id` is in an Enterprise org while `app_id` is certified. */ +export class OrgResolutionRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OrgResolutionRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "org_resolution_required" } }], + ) {} + +/** `over_max_entity_limit` -- The number of entities assigned to this policy has reached its upper limit. */ +export class OverMaxEntityLimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OverMaxEntityLimit", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "over_max_entity_limit" } }], + ) {} + +/** `paid_teams_only` -- This feature is only accessible to paid teams */ +export class PaidTeamsOnly + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PaidTeamsOnly", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "paid_teams_only" } }], + ) {} + +/** `permission_denied` -- You do not have permission to uninstall applications from the requested org or workspaces. */ +export class PermissionDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PermissionDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "permission_denied" } }], + ) {} + +/** `policy_not_found` -- The policy name doesn't match any of the existing org policies. */ +export class PolicyNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PolicyNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "policy_not_found" } }], + ) {} + +/** `primary_usergroup_not_found` -- The id passed in for primary_usergroup_id can't be found. */ +export class PrimaryUsergroupNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PrimaryUsergroupNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "primary_usergroup_not_found" } }], + ) {} + +/** `property_not_allowed` -- The property passed in is not allowed to be updated. */ +export class PropertyNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PropertyNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "property_not_allowed" } }], + ) {} + +/** `record_channel_already_exists` -- Record is linked to a different channel. */ +export class RecordChannelAlreadyExists + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RecordChannelAlreadyExists", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "record_channel_already_exists" } }], + ) {} + +/** `record_channel_cannot_be_externally_shared` -- Channel cannot be linked because it is externally shared. */ +export class RecordChannelCannotBeExternallyShared + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "RecordChannelCannotBeExternallyShared", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "record_channel_cannot_be_externally_shared" } }], + ) {} + +/** `record_not_found` -- Value passed for `salesforce_org_id` or `object_id` is invalid. */ +export class RecordNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RecordNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "record_not_found" } }], + ) {} + +/** `request_already_resolved` -- The app request has already been resolved. */ +export class RequestAlreadyResolved + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RequestAlreadyResolved", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "request_already_resolved" } }], + ) {} + +/** `request_id_or_app_id_is_required` -- Must include a `request_id` or `app_id`. */ +export class RequestIdOrAppIdIsRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RequestIdOrAppIdIsRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "request_id_or_app_id_is_required" } }], + ) {} + +/** `request_id_required_for_custom_integrations` -- A `request_id` is required for custom integrations. */ +export class RequestIdRequiredForCustomIntegrations + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "RequestIdRequiredForCustomIntegrations", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "request_id_required_for_custom_integrations" } }], + ) {} + +/** `required_visibility` -- Visibility is required on this resource. */ +export class RequiredVisibility + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RequiredVisibility", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "required_visibility" } }], + ) {} + +/** `resized_but_still_too_large` -- The image is still too large after resizing. */ +export class ResizedButStillTooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ResizedButStillTooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "resized_but_still_too_large" } }], + ) {} + +/** `restricted_action` -- The token does not have permission to access this resource, or the channel is not public and the organization has disabled private channel analytics. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `restricted_plan_level` -- The enterprise plan level does not have access to this feature. */ +export class RestrictedPlanLevel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedPlanLevel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_plan_level" } }], + ) {} + +/** `retention_override_not_allowed` -- The current org retention policy disallows modifying the retention policy of this channel. */ +export class RetentionOverrideNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RetentionOverrideNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "retention_override_not_allowed" } }], + ) {} + +/** `server_acl_entities_not_in_scope` -- One or more entities in the server ACL are not in scope of the app-level ACL. */ +export class ServerAclEntitiesNotInScope + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ServerAclEntitiesNotInScope", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "server_acl_entities_not_in_scope" } }], + ) {} + +/** `server_acl_type_broader_than_app` -- The chosen permission type is broader than the app-level ACL allows. */ +export class ServerAclTypeBroaderThanApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ServerAclTypeBroaderThanApp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "server_acl_type_broader_than_app" } }], + ) {} + +/** `server_not_found` -- The specified MCP server does not exist for this app. */ +export class ServerNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ServerNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "server_not_found" } }], + ) {} + +/** `session_invalidation_failed` -- There was an error invalidating the session. */ +export class SessionInvalidationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SessionInvalidationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "session_invalidation_failed" } }], + ) {} + +/** `session_not_found` -- The requested session wasn't found. */ +export class SessionNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SessionNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "session_not_found" } }], + ) {} + +/** `session_reset_not_allowed` -- Only primary owner can reset primary owner's sessions */ +export class SessionResetNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SessionResetNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "session_reset_not_allowed" } }], + ) {} + +/** `skill_not_found` -- The skill is missing, deleted, no longer a skill, or outside this organization or workspace. */ +export class SkillNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SkillNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "skill_not_found" } }], + ) {} + +/** `skill_not_visible_to_audience` -- Share the skill first. usergroup_ids lists the groups that cannot view it. */ +export class SkillNotVisibleToAudience + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SkillNotVisibleToAudience", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "skill_not_visible_to_audience" } }], + ) {} + +/** `specify_enterprise_or_teams` -- Provide exactly one of `enterprise_id` or `team_ids`. */ +export class SpecifyEnterpriseOrTeams + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SpecifyEnterpriseOrTeams", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "specify_enterprise_or_teams" } }], + ) {} + +/** `subteam_limit_exceeded` -- A csv upload can only contain at most 15k users. */ +export class SubteamLimitExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SubteamLimitExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "subteam_limit_exceeded" } }], + ) {} + +/** `target_team_not_found` -- Target team ID provided does not exist */ +export class TargetTeamNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TargetTeamNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "target_team_not_found" } }], + ) {} + +/** `target_team_not_on_org` -- The specified target_team is not part of the organization. */ +export class TargetTeamNotOnOrg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TargetTeamNotOnOrg", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "target_team_not_on_org" } }], + ) {} + +/** `team_id_or_org_required` -- You must provide a `team_id` or set `org_wide` to `true`. */ +export class TeamIdOrOrgRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamIdOrOrgRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "team_id_or_org_required" } }], + ) {} + +/** `team_id_required_for_enterprise` -- Team ID required. */ +export class TeamIdRequiredForEnterprise + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamIdRequiredForEnterprise", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "team_id_required_for_enterprise" } }], + ) {} + +/** `team_limit_exceeded` -- The number of teams associated with the org group would exceed the limit. */ +export class TeamLimitExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamLimitExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "team_limit_exceeded" } }], + ) {} + +/** `team_not_found` -- Returned when team id is not found. */ +export class TeamNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "team_not_found" } }], + ) {} + +/** `teams_not_found` -- One or more of the provided `team_ids` were not found. */ +export class TeamsNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamsNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "teams_not_found" } }], + ) {} + +/** `too_many_channels` -- The user was requested to be added to more channels than is allowed. */ +export class TooManyChannels + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyChannels", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_channels" } }], + ) {} + +/** `too_many_domains_provided` -- Too many domains provided. Please provide 50 or less for each type of domain */ +export class TooManyDomainsProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyDomainsProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_domains_provided" } }], + ) {} + +/** `too_many_entities` -- More than 10 role scopes were passed. */ +export class TooManyEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_entities" } }], + ) {} + +/** `too_many_frames` -- The image has too many frames. */ +export class TooManyFrames + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyFrames", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_frames" } }], + ) {} + +/** `too_many_ids_provided` -- Please provide only `app_id` OR `request_id`. */ +export class TooManyIdsProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyIdsProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_ids_provided" } }], + ) {} + +/** `too_many_named_entities` -- Too many named entities passed into the app permissions setting. */ +export class TooManyNamedEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyNamedEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_named_entities" } }], + ) {} + +/** `too_many_properties` -- Only one channel property can be updated at a time. */ +export class TooManyProperties + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyProperties", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_properties" } }], + ) {} + +/** `too_many_target_teams` -- Too many `target_team_ids` were provided. */ +export class TooManyTargetTeams + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyTargetTeams", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_target_teams" } }], + ) {} + +/** `too_many_teams` -- Too many IDs are present in `team_ids`. */ +export class TooManyTeams + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyTeams", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_teams" } }], + ) {} + +/** `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id`. */ +export class TooManyTeamsProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyTeamsProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_teams_provided" } }], + ) {} + +/** `too_many_usergroup_members_to_make_visible` -- Tried to set the group to visible but the group has too many members */ +export class TooManyUsergroupMembersToMakeVisible + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "TooManyUsergroupMembersToMakeVisible", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "too_many_usergroup_members_to_make_visible" } }], + ) {} + +/** `too_many_users` -- Too many user IDs provided (maximum 100). */ +export class TooManyUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_users" } }], + ) {} + +/** `trigger_type_id_not_found` -- The given trigger type ID(s) do not map to valid trigger types */ +export class TriggerTypeIdNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TriggerTypeIdNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "trigger_type_id_not_found" } }], + ) {} + +/** `unable_to_link_idp_group_and_channel` -- The IDP group and the channel cannot be linked. */ +export class UnableToLinkIdpGroupAndChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "UnableToLinkIdpGroupAndChannel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "unable_to_link_idp_group_and_channel" } }], + ) {} + +/** `unable_to_parse_csv` -- Could not parse the uploaded csv. */ +export class UnableToParseCsv + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnableToParseCsv", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unable_to_parse_csv" } }], + ) {} + +/** `unable_to_process_post_request` -- The user sent a malformed post request */ +export class UnableToProcessPostRequest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnableToProcessPostRequest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unable_to_process_post_request" } }], + ) {} + +/** `unable_to_unlink_idp_group_and_channel` -- The IDP group and channel cannot be unlinked. */ +export class UnableToUnlinkIdpGroupAndChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "UnableToUnlinkIdpGroupAndChannel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "unable_to_unlink_idp_group_and_channel" } }], + ) {} + +/** `unable_to_update_existing_sessions` -- The session settings could not be applied to users' existing sessions. */ +export class UnableToUpdateExistingSessions + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "UnableToUpdateExistingSessions", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "unable_to_update_existing_sessions" } }], + ) {} + +/** `unknown_method` -- This method does not exist. */ +export class UnknownMethod + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownMethod", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_method" } }], + ) {} + +/** `unsupported_action_describe` -- The user specified action is unsupported */ +export class UnsupportedActionDescribe + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnsupportedActionDescribe", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unsupported_action_describe" } }], + ) {} + +/** `unsupported_action_put` -- The user specified action is unsupported */ +export class UnsupportedActionPut + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnsupportedActionPut", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unsupported_action_put" } }], + ) {} + +/** `unsupported_arguments` -- The provided method arguments are not supported. */ +export class UnsupportedArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnsupportedArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unsupported_arguments" } }], + ) {} + +/** `unsupported_team_type` -- This endpoint can only called by Enterprise organizations. */ +export class UnsupportedTeamType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnsupportedTeamType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unsupported_team_type" } }], + ) {} + +/** `url_restriction_not_supported` -- URL restriction is not supported for this app. */ +export class UrlRestrictionNotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UrlRestrictionNotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "url_restriction_not_supported" } }], + ) {} + +/** `user_already_deleted` -- The requested user has already been marked as deleted. */ +export class UserAlreadyDeleted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserAlreadyDeleted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_already_deleted" } }], + ) {} + +/** `user_already_team_member` -- The given user is already active on the given team. */ +export class UserAlreadyTeamMember + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserAlreadyTeamMember", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_already_team_member" } }], + ) {} + +/** `user_cannot_be_added_to_workspace` -- The user can't be added to this workspace because of their account type or the workspace's configuration. */ +export class UserCannotBeAddedToWorkspace + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserCannotBeAddedToWorkspace", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_cannot_be_added_to_workspace" } }], + ) {} + +/** `user_cannot_manage_public_channels` -- The user must have permissions to manage public channels at the Enterprise level. */ +export class UserCannotManagePublicChannels + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "UserCannotManagePublicChannels", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "user_cannot_manage_public_channels" } }], + ) {} + +/** `user_channel_limit_exceeded` -- Adding these channels would cause one or more members to exceed their channel limit. */ +export class UserChannelLimitExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserChannelLimitExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_channel_limit_exceeded" } }], + ) {} + +/** `user_disabled` -- The user is disabled. */ +export class UserDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_disabled" } }], + ) {} + +/** `usergroup_ids_not_allowed` -- Only named_entities accepts usergroup_ids. */ +export class UsergroupIdsNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UsergroupIdsNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "usergroup_ids_not_allowed" } }], + ) {} + +/** `usergroup_not_found` -- One or more usergroup IDs are not valid. */ +export class UsergroupNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UsergroupNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "usergroup_not_found" } }], + ) {} + +/** `usergroup_not_linked_to_team` -- The IDP group provided is not linked to the workspace. */ +export class UsergroupNotLinkedToTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UsergroupNotLinkedToTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "usergroup_not_linked_to_team" } }], + ) {} + +/** `usergroup_team_not_provisioned` -- The IDP group provided is linked to a workspace that has auto-provision disabled. */ +export class UsergroupTeamNotProvisioned + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UsergroupTeamNotProvisioned", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "usergroup_team_not_provisioned" } }], + ) {} + +/** `user_is_already_deleted` -- The user has already been deleted and disabled. */ +export class UserIsAlreadyDeleted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserIsAlreadyDeleted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_is_already_deleted" } }], + ) {} + +/** `user_is_bot` -- The given user is a bot from an app. This api only works with humans. */ +export class UserIsBot + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserIsBot", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_is_bot" } }], + ) {} + +/** `user_is_deactivated` -- User has been deactivated. */ +export class UserIsDeactivated + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserIsDeactivated", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_is_deactivated" } }], + ) {} + +/** `user_is_not_a_guest` -- The passed user_id does not belong to a guest user. */ +export class UserIsNotAGuest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserIsNotAGuest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_is_not_a_guest" } }], + ) {} + +/** `user_is_not_guest` -- The user is not a guest */ +export class UserIsNotGuest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserIsNotGuest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_is_not_guest" } }], + ) {} + +/** `user_is_restricted` -- This method is only accessible by org owners, admins, and integration managers */ +export class UserIsRestricted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserIsRestricted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_is_restricted" } }], + ) {} + +/** `user_is_team_primary_owner` -- The user is a primary owner of one or more workspaces and cannot be deactivated. */ +export class UserIsTeamPrimaryOwner + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserIsTeamPrimaryOwner", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_is_team_primary_owner" } }], + ) {} + +/** `user_must_be_admin` -- The token provided must be associated with an Org Admin or Owner. */ +export class UserMustBeAdmin + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserMustBeAdmin", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_must_be_admin" } }], + ) {} + +/** `user_must_be_in_workspace` -- This user must be a member of at least one workspace. */ +export class UserMustBeInWorkspace + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserMustBeInWorkspace", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_must_be_in_workspace" } }], + ) {} + +/** `user_not_found` -- One or more user IDs are not valid. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + +/** `user_session_reset_failed` -- There was an error starting the session reset. Try again. */ +export class UserSessionResetFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserSessionResetFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_session_reset_failed" } }], + ) {} + +/** `visibility_is_not_named_entities` -- The visibility should be named entities when the user_ids, team_ids, or org_ids args are set */ +export class VisibilityIsNotNamedEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("VisibilityIsNotNamedEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "visibility_is_not_named_entities" } }], + ) {} + +/** `visible_group_needs_handle` -- Tried to set the group to visible but did not provide a handle. */ +export class VisibleGroupNeedsHandle + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("VisibleGroupNeedsHandle", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "visible_group_needs_handle" } }], + ) {} + +/** `workspace_not_eligible` -- The workspace is not eligible to be linked to this IDP group; it is not on the org's allow-list of eligible workspaces. */ +export class WorkspaceNotEligible + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("WorkspaceNotEligible", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "workspace_not_eligible" } }], + ) {} + export interface AddAliasRequest { /** The new alias for the specified emoji. Any wrapping whitespace or colons will be automatically trimmed. */ name: string; @@ -2544,8 +7091,19 @@ export interface UploadUsersResponse { successful_user_count: number; invalid_users?: UploadUsersResponseInvalidUsersList | undefined; } -export type AddAliasError = SlackOpError; -/** Add an emoji alias. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `emoji_limit_reached` -- Unable to add emoji due to limit reached. - `error_bad_name_i18n` -- Value passed for `name` was invalid. - `error_invalid_alias` -- Value passed for `alias_for` does not exist. - `error_missing_name` -- Value passed for `name` is missing or empty. - `error_name_taken` -- Value passed for `name` already exists. - `error_name_taken_i18n` -- The name has already been taken by another emoji, in the international set. Emoji must have unique names. - `failed_to_alias_emoji` -- Failed to alias the specified emoji. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `no_alias_selected` -- Value passed for `alias_for` was invalid. - `not_an_admin` -- This method is only accessible by org owners and Admins. See https://docs.slack.dev/reference/methods/admin.emoji.addAlias */ +export type AddAliasError = + | EmojiLimitReached + | ErrorBadNameI18n + | ErrorInvalidAlias + | ErrorMissingName + | ErrorNameTaken + | ErrorNameTakenI18n + | FailedToAliasEmoji + | FeatureNotEnabled + | NoAliasSelected + | NotAnAdmin + | SlackOpError; +/** Add an emoji alias. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `emoji_limit_reached` -- Unable to add emoji due to limit reached. - `error_bad_name_i18n` -- Value passed for `name` was invalid. - `error_invalid_alias` -- Value passed for `alias_for` does not exist. - `error_missing_name` -- Value passed for `name` is missing or empty. - `error_name_taken` -- Value passed for `name` already exists. - `error_name_taken_i18n` -- The name has already been taken by another emoji, in the international set. Emoji must have unique names. - `failed_to_alias_emoji` -- Failed to alias the specified emoji. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `no_alias_selected` -- Value passed for `alias_for` was invalid. - `not_an_admin` -- This method is only accessible by org owners and Admins. See https://docs.slack.dev/reference/methods/admin.emoji.addAlias */ export const addAlias: API.OperationMethod< AddAliasRequest, AddAliasResponse, @@ -2554,15 +7112,42 @@ export const addAlias: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + EmojiLimitReached, + ErrorBadNameI18n, + ErrorInvalidAlias, + ErrorMissingName, + ErrorNameTaken, + ErrorNameTakenI18n, + FailedToAliasEmoji, + FeatureNotEnabled, + NoAliasSelected, + NotAnAdmin, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddAlias", })); -export type AddAppsPermissionsError = SlackOpError; -/** Grant permission for entities to access an app that has its permission type set to named_entities Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_auth` -- Invalid authorization token - `access_denied` -- This actor does not have access to the permissions on this resource. - `invalid_permission_type` -- This app requires permission_type to be set as named_entities before adding users. - `no_valid_named_entities` -- None of the provided named entities were valid - `too_many_named_entities` -- Too many named entities passed into the app permissions setting. - `app_not_found` -- This app does not exist. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `app_acl_not_found` -- This app does not have an ACL. - `internal_error` -- Internal error - `user_not_found` -- Value passed for `user_ids` was invalid. - `invalid_entities` -- Invalid entities. - `invalid_channel_restriction_mode` -- Cannot add channels when channel_restriction_mode is all_channels. Use set to configure a restriction mode first. - `channel_not_found` -- One or more channel IDs are not valid, are not in this organization, or name a private channel the caller is neither a member of nor permitted to manage. - `failed_to_update_channels` -- An error occurred while updating the channel restriction list. - `restricted_action` -- User does not have permission to perform this action. See https://docs.slack.dev/reference/methods/admin.apps.permissions.add */ +export type AddAppsPermissionsError = + | AccessDenied + | AppAclNotFound + | AppNotFound + | ChannelNotFound + | FailedToUpdateChannels + | InvalidChannelRestrictionMode + | InvalidEntities + | InvalidPermissionType + | NoValidNamedEntities + | NotAnEnterprise + | RestrictedAction + | TooManyNamedEntities + | UserNotFound + | SlackOpError; +/** Grant permission for entities to access an app that has its permission type set to named_entities Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_auth` -- Invalid authorization token - `access_denied` -- This actor does not have access to the permissions on this resource. - `invalid_permission_type` -- This app requires permission_type to be set as named_entities before adding users. - `no_valid_named_entities` -- None of the provided named entities were valid - `too_many_named_entities` -- Too many named entities passed into the app permissions setting. - `app_not_found` -- This app does not exist. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `app_acl_not_found` -- This app does not have an ACL. - `internal_error` -- Internal error - `user_not_found` -- Value passed for `user_ids` was invalid. - `invalid_entities` -- Invalid entities. - `invalid_channel_restriction_mode` -- Cannot add channels when channel_restriction_mode is all_channels. Use set to configure a restriction mode first. - `channel_not_found` -- One or more channel IDs are not valid, are not in this organization, or name a private channel the caller is neither a member of nor permitted to manage. - `failed_to_update_channels` -- An error occurred while updating the channel restriction list. - `restricted_action` -- User does not have permission to perform this action. See https://docs.slack.dev/reference/methods/admin.apps.permissions.add */ export const addAppsPermissions: API.OperationMethod< AddAppsPermissionsRequest, AddAppsPermissionsResponse, @@ -2571,151 +7156,356 @@ export const addAppsPermissions: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(16, __c2, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppAclNotFound, + AppNotFound, + ChannelNotFound, + FailedToUpdateChannels, + InvalidChannelRestrictionMode, + InvalidEntities, + InvalidPermissionType, + NoValidNamedEntities, + NotAnEnterprise, + RestrictedAction, + TooManyNamedEntities, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddAppsPermissions", })); -export type AddAssignmentsError = SlackOpError; -/** Adds members to the specified role with the specified scopes Required scopes -- user: `admin.roles:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_modify_role_admin` -- The user does not have permission to modify the admin role. - `failed_for_some_entities` -- At least one role scope ID was invalid - `failed_for_some_users` -- At least one user ID was invalid - `failed_for_some_users_and_entities` -- At least one role scope ID was invalid - `feature_not_enabled` -- This API is currently not enabled. - `invalid_actor` -- This API is only enabled for the Admins/Owners. - `invalid_role_id` -- The role type passed does not exist. - `no_valid_entities` -- None of the entities passed were valid. - `no_valid_users` -- None of the users passed were valid. - `too_many_entities` -- More than 10 role scopes were passed. - `too_many_users` -- More than 10 users were passed. See https://docs.slack.dev/reference/methods/admin.roles.addAssignments */ +export type AddAssignmentsError = + | CannotModifyRoleAdmin + | FailedForSomeEntities + | FailedForSomeUsers + | FailedForSomeUsersAndEntities + | FeatureNotEnabled + | InvalidActor + | InvalidRoleId + | NoValidEntities + | NoValidUsers + | TooManyEntities + | TooManyUsers + | SlackOpError; +/** Adds members to the specified role with the specified scopes Required scopes -- user: `admin.roles:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_modify_role_admin` -- The user does not have permission to modify the admin role. - `failed_for_some_entities` -- At least one role scope ID was invalid - `failed_for_some_users` -- At least one user ID was invalid - `failed_for_some_users_and_entities` -- At least one role scope ID was invalid - `feature_not_enabled` -- This API is currently not enabled. - `invalid_actor` -- This API is only enabled for the Admins/Owners. - `invalid_role_id` -- The role type passed does not exist. - `no_valid_entities` -- None of the entities passed were valid. - `no_valid_users` -- None of the users passed were valid. - `too_many_entities` -- More than 10 role scopes were passed. - `too_many_users` -- More than 10 users were passed. See https://docs.slack.dev/reference/methods/admin.roles.addAssignments */ export const addAssignments: API.OperationMethod< AddAssignmentsRequest, AddAssignmentsResponse, AddAssignmentsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(368, __c46, 0) as any as S.Schema, - output: __S(376, __c47, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(32, __c4, 0) as any as S.Schema, + output: __S(40, __c5, 0) as any as S.Schema, + errors: [ + CannotModifyRoleAdmin, + FailedForSomeEntities, + FailedForSomeUsers, + FailedForSomeUsersAndEntities, + FeatureNotEnabled, + InvalidActor, + InvalidRoleId, + NoValidEntities, + NoValidUsers, + TooManyEntities, + TooManyUsers, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddAssignments", })); -export type AddChannelsError = SlackOpError; -/** Add up to one hundred default channels to an IDP group. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- At least one of the provided channel IDs could not be found, or one of the channels has a type that is not supported. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `invalid_channels_limit` -- The number of channel IDs passed in is larger than 100. - `not_an_admin` -- The calling user cannot update the specified usergroup. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `team_not_found` -- The workspace provided was not found. - `user_channel_limit_exceeded` -- Adding these channels would cause one or more members to exceed their channel limit. - `usergroup_not_found` -- The IDP group provided was not found. - `usergroup_not_linked_to_team` -- The IDP group provided is not linked to the workspace. - `usergroup_team_not_provisioned` -- The IDP group provided is linked to a workspace that has auto-provision disabled. See https://docs.slack.dev/reference/methods/admin.usergroups.addChannels */ +export type AddChannelsError = + | ChannelNotFound + | FeatureNotEnabled + | InvalidChannelsLimit + | NotAnAdmin + | NotAnEnterprise + | TeamNotFound + | UserChannelLimitExceeded + | UsergroupNotFound + | UsergroupNotLinkedToTeam + | UsergroupTeamNotProvisioned + | SlackOpError; +/** Add up to one hundred default channels to an IDP group. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- At least one of the provided channel IDs could not be found, or one of the channels has a type that is not supported. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `invalid_channels_limit` -- The number of channel IDs passed in is larger than 100. - `not_an_admin` -- The calling user cannot update the specified usergroup. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `team_not_found` -- The workspace provided was not found. - `user_channel_limit_exceeded` -- Adding these channels would cause one or more members to exceed their channel limit. - `usergroup_not_found` -- The IDP group provided was not found. - `usergroup_not_linked_to_team` -- The IDP group provided is not linked to the workspace. - `usergroup_team_not_provisioned` -- The IDP group provided is linked to a workspace that has auto-provision disabled. See https://docs.slack.dev/reference/methods/admin.usergroups.addChannels */ export const addChannels: API.OperationMethod< AddChannelsRequest, AddChannelsResponse, AddChannelsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(480, __c60, 0) as any as S.Schema, - output: __S(488, __c61, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(48, __c6, 0) as any as S.Schema, + output: __S(56, __c7, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + FeatureNotEnabled, + InvalidChannelsLimit, + NotAnAdmin, + NotAnEnterprise, + TeamNotFound, + UserChannelLimitExceeded, + UsergroupNotFound, + UsergroupNotLinkedToTeam, + UsergroupTeamNotProvisioned, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddChannels", })); -export type AddEmojiError = SlackOpError; -/** Add an emoji. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `emoji_limit_reached` -- Unable to add emoji due to limit reached. - `error_bad_format` -- Invalid image data was provided. - `error_bad_name_i18n` -- Value passed for `name` was invalid. - `error_bad_upload` -- There was an error uploading the image. - `error_bad_wide` -- The image width or height is too large. - `error_missing_name` -- Value passed for `name` is missing or empty. - `error_name_taken` -- Value passed for `name` already exists. - `error_name_taken_i18n` -- Value passed for `name` already exists. - `error_no_image` -- Empty image data was provided. - `error_too_big` -- The image file size is too large. - `error_lower_case_names_only` -- Capital letters are not allowed in emoji names. - `failed_to_add_emoji` -- Failed to add the specified emoji. - `failed_to_fetch_active_team` -- There are no active teams on the org and we need at least one. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `no_image_uploaded` -- No image data was provided. - `not_an_admin` -- This method is only accessible by org owners and Admins. - `ratelimited` -- Too many api calls in a time period. - `resized_but_still_too_large` -- The image is still too large after resizing. - `too_many_frames` -- The image has too many frames. See https://docs.slack.dev/reference/methods/admin.emoji.add */ +export type AddEmojiError = + | EmojiLimitReached + | ErrorBadFormat + | ErrorBadNameI18n + | ErrorBadUpload + | ErrorBadWide + | ErrorLowerCaseNamesOnly + | ErrorMissingName + | ErrorNameTaken + | ErrorNameTakenI18n + | ErrorNoImage + | ErrorTooBig + | FailedToAddEmoji + | FailedToFetchActiveTeam + | FeatureNotEnabled + | NoImageUploaded + | NotAnAdmin + | ResizedButStillTooLarge + | TooManyFrames + | SlackOpError; +/** Add an emoji. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `emoji_limit_reached` -- Unable to add emoji due to limit reached. - `error_bad_format` -- Invalid image data was provided. - `error_bad_name_i18n` -- Value passed for `name` was invalid. - `error_bad_upload` -- There was an error uploading the image. - `error_bad_wide` -- The image width or height is too large. - `error_missing_name` -- Value passed for `name` is missing or empty. - `error_name_taken` -- Value passed for `name` already exists. - `error_name_taken_i18n` -- Value passed for `name` already exists. - `error_no_image` -- Empty image data was provided. - `error_too_big` -- The image file size is too large. - `error_lower_case_names_only` -- Capital letters are not allowed in emoji names. - `failed_to_add_emoji` -- Failed to add the specified emoji. - `failed_to_fetch_active_team` -- There are no active teams on the org and we need at least one. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `no_image_uploaded` -- No image data was provided. - `not_an_admin` -- This method is only accessible by org owners and Admins. - `ratelimited` -- Too many api calls in a time period. - `resized_but_still_too_large` -- The image is still too large after resizing. - `too_many_frames` -- The image has too many frames. See https://docs.slack.dev/reference/methods/admin.emoji.add */ export const addEmoji: API.OperationMethod< AddEmojiRequest, AddEmojiResponse, AddEmojiError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(576, __c72, 0) as any as S.Schema, + input: __S(64, __c8, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + EmojiLimitReached, + ErrorBadFormat, + ErrorBadNameI18n, + ErrorBadUpload, + ErrorBadWide, + ErrorLowerCaseNamesOnly, + ErrorMissingName, + ErrorNameTaken, + ErrorNameTakenI18n, + ErrorNoImage, + ErrorTooBig, + FailedToAddEmoji, + FailedToFetchActiveTeam, + FeatureNotEnabled, + NoImageUploaded, + NotAnAdmin, + ResizedButStillTooLarge, + TooManyFrames, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddEmoji", })); -export type AddGroupError = SlackOpError; -/** Add an allowlist of IDP groups for accessing a channel Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_add_more_channels_to_group` -- The maximum number of channels have already been linked to the group. - `cannot_add_more_groups_to_channel` -- The maximum number of groups have already been linked to the channel. - `channel_is_not_private` -- The channel is a public channel, a multi-party direct message, a direct message, or is externally-shared. - `channel_not_found` -- `channel_id` can't be found. - `default_channel_restricted` -- The channel is a default channel on the workspace. - `feature_not_enabled` -- Feature not enabled - `group_already_linked_to_channel` -- The IDP group is already linked to the channel - `group_must_not_be_empty` -- The IDP group is currently empty. - `group_not_found` -- `group_id` can't be found. - `invalid_auth` -- Token does not belong to enterprise or team id passed in not part of this enterprise - `invalid_channel` -- The channel can't be linked to an IDP group (i.e., it's a public channel or external shared channel). - `invalid_channel_type` -- The channel is a public channel, a multi-party direct message, a direct message, or is externally-shared. - `no_channel_memberships` -- The channel has no members. - `not_an_admin` -- This token does not belong to an Org Admin or Owner. - `team_not_found` -- `team_id` can't be found. - `unable_to_link_idp_group_and_channel` -- The IDP group and the channel cannot be linked. See https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.addGroup */ +export type AddGroupError = + | CannotAddMoreChannelsToGroup + | CannotAddMoreGroupsToChannel + | ChannelIsNotPrivate + | ChannelNotFound + | DefaultChannelRestricted + | FeatureNotEnabled + | GroupAlreadyLinkedToChannel + | GroupMustNotBeEmpty + | GroupNotFound + | InvalidChannel + | InvalidChannelType + | NoChannelMemberships + | NotAnAdmin + | TeamNotFound + | UnableToLinkIdpGroupAndChannel + | SlackOpError; +/** Add an allowlist of IDP groups for accessing a channel Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_add_more_channels_to_group` -- The maximum number of channels have already been linked to the group. - `cannot_add_more_groups_to_channel` -- The maximum number of groups have already been linked to the channel. - `channel_is_not_private` -- The channel is a public channel, a multi-party direct message, a direct message, or is externally-shared. - `channel_not_found` -- `channel_id` can't be found. - `default_channel_restricted` -- The channel is a default channel on the workspace. - `feature_not_enabled` -- Feature not enabled - `group_already_linked_to_channel` -- The IDP group is already linked to the channel - `group_must_not_be_empty` -- The IDP group is currently empty. - `group_not_found` -- `group_id` can't be found. - `invalid_auth` -- Token does not belong to enterprise or team id passed in not part of this enterprise - `invalid_channel` -- The channel can't be linked to an IDP group (i.e., it's a public channel or external shared channel). - `invalid_channel_type` -- The channel is a public channel, a multi-party direct message, a direct message, or is externally-shared. - `no_channel_memberships` -- The channel has no members. - `not_an_admin` -- This token does not belong to an Org Admin or Owner. - `team_not_found` -- `team_id` can't be found. - `unable_to_link_idp_group_and_channel` -- The IDP group and the channel cannot be linked. See https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.addGroup */ export const addGroup: API.OperationMethod< AddGroupRequest, AddGroupResponse, AddGroupError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(672, __c84, 0) as any as S.Schema, + input: __S(72, __c9, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotAddMoreChannelsToGroup, + CannotAddMoreGroupsToChannel, + ChannelIsNotPrivate, + ChannelNotFound, + DefaultChannelRestricted, + FeatureNotEnabled, + GroupAlreadyLinkedToChannel, + GroupMustNotBeEmpty, + GroupNotFound, + InvalidChannel, + InvalidChannelType, + NoChannelMemberships, + NotAnAdmin, + TeamNotFound, + UnableToLinkIdpGroupAndChannel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddGroup", })); -export type AddTeamsError = SlackOpError; -/** Associate one or more default workspaces with an organization-wide IDP group. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `auto_provision_failure` -- A failure occurred while assigning IDP group members to a specific workspace; see `errors` element for a list of failed team IDs. - `internal_error` -- An unexpected error occurred. - `invalid_team_ids` -- One or more team IDs provided were invalid; see the `errors` field in the response for the list of invalid team IDs. - `multi_workspace_restriction` -- The IDP group has members that cannot be linked to more than one workspace. - `no_team_ids_given` -- The `team_ids` parameter was empty. - `restricted_action` -- The calling user cannot update the specified usergroup. - `team_limit_exceeded` -- The number of teams associated with the org group would exceed the limit. - `usergroup_not_found` -- `usergroup_id` wasn't found. - `auto_provision_required` -- The IDP group requires a mandatory workspace link, so `auto_provision` must be `true`. - `workspace_not_eligible` -- The workspace is not eligible to be linked to this IDP group; it is not on the org's allow-list of eligible workspaces. See https://docs.slack.dev/reference/methods/admin.usergroups.addTeams */ +export type AddTeamsError = + | AutoProvisionFailure + | AutoProvisionRequired + | InvalidTeamIds + | MultiWorkspaceRestriction + | NoTeamIdsGiven + | RestrictedAction + | TeamLimitExceeded + | UsergroupNotFound + | WorkspaceNotEligible + | SlackOpError; +/** Associate one or more default workspaces with an organization-wide IDP group. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `auto_provision_failure` -- A failure occurred while assigning IDP group members to a specific workspace; see `errors` element for a list of failed team IDs. - `internal_error` -- An unexpected error occurred. - `invalid_team_ids` -- One or more team IDs provided were invalid; see the `errors` field in the response for the list of invalid team IDs. - `multi_workspace_restriction` -- The IDP group has members that cannot be linked to more than one workspace. - `no_team_ids_given` -- The `team_ids` parameter was empty. - `restricted_action` -- The calling user cannot update the specified usergroup. - `team_limit_exceeded` -- The number of teams associated with the org group would exceed the limit. - `usergroup_not_found` -- `usergroup_id` wasn't found. - `auto_provision_required` -- The IDP group requires a mandatory workspace link, so `auto_provision` must be `true`. - `workspace_not_eligible` -- The workspace is not eligible to be linked to this IDP group; it is not on the org's allow-list of eligible workspaces. See https://docs.slack.dev/reference/methods/admin.usergroups.addTeams */ export const addTeams: API.OperationMethod< AddTeamsRequest, AddTeamsResponse, AddTeamsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(768, __c96, 0) as any as S.Schema, + input: __S(80, __c10, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AutoProvisionFailure, + AutoProvisionRequired, + InvalidTeamIds, + MultiWorkspaceRestriction, + NoTeamIdsGiven, + RestrictedAction, + TeamLimitExceeded, + UsergroupNotFound, + WorkspaceNotEligible, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddTeams", })); -export type AddUsersError = SlackOpError; -/** Add members to an existing organizational usergroup. This method is only available to Enterprise Grid organizations. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user cannot modify the specified usergroup, or the usergroup's membership is managed by an identity provider (IdP) and can only be changed through SCIM. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `invalid_usergroup` -- A usergroup with the specified ID does not exist. - `invalid_users` -- One or more users provided can not be added to the usergroup. - `user_not_found` -- One or more users provided are invalid or are not a member of the organization. - `member_count_would_exceed_visible_limit` -- The usergroup is visible and the member count would exceed the limit. - `cannot_modify_role_admin` -- The user does not have permission to modify the roles admin role. See https://docs.slack.dev/reference/methods/admin.usergroups.addUsers */ +export type AddUsersError = + | CannotModifyRoleAdmin + | FeatureNotEnabled + | InvalidUsergroup + | InvalidUsers + | MemberCountWouldExceedVisibleLimit + | NotAnEnterprise + | RestrictedAction + | UserNotFound + | SlackOpError; +/** Add members to an existing organizational usergroup. This method is only available to Enterprise Grid organizations. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user cannot modify the specified usergroup, or the usergroup's membership is managed by an identity provider (IdP) and can only be changed through SCIM. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `invalid_usergroup` -- A usergroup with the specified ID does not exist. - `invalid_users` -- One or more users provided can not be added to the usergroup. - `user_not_found` -- One or more users provided are invalid or are not a member of the organization. - `member_count_would_exceed_visible_limit` -- The usergroup is visible and the member count would exceed the limit. - `cannot_modify_role_admin` -- The user does not have permission to modify the roles admin role. See https://docs.slack.dev/reference/methods/admin.usergroups.addUsers */ export const addUsers: API.OperationMethod< AddUsersRequest, AddUsersResponse, AddUsersError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(864, __c108, 0) as any as S.Schema, - output: __S(865, __c108, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(88, __c11, 0) as any as S.Schema, + output: __S(89, __c11, 1) as any as S.Schema, + errors: [ + CannotModifyRoleAdmin, + FeatureNotEnabled, + InvalidUsergroup, + InvalidUsers, + MemberCountWouldExceedVisibleLimit, + NotAnEnterprise, + RestrictedAction, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddUsers", })); -export type AddWorkflowsCollaboratorError = SlackOpError; -/** Add collaborators to workflows within the team or enterprise Required scopes -- user: `admin.workflows:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_allowed` -- The user is not allowed to access this API method - `error_adding_collaborators` -- There were one or more errors adding workflow collaborators See https://docs.slack.dev/reference/methods/admin.workflows.collaborators.add */ +export type AddWorkflowsCollaboratorError = ErrorAddingCollaborators | NotAllowed | SlackOpError; +/** Add collaborators to workflows within the team or enterprise Required scopes -- user: `admin.workflows:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `not_allowed` -- The user is not allowed to access this API method - `error_adding_collaborators` -- There were one or more errors adding workflow collaborators See https://docs.slack.dev/reference/methods/admin.workflows.collaborators.add */ export const addWorkflowsCollaborator: API.OperationMethod< AddWorkflowsCollaboratorRequest, AddWorkflowsCollaboratorResponse, AddWorkflowsCollaboratorError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(960, __c120, 0) as any as S.Schema, + input: __S(104, __c13, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ErrorAddingCollaborators, NotAllowed, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddWorkflowsCollaborator", })); -export type AnalyticsMessagesActivityError = SlackOpError; -/** Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts Required scopes -- user: `admin.analytics:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel was not found. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `restricted_action` -- The token does not have permission to access this resource, or the channel is not public and the organization has disabled private channel analytics. - `not_an_enterprise` -- The user token does not belong to an enterprise. - `restricted_plan_level` -- The enterprise plan level does not have access to this feature. - `rate_limited` -- Too many requests in a short amount of time. See https://docs.slack.dev/reference/methods/admin.analytics.messages.activity */ +export type AnalyticsMessagesActivityError = + | ChannelNotFound + | InvalidArguments + | NotAnEnterprise + | RestrictedAction + | RestrictedPlanLevel + | SlackOpError; +/** Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts Required scopes -- user: `admin.analytics:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The specified channel was not found. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `restricted_action` -- The token does not have permission to access this resource, or the channel is not public and the organization has disabled private channel analytics. - `not_an_enterprise` -- The user token does not belong to an enterprise. - `restricted_plan_level` -- The enterprise plan level does not have access to this feature. - `rate_limited` -- Too many requests in a short amount of time. See https://docs.slack.dev/reference/methods/admin.analytics.messages.activity */ export const analyticsMessagesActivity: API.OperationMethod< AnalyticsMessagesActivityRequest, AnalyticsMessagesActivityResponse, AnalyticsMessagesActivityError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1056, __c132, 0) as any as S.Schema, - output: __S(1057, __c132, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(112, __c14, 0) as any as S.Schema, + output: __S(113, __c14, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + InvalidArguments, + NotAnEnterprise, + RestrictedAction, + RestrictedPlanLevel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AnalyticsMessagesActivity", })); -export type AnalyticsMessagesMetadataError = SlackOpError; -/** Retrieves metadata for a list of messages from a given channel. Required scopes -- user: `admin.analytics:read` Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel was not found - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `not_an_enterprise` -- The user token does not belong to an enterprise. - `analytics_unavailable` -- We were unable to find analytics for you. - `admin_analytics_disabled` -- We're having issues returning your analytics. Please wait and try again. - `restricted_plan_level` -- This feature is not available for your current product plan. - `different_team_owns_message_metadata_for_channel` -- Message metadata must be accessed by an actor from the same team that owns the channel. This may be the org or a specific enterprise workspace. - `rate_limited` -- Too many requests in a short amount of time. - `restricted_action` -- The token does not have permission to access this resource, or the channel is not public and the organization has disabled private channel analytics. See https://docs.slack.dev/reference/methods/admin.analytics.messages.metadata */ +export type AnalyticsMessagesMetadataError = + | AdminAnalyticsDisabled + | AnalyticsUnavailable + | ChannelNotFound + | DifferentTeamOwnsMessageMetadataForChannel + | InvalidArguments + | NotAnEnterprise + | RestrictedAction + | RestrictedPlanLevel + | SlackOpError; +/** Retrieves metadata for a list of messages from a given channel. Required scopes -- user: `admin.analytics:read` Rate limit tier: 5 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The specified channel was not found - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `not_an_enterprise` -- The user token does not belong to an enterprise. - `analytics_unavailable` -- We were unable to find analytics for you. - `admin_analytics_disabled` -- We're having issues returning your analytics. Please wait and try again. - `restricted_plan_level` -- This feature is not available for your current product plan. - `different_team_owns_message_metadata_for_channel` -- Message metadata must be accessed by an actor from the same team that owns the channel. This may be the org or a specific enterprise workspace. - `rate_limited` -- Too many requests in a short amount of time. - `restricted_action` -- The token does not have permission to access this resource, or the channel is not public and the organization has disabled private channel analytics. See https://docs.slack.dev/reference/methods/admin.analytics.messages.metadata */ export const analyticsMessagesMetadata: API.PaginatedOperationMethod< AnalyticsMessagesMetadataRequest, AnalyticsMessagesMetadataResponse, @@ -2724,9 +7514,20 @@ export const analyticsMessagesMetadata: API.PaginatedOperationMethod< AnalyticsMessagesMetadataResponseMessagesItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(32, __c4, 0) as any as S.Schema, - output: __S(39, __c4, 7) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(128, __c16, 0) as any as S.Schema, + output: __S(135, __c16, 7) as any as S.Schema, + errors: [ + AdminAnalyticsDisabled, + AnalyticsUnavailable, + ChannelNotFound, + DifferentTeamOwnsMessageMetadataForChannel, + InvalidArguments, + NotAnEnterprise, + RestrictedAction, + RestrictedPlanLevel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -2741,518 +7542,1116 @@ export const analyticsMessagesMetadata: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ApproveAppError = SlackOpError; -/** Approve an app for installation on a workspace. Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `app_not_eligible_for_auto_install` -- The app does not have the required scope to be eligible for auto-install rule creation. - `app_restricted_org_wide` -- The app is already restricted org wide. - `auto_install_rule_creation_failed` -- The app was approved successfully, but the auto-install AAA rule could not be created. Please create the rule manually. - `custom_integration_not_allowed_at_enterprise` -- Returned when the install request is for custom integration app. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team. - `invalid_request_id` -- The `request_id` passed is invalid. - `invalid_app_id` -- The `app_id` passed is invalid. - `org_resolution_required` -- The `team_id` is in an Enterprise org while `app_id` is certified. - `invalid_scopes` -- Some of the provided scopes do not exist. - `not_allowed_to_create_automation_rule` -- The actor does not have permission to create AAA automation rules. The app was approved but the auto-install rule was not created. - `not_an_admin` -- This method is only accessible by org owners and admins. - `request_already_resolved` -- The app request has already been resolved. - `request_id_or_app_id_is_required` -- Must include a `request_id` or `app_id`. - `request_id_required_for_custom_integrations` -- A `request_id` is required for custom integrations. - `team_not_found` -- Returned when team id is not found. - `too_many_ids_provided` -- Please provide only `app_id` OR `request_id`. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id`. - `invalid_approved_acl` -- The `approved_acl` passed is invalid, or can't be applied to this request. The app was not approved. See https://docs.slack.dev/reference/methods/admin.apps.approve */ +export type ApproveAppError = + | AppManagementAppNotInstalledOnOrg + | AppNotEligibleForAutoInstall + | AppRestrictedOrgWide + | AutoInstallRuleCreationFailed + | CustomIntegrationNotAllowedAtEnterprise + | FeatureNotEnabled + | InvalidAppId + | InvalidApprovedAcl + | InvalidRequestId + | InvalidScopes + | NotAllowedToCreateAutomationRule + | NotAnAdmin + | OrgResolutionRequired + | RequestAlreadyResolved + | RequestIdOrAppIdIsRequired + | RequestIdRequiredForCustomIntegrations + | TeamNotFound + | TooManyIdsProvided + | TooManyTeamsProvided + | SlackOpError; +/** Approve an app for installation on a workspace. Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `app_not_eligible_for_auto_install` -- The app does not have the required scope to be eligible for auto-install rule creation. - `app_restricted_org_wide` -- The app is already restricted org wide. - `auto_install_rule_creation_failed` -- The app was approved successfully, but the auto-install AAA rule could not be created. Please create the rule manually. - `custom_integration_not_allowed_at_enterprise` -- Returned when the install request is for custom integration app. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team. - `invalid_request_id` -- The `request_id` passed is invalid. - `invalid_app_id` -- The `app_id` passed is invalid. - `org_resolution_required` -- The `team_id` is in an Enterprise org while `app_id` is certified. - `invalid_scopes` -- Some of the provided scopes do not exist. - `not_allowed_to_create_automation_rule` -- The actor does not have permission to create AAA automation rules. The app was approved but the auto-install rule was not created. - `not_an_admin` -- This method is only accessible by org owners and admins. - `request_already_resolved` -- The app request has already been resolved. - `request_id_or_app_id_is_required` -- Must include a `request_id` or `app_id`. - `request_id_required_for_custom_integrations` -- A `request_id` is required for custom integrations. - `team_not_found` -- Returned when team id is not found. - `too_many_ids_provided` -- Please provide only `app_id` OR `request_id`. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id`. - `invalid_approved_acl` -- The `approved_acl` passed is invalid, or can't be applied to this request. The app was not approved. See https://docs.slack.dev/reference/methods/admin.apps.approve */ export const approveApp: API.OperationMethod< ApproveAppRequest, ApproveAppResponse, ApproveAppError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(120, __c15, 0) as any as S.Schema, + input: __S(136, __c17, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AppManagementAppNotInstalledOnOrg, + AppNotEligibleForAutoInstall, + AppRestrictedOrgWide, + AutoInstallRuleCreationFailed, + CustomIntegrationNotAllowedAtEnterprise, + FeatureNotEnabled, + InvalidAppId, + InvalidApprovedAcl, + InvalidRequestId, + InvalidScopes, + NotAllowedToCreateAutomationRule, + NotAnAdmin, + OrgResolutionRequired, + RequestAlreadyResolved, + RequestIdOrAppIdIsRequired, + RequestIdRequiredForCustomIntegrations, + TeamNotFound, + TooManyIdsProvided, + TooManyTeamsProvided, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ApproveApp", })); -export type ApproveInviteRequestError = SlackOpError; -/** Approve a workspace invite request. Required scopes -- user: `admin.invites:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `already_processed` -- The `invite_request_id` passed has already been approved or denied. - `failed_to_send_invite` -- The actual invite (separate from approval) failed to process. This may happen because the user is disabled, already in the team, etc. - `feature_not_enabled` -- The Invite Request Admin APIs are not enabled for this team. - `invalid_request` -- The `invite_request_id` passed is invalid. - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- This token doesn't have admin privileges. - `team_not_found` -- The `team_id` specified wasn't found. See https://docs.slack.dev/reference/methods/admin.inviteRequests.approve */ +export type ApproveInviteRequestError = + | AlreadyProcessed + | FailedToSendInvite + | FeatureNotEnabled + | InvalidRequest + | MissingScope + | NotAnAdmin + | TeamNotFound + | SlackOpError; +/** Approve a workspace invite request. Required scopes -- user: `admin.invites:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `already_processed` -- The `invite_request_id` passed has already been approved or denied. - `failed_to_send_invite` -- The actual invite (separate from approval) failed to process. This may happen because the user is disabled, already in the team, etc. - `feature_not_enabled` -- The Invite Request Admin APIs are not enabled for this team. - `invalid_request` -- The `invite_request_id` passed is invalid. - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- This token doesn't have admin privileges. - `team_not_found` -- The `team_id` specified wasn't found. See https://docs.slack.dev/reference/methods/admin.inviteRequests.approve */ export const approveInviteRequest: API.OperationMethod< ApproveInviteRequestRequest, ApproveInviteRequestResponse, ApproveInviteRequestError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(208, __c26, 0) as any as S.Schema, + input: __S(144, __c18, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AlreadyProcessed, + FailedToSendInvite, + FeatureNotEnabled, + InvalidRequest, + MissingScope, + NotAnAdmin, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ApproveInviteRequest", })); -export type AppsRestrictError = SlackOpError; -/** Restrict an app for installation on a workspace. Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `custom_integration_not_allowed_at_enterprise` -- Returned when the install request is for custom integration app. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_request_id` -- The `request_id` passed is invalid. - `invalid_app_id` -- The `app_id` passed is invalid. - `invalid_scopes` -- Some of the provided scopes do not exist - `not_an_admin` -- This method is only accessible by org owners and admins - `request_already_resolved` -- The app request has already been resolved - `request_id_or_app_id_is_required` -- Must include a `request_id` or `app_id` - `request_id_required_for_custom_integrations` -- A `request_id` is required for custom integrations - `team_not_found` -- Returned when team id is not found. - `too_many_ids_provided` -- Please provide only `app_id` OR `request_id` - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id` See https://docs.slack.dev/reference/methods/admin.apps.restrict */ +export type AppsRestrictError = + | AppManagementAppNotInstalledOnOrg + | CustomIntegrationNotAllowedAtEnterprise + | FeatureNotEnabled + | InvalidAppId + | InvalidRequestId + | InvalidScopes + | NotAnAdmin + | RequestAlreadyResolved + | RequestIdOrAppIdIsRequired + | RequestIdRequiredForCustomIntegrations + | TeamNotFound + | TooManyIdsProvided + | TooManyTeamsProvided + | SlackOpError; +/** Restrict an app for installation on a workspace. Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `custom_integration_not_allowed_at_enterprise` -- Returned when the install request is for custom integration app. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_request_id` -- The `request_id` passed is invalid. - `invalid_app_id` -- The `app_id` passed is invalid. - `invalid_scopes` -- Some of the provided scopes do not exist - `not_an_admin` -- This method is only accessible by org owners and admins - `request_already_resolved` -- The app request has already been resolved - `request_id_or_app_id_is_required` -- Must include a `request_id` or `app_id` - `request_id_required_for_custom_integrations` -- A `request_id` is required for custom integrations - `team_not_found` -- Returned when team id is not found. - `too_many_ids_provided` -- Please provide only `app_id` OR `request_id` - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id` See https://docs.slack.dev/reference/methods/admin.apps.restrict */ export const appsRestrict: API.OperationMethod< AppsRestrictRequest, AppsRestrictResponse, AppsRestrictError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(288, __c36, 0) as any as S.Schema, + input: __S(152, __c19, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AppManagementAppNotInstalledOnOrg, + CustomIntegrationNotAllowedAtEnterprise, + FeatureNotEnabled, + InvalidAppId, + InvalidRequestId, + InvalidScopes, + NotAnAdmin, + RequestAlreadyResolved, + RequestIdOrAppIdIsRequired, + RequestIdRequiredForCustomIntegrations, + TeamNotFound, + TooManyIdsProvided, + TooManyTeamsProvided, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AppsRestrict", })); -export type ArchiveConversationError = SlackOpError; -/** Archive a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `already_archived` -- This channel has already been archived. - `cant_archive_general` -- You cannot archive the 'general' channel. - `channel_not_found` -- The value passed for `channel` was invalid, or the channel belongs to a workspace other than the token's workspace and isn't shared with it. - `channel_type_not_supported` -- The value passed for `channel` was an MPDM, DM, or the 'general' channel. - `could_not_archive_channel` -- The provided channel could not be archived. - `default_org_wide_channel` -- The default org-wide channel cannot be archived. - `feature_not_enabled` -- The token provided does not have access to this method. - `restricted_action` -- A workspace preference prevents the authenticated user from archiving this channel. - `target_team_not_on_org` -- The specified target_team is not part of the organization. See https://docs.slack.dev/reference/methods/admin.conversations.archive */ +export type ArchiveConversationError = + | AlreadyArchived + | CantArchiveGeneral + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotArchiveChannel + | DefaultOrgWideChannel + | FeatureNotEnabled + | RestrictedAction + | TargetTeamNotOnOrg + | SlackOpError; +/** Archive a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `already_archived` -- This channel has already been archived. - `cant_archive_general` -- You cannot archive the 'general' channel. - `channel_not_found` -- The value passed for `channel` was invalid, or the channel belongs to a workspace other than the token's workspace and isn't shared with it. - `channel_type_not_supported` -- The value passed for `channel` was an MPDM, DM, or the 'general' channel. - `could_not_archive_channel` -- The provided channel could not be archived. - `default_org_wide_channel` -- The default org-wide channel cannot be archived. - `feature_not_enabled` -- The token provided does not have access to this method. - `restricted_action` -- A workspace preference prevents the authenticated user from archiving this channel. - `target_team_not_on_org` -- The specified target_team is not part of the organization. See https://docs.slack.dev/reference/methods/admin.conversations.archive */ export const archiveConversation: API.OperationMethod< ArchiveConversationRequest, ArchiveConversationResponse, ArchiveConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(296, __c37, 0) as any as S.Schema, + input: __S(160, __c20, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AlreadyArchived, + CantArchiveGeneral, + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotArchiveChannel, + DefaultOrgWideChannel, + FeatureNotEnabled, + RestrictedAction, + TargetTeamNotOnOrg, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ArchiveConversation", })); -export type AssignEntitiesError = SlackOpError; -/** Assign entities to a particular authentication policy. Required scopes -- user: `admin.users:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `admin_unauthorized` -- The token provided doesn't have permission to revoke a session. - `entity_not_found` -- At least one `entity_id` was not found. - `feature_not_enabled` -- This method is only available for Enterprise organizations. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The token doesn't have access to this endpoint. - `not_an_admin` -- This method is only accessible by Org Owners and Admins. - `over_max_entity_limit` -- The number of entities assigned to this policy has reached its upper limit. - `policy_not_found` -- The policy name doesn't match any of the existing org policies. - `ratelimited` -- The rate limit for this endpoint has been reached. - `unknown_method` -- This method is currently not available. See https://docs.slack.dev/reference/methods/admin.auth.policy.assignEntities */ +export type AssignEntitiesError = + | AdminUnauthorized + | EntityNotFound + | FeatureNotEnabled + | InvalidArguments + | NotAnAdmin + | OverMaxEntityLimit + | PolicyNotFound + | UnknownMethod + | SlackOpError; +/** Assign entities to a particular authentication policy. Required scopes -- user: `admin.users:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `admin_unauthorized` -- The token provided doesn't have permission to revoke a session. - `entity_not_found` -- At least one `entity_id` was not found. - `feature_not_enabled` -- This method is only available for Enterprise organizations. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The token doesn't have access to this endpoint. - `not_an_admin` -- This method is only accessible by Org Owners and Admins. - `over_max_entity_limit` -- The number of entities assigned to this policy has reached its upper limit. - `policy_not_found` -- The policy name doesn't match any of the existing org policies. - `ratelimited` -- The rate limit for this endpoint has been reached. - `unknown_method` -- This method is currently not available. See https://docs.slack.dev/reference/methods/admin.auth.policy.assignEntities */ export const assignEntities: API.OperationMethod< AssignEntitiesRequest, AssignEntitiesResponse, AssignEntitiesError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(304, __c38, 0) as any as S.Schema, - output: __S(312, __c39, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(168, __c21, 0) as any as S.Schema, + output: __S(176, __c22, 0) as any as S.Schema, + errors: [ + AdminUnauthorized, + EntityNotFound, + FeatureNotEnabled, + InvalidArguments, + NotAnAdmin, + OverMaxEntityLimit, + PolicyNotFound, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AssignEntities", })); -export type AssignUserError = SlackOpError; -/** Add an Enterprise user to a workspace. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team - `invalid_role_for_user` -- The requested status is incompatible with the user's role on another workspace. - `invited_user_not_created` -- The invited user could not be created. - `invited_user_not_reactivated` -- The invited user could not be reactivated. - `invitor_cannot_see_channel` -- The invitor is not part of one or many channels that the user was requested to be added to - `not_an_admin` -- This method wasn't called by an admin. - `team_not_found` -- `team_id was not found. - `too_many_channels` -- The user was requested to be added to more channels than is allowed. - `user_already_team_member` -- The given user is already active on the given team. - `user_is_bot` -- The given user is a bot from an app. This api only works with humans. - `user_not_found` -- `user_id` was not found. - `user_cannot_be_added_to_workspace` -- The user can't be added to this workspace because of their account type or the workspace's configuration. - `inviter_email_not_verified` -- The user is still invited, and the user whose token is calling this method has not verified the email address on their own account. They must verify it before adding an invited user to a workspace. See https://docs.slack.dev/reference/methods/admin.users.assign */ +export type AssignUserError = + | FeatureNotEnabled + | InvalidRoleForUser + | InvitedUserNotCreated + | InvitedUserNotReactivated + | InviterEmailNotVerified + | InvitorCannotSeeChannel + | NotAnAdmin + | TeamNotFound + | TooManyChannels + | UserAlreadyTeamMember + | UserCannotBeAddedToWorkspace + | UserIsBot + | UserNotFound + | SlackOpError; +/** Add an Enterprise user to a workspace. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team - `invalid_role_for_user` -- The requested status is incompatible with the user's role on another workspace. - `invited_user_not_created` -- The invited user could not be created. - `invited_user_not_reactivated` -- The invited user could not be reactivated. - `invitor_cannot_see_channel` -- The invitor is not part of one or many channels that the user was requested to be added to - `not_an_admin` -- This method wasn't called by an admin. - `team_not_found` -- `team_id was not found. - `too_many_channels` -- The user was requested to be added to more channels than is allowed. - `user_already_team_member` -- The given user is already active on the given team. - `user_is_bot` -- The given user is a bot from an app. This api only works with humans. - `user_not_found` -- `user_id` was not found. - `user_cannot_be_added_to_workspace` -- The user can't be added to this workspace because of their account type or the workspace's configuration. - `inviter_email_not_verified` -- The user is still invited, and the user whose token is calling this method has not verified the email address on their own account. They must verify it before adding an invited user to a workspace. See https://docs.slack.dev/reference/methods/admin.users.assign */ export const assignUser: API.OperationMethod< AssignUserRequest, AssignUserResponse, AssignUserError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(320, __c40, 0) as any as S.Schema, + input: __S(184, __c23, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + FeatureNotEnabled, + InvalidRoleForUser, + InvitedUserNotCreated, + InvitedUserNotReactivated, + InviterEmailNotVerified, + InvitorCannotSeeChannel, + NotAnAdmin, + TeamNotFound, + TooManyChannels, + UserAlreadyTeamMember, + UserCannotBeAddedToWorkspace, + UserIsBot, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AssignUser", })); -export type BulkArchiveError = SlackOpError; -/** Archive public or private channels in bulk. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `action_already_in_progress` -- Another bulk action request is currently in progress - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `invalid_enterprise` -- Enterprise does not exist - `no_valid_channels` -- All input channels are invalid - `team_not_found` -- Team ID provided does not exist - `restricted_action` -- User does not have permission to perform this action See https://docs.slack.dev/reference/methods/admin.conversations.bulkArchive */ +export type BulkArchiveError = + | ActionAlreadyInProgress + | InvalidEnterprise + | NoValidChannels + | RestrictedAction + | TeamNotFound + | SlackOpError; +/** Archive public or private channels in bulk. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `action_already_in_progress` -- Another bulk action request is currently in progress - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `invalid_enterprise` -- Enterprise does not exist - `no_valid_channels` -- All input channels are invalid - `team_not_found` -- Team ID provided does not exist - `restricted_action` -- User does not have permission to perform this action See https://docs.slack.dev/reference/methods/admin.conversations.bulkArchive */ export const bulkArchive: API.OperationMethod< BulkArchiveRequest, BulkArchiveResponse, BulkArchiveError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(328, __c41, 0) as any as S.Schema, - output: __S(336, __c42, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(192, __c24, 0) as any as S.Schema, + output: __S(200, __c25, 0) as any as S.Schema, + errors: [ + ActionAlreadyInProgress, + InvalidEnterprise, + NoValidChannels, + RestrictedAction, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BulkArchive", })); -export type BulkDeleteError = SlackOpError; -/** Delete public or private channels in bulk Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `action_already_in_progress` -- Another bulk action request is currently in progress - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `no_valid_channels` -- All input channels are invalid - `restricted_action` -- User does not have permission to perform this action See https://docs.slack.dev/reference/methods/admin.conversations.bulkDelete */ +export type BulkDeleteError = + | ActionAlreadyInProgress + | NoValidChannels + | RestrictedAction + | SlackOpError; +/** Delete public or private channels in bulk Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `action_already_in_progress` -- Another bulk action request is currently in progress - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `no_valid_channels` -- All input channels are invalid - `restricted_action` -- User does not have permission to perform this action See https://docs.slack.dev/reference/methods/admin.conversations.bulkDelete */ export const bulkDelete: API.OperationMethod< BulkDeleteRequest, BulkDeleteResponse, BulkDeleteError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(352, __c44, 0) as any as S.Schema, - output: __S(336, __c42, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(216, __c27, 0) as any as S.Schema, + output: __S(200, __c25, 0) as any as S.Schema, + errors: [ + ActionAlreadyInProgress, + NoValidChannels, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BulkDelete", })); -export type BulkMoveError = SlackOpError; -/** Move public or private channels in bulk. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `action_already_in_progress` -- Another bulk action request is currently in progress - `team_not_found` -- Target team cannot be found - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `no_valid_channels` -- All input channels are invalid - `target_team_not_found` -- Target team ID provided does not exist - `restricted_action` -- User does not have permission to perform this action See https://docs.slack.dev/reference/methods/admin.conversations.bulkMove */ +export type BulkMoveError = + | ActionAlreadyInProgress + | NoValidChannels + | RestrictedAction + | TargetTeamNotFound + | TeamNotFound + | SlackOpError; +/** Move public or private channels in bulk. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `action_already_in_progress` -- Another bulk action request is currently in progress - `team_not_found` -- Target team cannot be found - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `no_valid_channels` -- All input channels are invalid - `target_team_not_found` -- Target team ID provided does not exist - `restricted_action` -- User does not have permission to perform this action See https://docs.slack.dev/reference/methods/admin.conversations.bulkMove */ export const bulkMove: API.OperationMethod< BulkMoveRequest, BulkMoveResponse, BulkMoveError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(360, __c45, 0) as any as S.Schema, - output: __S(336, __c42, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(224, __c28, 0) as any as S.Schema, + output: __S(200, __c25, 0) as any as S.Schema, + errors: [ + ActionAlreadyInProgress, + NoValidChannels, + RestrictedAction, + TargetTeamNotFound, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BulkMove", })); -export type BulkSetExcludeFromSlackAiError = SlackOpError; -/** Exclude channels from Slack AI in bulk. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `action_already_in_progress` -- Another bulk action request is currently in progress - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `no_valid_channels` -- All input channels are invalid - `restricted_action` -- User does not have permission to perform this action - `feature_not_enabled` -- The feature is not enabled - `disallowed_action` -- This property cannot be set on DMs or MPDMs. See https://docs.slack.dev/reference/methods/admin.conversations.bulkSetExcludeFromSlackAi */ +export type BulkSetExcludeFromSlackAiError = + | ActionAlreadyInProgress + | DisallowedAction + | FeatureNotEnabled + | NoValidChannels + | RestrictedAction + | SlackOpError; +/** Exclude channels from Slack AI in bulk. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `action_already_in_progress` -- Another bulk action request is currently in progress - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `no_valid_channels` -- All input channels are invalid - `restricted_action` -- User does not have permission to perform this action - `feature_not_enabled` -- The feature is not enabled - `disallowed_action` -- This property cannot be set on DMs or MPDMs. See https://docs.slack.dev/reference/methods/admin.conversations.bulkSetExcludeFromSlackAi */ export const bulkSetExcludeFromSlackAi: API.OperationMethod< BulkSetExcludeFromSlackAiRequest, BulkSetExcludeFromSlackAiResponse, BulkSetExcludeFromSlackAiError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(384, __c48, 0) as any as S.Schema, - output: __S(336, __c42, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(232, __c29, 0) as any as S.Schema, + output: __S(200, __c25, 0) as any as S.Schema, + errors: [ + ActionAlreadyInProgress, + DisallowedAction, + FeatureNotEnabled, + NoValidChannels, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BulkSetExcludeFromSlackAi", })); -export type BulkSetPropertiesError = SlackOpError; -/** Set properties on channels in bulk. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `action_already_in_progress` -- Another bulk action request is currently in progress - `invalid_arguments` -- The property argument is not a valid JSON object representing a channel property. - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `no_valid_channels` -- All input channels are invalid - `restricted_action` -- User does not have permission to perform this action - `feature_not_enabled` -- The feature is not enabled - `disallowed_action` -- This property cannot be set on this channel type. - `restricted_plan_level` -- This API is only available to Enterprise+ customers. - `too_many_properties` -- Only one channel property can be updated at a time. - `property_not_allowed` -- The property passed in is not allowed to be updated. See https://docs.slack.dev/reference/methods/admin.conversations.bulkSetProperties */ +export type BulkSetPropertiesError = + | ActionAlreadyInProgress + | DisallowedAction + | FeatureNotEnabled + | InvalidArguments + | NoValidChannels + | PropertyNotAllowed + | RestrictedAction + | RestrictedPlanLevel + | TooManyProperties + | SlackOpError; +/** Set properties on channels in bulk. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `action_already_in_progress` -- Another bulk action request is currently in progress - `invalid_arguments` -- The property argument is not a valid JSON object representing a channel property. - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `no_valid_channels` -- All input channels are invalid - `restricted_action` -- User does not have permission to perform this action - `feature_not_enabled` -- The feature is not enabled - `disallowed_action` -- This property cannot be set on this channel type. - `restricted_plan_level` -- This API is only available to Enterprise+ customers. - `too_many_properties` -- Only one channel property can be updated at a time. - `property_not_allowed` -- The property passed in is not allowed to be updated. See https://docs.slack.dev/reference/methods/admin.conversations.bulkSetProperties */ export const bulkSetProperties: API.OperationMethod< BulkSetPropertiesRequest, BulkSetPropertiesResponse, BulkSetPropertiesError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(392, __c49, 0) as any as S.Schema, - output: __S(393, __c49, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(240, __c30, 0) as any as S.Schema, + output: __S(241, __c30, 1) as any as S.Schema, + errors: [ + ActionAlreadyInProgress, + DisallowedAction, + FeatureNotEnabled, + InvalidArguments, + NoValidChannels, + PropertyNotAllowed, + RestrictedAction, + RestrictedPlanLevel, + TooManyProperties, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BulkSetProperties", })); -export type CancelAppsRequestError = SlackOpError; -/** Cancel app request for team Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_request_id` -- The `request_id` passed is invalid. - `not_an_admin` -- This method is only accessible by org owners and admins - `request_already_resolved` -- The app request has already been resolved - `team_not_found` -- Returned when team id is not found. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id` - `restricted_action` -- User is not authorized to perform this action - `invalid_auth` -- invalid token or actor does not have access See https://docs.slack.dev/reference/methods/admin.apps.requests.cancel */ +export type CancelAppsRequestError = + | AppManagementAppNotInstalledOnOrg + | FeatureNotEnabled + | InvalidRequestId + | NotAnAdmin + | RequestAlreadyResolved + | RestrictedAction + | TeamNotFound + | TooManyTeamsProvided + | SlackOpError; +/** Cancel app request for team Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_request_id` -- The `request_id` passed is invalid. - `not_an_admin` -- This method is only accessible by org owners and admins - `request_already_resolved` -- The app request has already been resolved - `team_not_found` -- Returned when team id is not found. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id` - `restricted_action` -- User is not authorized to perform this action - `invalid_auth` -- invalid token or actor does not have access See https://docs.slack.dev/reference/methods/admin.apps.requests.cancel */ export const cancelAppsRequest: API.OperationMethod< CancelAppsRequestRequest, CancelAppsRequestResponse, CancelAppsRequestError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(400, __c50, 0) as any as S.Schema, + input: __S(248, __c31, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AppManagementAppNotInstalledOnOrg, + FeatureNotEnabled, + InvalidRequestId, + NotAnAdmin, + RequestAlreadyResolved, + RestrictedAction, + TeamNotFound, + TooManyTeamsProvided, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CancelAppsRequest", })); -export type ClearResolutionError = SlackOpError; -/** Clear an app resolution Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_app_id` -- The `app_id` passed is invalid. - `no_resolution_found` -- No existing resolutions were found for the given `team` and `app_id`. - `not_an_admin` -- This method is only accessible by org owners and admins - `access_denied` -- This actor does not have access to the permissions on this resource. - `team_not_found` -- Returned when team id is not found. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id` - `restricted_action` -- This actor does not have access to the permissions on this resource. See https://docs.slack.dev/reference/methods/admin.apps.clearResolution */ +export type ClearResolutionError = + | AccessDenied + | AppManagementAppNotInstalledOnOrg + | FeatureNotEnabled + | InvalidAppId + | NoResolutionFound + | NotAnAdmin + | RestrictedAction + | TeamNotFound + | TooManyTeamsProvided + | SlackOpError; +/** Clear an app resolution Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_app_id` -- The `app_id` passed is invalid. - `no_resolution_found` -- No existing resolutions were found for the given `team` and `app_id`. - `not_an_admin` -- This method is only accessible by org owners and admins - `access_denied` -- This actor does not have access to the permissions on this resource. - `team_not_found` -- Returned when team id is not found. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id` - `restricted_action` -- This actor does not have access to the permissions on this resource. See https://docs.slack.dev/reference/methods/admin.apps.clearResolution */ export const clearResolution: API.OperationMethod< ClearResolutionRequest, ClearResolutionResponse, ClearResolutionError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(408, __c51, 0) as any as S.Schema, + input: __S(256, __c32, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppManagementAppNotInstalledOnOrg, + FeatureNotEnabled, + InvalidAppId, + NoResolutionFound, + NotAnAdmin, + RestrictedAction, + TeamNotFound, + TooManyTeamsProvided, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ClearResolution", })); -export type ClearSettingsError = SlackOpError; -/** Clear user-specific session settings--the session duration and what happens when the client closes--for a list of users. Required scopes -- user: `admin.users:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `admin_unauthorized` -- The owner of this token isn't authorized to clear sessions. - `bots_not_allowed` -- Bot users may not have their settings cleared. - `feature_not_enabled` -- This method is only available to Enterprise customers. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The provided token doesn't have access to this endpoint. - `not_an_admin` -- The owner of this token isn't an Org Owner or Admin. - `unknown_method` -- This method is currently not available. - `user_not_found` -- There was an error finding a requested user. See https://docs.slack.dev/reference/methods/admin.users.session.clearSettings */ +export type ClearSettingsError = + | AdminUnauthorized + | BotsNotAllowed + | FeatureNotEnabled + | InvalidArguments + | NotAnAdmin + | UnknownMethod + | UserNotFound + | SlackOpError; +/** Clear user-specific session settings--the session duration and what happens when the client closes--for a list of users. Required scopes -- user: `admin.users:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `admin_unauthorized` -- The owner of this token isn't authorized to clear sessions. - `bots_not_allowed` -- Bot users may not have their settings cleared. - `feature_not_enabled` -- This method is only available to Enterprise customers. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The provided token doesn't have access to this endpoint. - `not_an_admin` -- The owner of this token isn't an Org Owner or Admin. - `unknown_method` -- This method is currently not available. - `user_not_found` -- There was an error finding a requested user. See https://docs.slack.dev/reference/methods/admin.users.session.clearSettings */ export const clearSettings: API.OperationMethod< ClearSettingsRequest, ClearSettingsResponse, ClearSettingsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(416, __c52, 0) as any as S.Schema, + input: __S(264, __c33, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AdminUnauthorized, + BotsNotAllowed, + FeatureNotEnabled, + InvalidArguments, + NotAnAdmin, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ClearSettings", })); -export type ConversationsKickError = SlackOpError; -/** Remove multiple users from a conversation. Admin version of conversations.kick with support for bulk user removal. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The value passed for `channel_id` was invalid. - `channel_type_not_supported` -- The provided `channel_id` is a DM, MPDM, or cannot be used with this method. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated and members can't be removed. - `failed_for_all_users` -- All users could not be removed from the channel. Check `failed_user_ids` for details. - `not_supported` -- This type of channel doesn't support removing members through this method. - `restricted_action` -- The authenticated user lacks channel management permissions for this channel type, or a team preference prevents them from removing members. - `too_many_users` -- Too many user IDs provided (maximum 100). - `permission_denied` -- The user does not have permission to remove members from the channel. See https://docs.slack.dev/reference/methods/admin.conversations.kick */ +export type ConversationsKickError = + | ChannelNotFound + | ChannelTypeNotSupported + | ExternalChannelMigrating + | FailedForAllUsers + | NotSupported + | PermissionDenied + | RestrictedAction + | TooManyUsers + | SlackOpError; +/** Remove multiple users from a conversation. Admin version of conversations.kick with support for bulk user removal. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The value passed for `channel_id` was invalid. - `channel_type_not_supported` -- The provided `channel_id` is a DM, MPDM, or cannot be used with this method. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated and members can't be removed. - `failed_for_all_users` -- All users could not be removed from the channel. Check `failed_user_ids` for details. - `not_supported` -- This type of channel doesn't support removing members through this method. - `restricted_action` -- The authenticated user lacks channel management permissions for this channel type, or a team preference prevents them from removing members. - `too_many_users` -- Too many user IDs provided (maximum 100). - `permission_denied` -- The user does not have permission to remove members from the channel. See https://docs.slack.dev/reference/methods/admin.conversations.kick */ export const conversationsKick: API.OperationMethod< ConversationsKickRequest, ConversationsKickResponse, ConversationsKickError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(424, __c53, 0) as any as S.Schema, - output: __S(427, __c53, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(272, __c34, 0) as any as S.Schema, + output: __S(275, __c34, 3) as any as S.Schema, + errors: [ + ChannelNotFound, + ChannelTypeNotSupported, + ExternalChannelMigrating, + FailedForAllUsers, + NotSupported, + PermissionDenied, + RestrictedAction, + TooManyUsers, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ConversationsKick", })); -export type ConvertToPrivateError = SlackOpError; -/** Convert a public channel to a private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The value passed for `channel` was invalid. - `channel_type_not_supported` -- The value passed for `channel` was a DM, MPDM, private, or the 'general' channel. - `could_not_convert_channel` -- This channel could not be converted to private. - `default_org_wide_channel` -- The default org-wide channel cannot be converted to private. - `external_channel_migrating` -- This external channel is migrating, so it can't be converted to private. - `feature_not_enabled` -- The provided token doesn't have access to this method. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `name_taken` -- A private channel cannot be created with the given name. - `restricted_action` -- A workspace preference prevents the authenticated user from creating private channels. See https://docs.slack.dev/reference/methods/admin.conversations.convertToPrivate */ +export type ConvertToPrivateError = + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotConvertChannel + | DefaultOrgWideChannel + | ExternalChannelMigrating + | FeatureNotEnabled + | MethodNotSupportedForChannelType + | NameTaken + | RestrictedAction + | SlackOpError; +/** Convert a public channel to a private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The value passed for `channel` was invalid. - `channel_type_not_supported` -- The value passed for `channel` was a DM, MPDM, private, or the 'general' channel. - `could_not_convert_channel` -- This channel could not be converted to private. - `default_org_wide_channel` -- The default org-wide channel cannot be converted to private. - `external_channel_migrating` -- This external channel is migrating, so it can't be converted to private. - `feature_not_enabled` -- The provided token doesn't have access to this method. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `name_taken` -- A private channel cannot be created with the given name. - `restricted_action` -- A workspace preference prevents the authenticated user from creating private channels. See https://docs.slack.dev/reference/methods/admin.conversations.convertToPrivate */ export const convertToPrivate: API.OperationMethod< ConvertToPrivateRequest, ConvertToPrivateResponse, ConvertToPrivateError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(432, __c54, 0) as any as S.Schema, + input: __S(280, __c35, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotConvertChannel, + DefaultOrgWideChannel, + ExternalChannelMigrating, + FeatureNotEnabled, + MethodNotSupportedForChannelType, + NameTaken, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ConvertToPrivate", })); -export type ConvertToPublicError = SlackOpError; -/** Convert a private channel to a public channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The feature has not been enabled for this Organization - `channel_not_found` -- The channel requested for conversion to public could not be found. - `not_supported` -- Conversion to public channel is not supported for this channel. - `restricted_action` -- This user is not able to convert this channel to public. - `missing_scope` -- This user is either not an owner or the app does not have the correct scope. - `could_not_convert_channel` -- This channel could not be converted to public. - `not_an_enterprise` -- Only enterprises can convert channel to public. - `invalid_user` -- Value passed for `user_id` was not valid - `external_limited_restriction` -- away-side SC conversion fails due to being under Limited Access ("external_limited" aka "can only post") - `channel_owner_restriction` -- away-side SC conversion fails due to home-side being private - `is_idp_managed` -- The channel cannot be converted because it is IDP Managed See https://docs.slack.dev/reference/methods/admin.conversations.convertToPublic */ +export type ConvertToPublicError = + | ChannelNotFound + | ChannelOwnerRestriction + | CouldNotConvertChannel + | ExternalLimitedRestriction + | FeatureNotEnabled + | InvalidUser + | IsIdpManaged + | MissingScope + | NotAnEnterprise + | NotSupported + | RestrictedAction + | SlackOpError; +/** Convert a private channel to a public channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The feature has not been enabled for this Organization - `channel_not_found` -- The channel requested for conversion to public could not be found. - `not_supported` -- Conversion to public channel is not supported for this channel. - `restricted_action` -- This user is not able to convert this channel to public. - `missing_scope` -- This user is either not an owner or the app does not have the correct scope. - `could_not_convert_channel` -- This channel could not be converted to public. - `not_an_enterprise` -- Only enterprises can convert channel to public. - `invalid_user` -- Value passed for `user_id` was not valid - `external_limited_restriction` -- away-side SC conversion fails due to being under Limited Access ("external_limited" aka "can only post") - `channel_owner_restriction` -- away-side SC conversion fails due to home-side being private - `is_idp_managed` -- The channel cannot be converted because it is IDP Managed See https://docs.slack.dev/reference/methods/admin.conversations.convertToPublic */ export const convertToPublic: API.OperationMethod< ConvertToPublicRequest, ConvertToPublicResponse, ConvertToPublicError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(440, __c55, 0) as any as S.Schema, + input: __S(288, __c36, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + ChannelOwnerRestriction, + CouldNotConvertChannel, + ExternalLimitedRestriction, + FeatureNotEnabled, + InvalidUser, + IsIdpManaged, + MissingScope, + NotAnEnterprise, + NotSupported, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ConvertToPublic", })); -export type CreateBarrierError = SlackOpError; -/** Create an Information Barrier Required scopes -- user: `admin.barriers:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `barrier_already_exists` -- There already exists another barrier restricting activity between two or more of your requested usergroups. - `barriered_from_usergroups_not_found` -- One or more of the ids passed in for barriered_from_usergroup_ids can't be found. - `feature_not_enabled` -- The information barrier feature is not enabled, please reach out to your CSM. - `invalid_restricted_subjects` -- The restricted subjects provided are invalid or not currently supported. - `not_an_admin` -- The token provided is not associated with an org admin. - `primary_usergroup_not_found` -- The id passed in for primary_usergroup_id can't be found. See https://docs.slack.dev/reference/methods/admin.barriers.create */ +export type CreateBarrierError = + | BarrierAlreadyExists + | BarrieredFromUsergroupsNotFound + | FeatureNotEnabled + | InvalidRestrictedSubjects + | NotAnAdmin + | PrimaryUsergroupNotFound + | SlackOpError; +/** Create an Information Barrier Required scopes -- user: `admin.barriers:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `barrier_already_exists` -- There already exists another barrier restricting activity between two or more of your requested usergroups. - `barriered_from_usergroups_not_found` -- One or more of the ids passed in for barriered_from_usergroup_ids can't be found. - `feature_not_enabled` -- The information barrier feature is not enabled, please reach out to your CSM. - `invalid_restricted_subjects` -- The restricted subjects provided are invalid or not currently supported. - `not_an_admin` -- The token provided is not associated with an org admin. - `primary_usergroup_not_found` -- The id passed in for primary_usergroup_id can't be found. See https://docs.slack.dev/reference/methods/admin.barriers.create */ export const createBarrier: API.OperationMethod< CreateBarrierRequest, CreateBarrierResponse, CreateBarrierError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(448, __c56, 0) as any as S.Schema, - output: __S(456, __c57, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(296, __c37, 0) as any as S.Schema, + output: __S(312, __c39, 0) as any as S.Schema, + errors: [ + BarrierAlreadyExists, + BarrieredFromUsergroupsNotFound, + FeatureNotEnabled, + InvalidRestrictedSubjects, + NotAnAdmin, + PrimaryUsergroupNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateBarrier", })); -export type CreateConversationError = SlackOpError; -/** Create a public or private channel-based conversation. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `could_not_create_channel` -- The channel could not be created. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `invalid_name` -- The value passed for `name` was invalid. - `invalid_team` -- The provided workspace is invalid. - `name_taken` -- A channel cannot be created with the given name. - `no_local_user_on_team` -- The workspace provided had no users. - `restricted_action` -- A workspace preference prevents the authenticated user from creating channels. - `team_id_or_org_required` -- You must provide a `team_id` or set `org_wide` to `true`. - `team_not_found` -- No workspace was found for the `team_id` provided. See https://docs.slack.dev/reference/methods/admin.conversations.create */ +export type CreateConversationError = + | CouldNotCreateChannel + | FeatureNotEnabled + | InvalidName + | InvalidTeam + | NameTaken + | NoLocalUserOnTeam + | RestrictedAction + | TeamIdOrOrgRequired + | TeamNotFound + | SlackOpError; +/** Create a public or private channel-based conversation. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `could_not_create_channel` -- The channel could not be created. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `invalid_name` -- The value passed for `name` was invalid. - `invalid_team` -- The provided workspace is invalid. - `name_taken` -- A channel cannot be created with the given name. - `no_local_user_on_team` -- The workspace provided had no users. - `restricted_action` -- A workspace preference prevents the authenticated user from creating channels. - `team_id_or_org_required` -- You must provide a `team_id` or set `org_wide` to `true`. - `team_not_found` -- No workspace was found for the `team_id` provided. See https://docs.slack.dev/reference/methods/admin.conversations.create */ export const createConversation: API.OperationMethod< CreateConversationRequest, CreateConversationResponse, CreateConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(472, __c59, 0) as any as S.Schema, - output: __S(473, __c59, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(320, __c40, 0) as any as S.Schema, + output: __S(321, __c40, 1) as any as S.Schema, + errors: [ + CouldNotCreateChannel, + FeatureNotEnabled, + InvalidName, + InvalidTeam, + NameTaken, + NoLocalUserOnTeam, + RestrictedAction, + TeamIdOrOrgRequired, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateConversation", })); -export type CreateForObjectsError = SlackOpError; -/** Create a Salesforce channel for the corresponding object provided. Required scopes -- user: `admin.conversations:manage_objects` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `restricted_action` -- User does not have access to perform this action. - `record_not_found` -- Value passed for `salesforce_org_id` or `object_id` is invalid. - `feature_not_enabled` -- Feature not enabled. - `channel_already_exists` -- Object is linked to a different channel. - `missing_record_channel_config` -- Record Channels are not enabled for the given object type. See https://docs.slack.dev/reference/methods/admin.conversations.createForObjects */ +export type CreateForObjectsError = + | ChannelAlreadyExists + | FeatureNotEnabled + | MissingRecordChannelConfig + | RecordNotFound + | RestrictedAction + | SlackOpError; +/** Create a Salesforce channel for the corresponding object provided. Required scopes -- user: `admin.conversations:manage_objects` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `restricted_action` -- User does not have access to perform this action. - `record_not_found` -- Value passed for `salesforce_org_id` or `object_id` is invalid. - `feature_not_enabled` -- Feature not enabled. - `channel_already_exists` -- Object is linked to a different channel. - `missing_record_channel_config` -- Record Channels are not enabled for the given object type. See https://docs.slack.dev/reference/methods/admin.conversations.createForObjects */ export const createForObjects: API.OperationMethod< CreateForObjectsRequest, CreateForObjectsResponse, CreateForObjectsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(496, __c62, 0) as any as S.Schema, - output: __S(497, __c62, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(328, __c41, 0) as any as S.Schema, + output: __S(329, __c41, 1) as any as S.Schema, + errors: [ + ChannelAlreadyExists, + FeatureNotEnabled, + MissingRecordChannelConfig, + RecordNotFound, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateForObjects", })); -export type CreateTeamError = SlackOpError; -/** Create an Enterprise team. Required scopes -- user: `admin.teams:write` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `bad_url` -- Invalid URL. Note that domains can be at most 21 characters. - `could_not_create_workspace` -- The workspace could not be created. - `discoverability_setting_invalid` -- The given discoverability setting is invalid. - `domain_taken` -- The requested domain is taken. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `must_provide_team_domain` -- No team domain has been provided. - `must_provide_team_name` -- No team name has been provided. - `name_taken_in_org` -- The team with the specified name already exists in the org. - `not_an_admin` -- This method is only accessible by org owners and admins. See https://docs.slack.dev/reference/methods/admin.teams.create */ +export type CreateTeamError = + | BadUrl + | CouldNotCreateWorkspace + | DiscoverabilitySettingInvalid + | DomainTaken + | FeatureNotEnabled + | MustProvideTeamDomain + | MustProvideTeamName + | NameTakenInOrg + | NotAnAdmin + | SlackOpError; +/** Create an Enterprise team. Required scopes -- user: `admin.teams:write` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `bad_url` -- Invalid URL. Note that domains can be at most 21 characters. - `could_not_create_workspace` -- The workspace could not be created. - `discoverability_setting_invalid` -- The given discoverability setting is invalid. - `domain_taken` -- The requested domain is taken. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `must_provide_team_domain` -- No team domain has been provided. - `must_provide_team_name` -- No team name has been provided. - `name_taken_in_org` -- The team with the specified name already exists in the org. - `not_an_admin` -- This method is only accessible by org owners and admins. See https://docs.slack.dev/reference/methods/admin.teams.create */ export const createTeam: API.OperationMethod< CreateTeamRequest, CreateTeamResponse, CreateTeamError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(504, __c63, 0) as any as S.Schema, - output: __S(505, __c63, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(336, __c42, 0) as any as S.Schema, + output: __S(337, __c42, 1) as any as S.Schema, + errors: [ + BadUrl, + CouldNotCreateWorkspace, + DiscoverabilitySettingInvalid, + DomainTaken, + FeatureNotEnabled, + MustProvideTeamDomain, + MustProvideTeamName, + NameTakenInOrg, + NotAnAdmin, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateTeam", })); -export type CreateUsergroupError = SlackOpError; -/** Create a new organizational usergroup. This method is only available to Enterprise Grid organizations. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user is not allowed to create usergroups. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `name_already_exists` -- The name specified is used by another usergroup and cannot be created. - `handle_already_exists` -- The handle specified is used by another usergroup or entity and cannot be created. See https://docs.slack.dev/reference/methods/admin.usergroups.create */ +export type CreateUsergroupError = + | FeatureNotEnabled + | HandleAlreadyExists + | NameAlreadyExists + | NotAnEnterprise + | RestrictedAction + | SlackOpError; +/** Create a new organizational usergroup. This method is only available to Enterprise Grid organizations. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user is not allowed to create usergroups. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `name_already_exists` -- The name specified is used by another usergroup and cannot be created. - `handle_already_exists` -- The handle specified is used by another usergroup or entity and cannot be created. See https://docs.slack.dev/reference/methods/admin.usergroups.create */ export const createUsergroup: API.OperationMethod< CreateUsergroupRequest, CreateUsergroupResponse, CreateUsergroupError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(512, __c64, 0) as any as S.Schema, - output: __S(513, __c64, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(344, __c43, 0) as any as S.Schema, + output: __S(345, __c43, 1) as any as S.Schema, + errors: [ + FeatureNotEnabled, + HandleAlreadyExists, + NameAlreadyExists, + NotAnEnterprise, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateUsergroup", })); -export type DeactivateUserError = SlackOpError; -/** Deactivate a user from an enterprise organization and all its workspaces. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `restricted_action` -- The caller does not have permission to perform this action. Must be an org admin or owner. - `user_not_found` -- The user was not found or does not belong to this enterprise. - `invalid_user` -- The user was not found or is not a valid target for deactivation. - `deactivation_failed` -- The deactivation operation failed. - `user_is_team_primary_owner` -- The user is a primary owner of one or more workspaces and cannot be deactivated. See https://docs.slack.dev/reference/methods/admin.users.deactivate */ +export type DeactivateUserError = + | DeactivationFailed + | InvalidUser + | RestrictedAction + | UserIsTeamPrimaryOwner + | UserNotFound + | SlackOpError; +/** Deactivate a user from an enterprise organization and all its workspaces. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `restricted_action` -- The caller does not have permission to perform this action. Must be an org admin or owner. - `user_not_found` -- The user was not found or does not belong to this enterprise. - `invalid_user` -- The user was not found or is not a valid target for deactivation. - `deactivation_failed` -- The deactivation operation failed. - `user_is_team_primary_owner` -- The user is a primary owner of one or more workspaces and cannot be deactivated. See https://docs.slack.dev/reference/methods/admin.users.deactivate */ export const deactivateUser: API.OperationMethod< DeactivateUserRequest, DeactivateUserResponse, DeactivateUserError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(520, __c65, 0) as any as S.Schema, + input: __S(352, __c44, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + DeactivationFailed, + InvalidUser, + RestrictedAction, + UserIsTeamPrimaryOwner, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeactivateUser", })); -export type DeleteBarrierError = SlackOpError; -/** Delete an existing Information Barrier Required scopes -- user: `admin.barriers:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `barrier_not_found` -- The barrier you're trying to delete cannot be found. - `feature_not_enabled` -- The information barrier feature is not enabled, please reach out to your CSM. - `not_an_admin` -- The token provided is not associated with an org admin. See https://docs.slack.dev/reference/methods/admin.barriers.delete */ +export type DeleteBarrierError = BarrierNotFound | FeatureNotEnabled | NotAnAdmin | SlackOpError; +/** Delete an existing Information Barrier Required scopes -- user: `admin.barriers:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `barrier_not_found` -- The barrier you're trying to delete cannot be found. - `feature_not_enabled` -- The information barrier feature is not enabled, please reach out to your CSM. - `not_an_admin` -- The token provided is not associated with an org admin. See https://docs.slack.dev/reference/methods/admin.barriers.delete */ export const deleteBarrier: API.OperationMethod< DeleteBarrierRequest, DeleteBarrierResponse, DeleteBarrierError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(528, __c66, 0) as any as S.Schema, + input: __S(360, __c45, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [BarrierNotFound, FeatureNotEnabled, NotAnAdmin, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteBarrier", })); -export type DeleteConversationError = SlackOpError; -/** Delete a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The value passed for `channel_id` was invalid. - `channel_type_not_supported` -- The provided `channel_id` was a DM, MPDM, or the 'general' channel. - `could_not_delete_channel` -- The channel could not be deleted. - `default_org_wide_channel` -- The default org-wide channel cannot be deleted. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `missing_scope` -- The provided token hasn't obtained the necessary scopes to use this method. - `not_an_admin` -- The token provided is not associated with an Org Owner or Admin. - `restricted_action` -- A workspace preference prevents the authenticated user from deleting this channel. See https://docs.slack.dev/reference/methods/admin.conversations.delete */ +export type DeleteConversationError = + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotDeleteChannel + | DefaultOrgWideChannel + | FeatureNotEnabled + | MissingScope + | NotAnAdmin + | RestrictedAction + | SlackOpError; +/** Delete a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The value passed for `channel_id` was invalid. - `channel_type_not_supported` -- The provided `channel_id` was a DM, MPDM, or the 'general' channel. - `could_not_delete_channel` -- The channel could not be deleted. - `default_org_wide_channel` -- The default org-wide channel cannot be deleted. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `missing_scope` -- The provided token hasn't obtained the necessary scopes to use this method. - `not_an_admin` -- The token provided is not associated with an Org Owner or Admin. - `restricted_action` -- A workspace preference prevents the authenticated user from deleting this channel. See https://docs.slack.dev/reference/methods/admin.conversations.delete */ export const deleteConversation: API.OperationMethod< DeleteConversationRequest, DeleteConversationResponse, DeleteConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(536, __c67, 0) as any as S.Schema, + input: __S(368, __c46, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotDeleteChannel, + DefaultOrgWideChannel, + FeatureNotEnabled, + MissingScope, + NotAnAdmin, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteConversation", })); -export type DisconnectSharedError = SlackOpError; -/** Disconnect a connected channel from one or more workspaces. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_kick_home_team` -- The originating workspace cannot be kicked from the channel. - `cannot_kick_team` -- Only the originating workspace for a connected channel may remove other workspaces from the channel. - `channel_not_found` -- The value passed for `channel_id` was invalid. - `channel_type_not_supported` -- The value passed for `channel_id` was an MPDM, DM, or the 'general' channel. - `feature_not_enabled` -- The token provided does not have access to this method. - `leaving_team_not_in_channel` -- The workspace being removed is not connected to the channel. - `leaving_team_required` -- There are more than two teams in the channel--you must supplied a `leaving_team_id` parameter. - `missing_scope` -- The provided token does not have the required scopes to use this method. - `no_teams_to_disconnect` -- This channel is not shared, so there are no workspaces to disconnect. - `not_an_admin` -- The token provided is not associated with an Org Admin or Owner. - `not_an_enterprise` -- This endpoint can only be called for an Enterprise organization. - `not_supported` -- The passed `channel_id` was a DM, MPDM, or the 'general' channel. - `restricted_action` -- A workspace preference prevents the authenticated user from disconnecting a channel. - `team_not_found` -- At least one of the supplied `leaving_team_ids` are invalid. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated. - `default_org_wide_channel` -- The channel is a default org-wide channel, which isn't supported by this method. See https://docs.slack.dev/reference/methods/admin.conversations.disconnectShared */ +export type DisconnectSharedError = + | CannotKickHomeTeam + | CannotKickTeam + | ChannelNotFound + | ChannelTypeNotSupported + | DefaultOrgWideChannel + | ExternalChannelMigrating + | FeatureNotEnabled + | LeavingTeamNotInChannel + | LeavingTeamRequired + | MissingScope + | NoTeamsToDisconnect + | NotAnAdmin + | NotAnEnterprise + | NotSupported + | RestrictedAction + | TeamNotFound + | SlackOpError; +/** Disconnect a connected channel from one or more workspaces. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_kick_home_team` -- The originating workspace cannot be kicked from the channel. - `cannot_kick_team` -- Only the originating workspace for a connected channel may remove other workspaces from the channel. - `channel_not_found` -- The value passed for `channel_id` was invalid. - `channel_type_not_supported` -- The value passed for `channel_id` was an MPDM, DM, or the 'general' channel. - `feature_not_enabled` -- The token provided does not have access to this method. - `leaving_team_not_in_channel` -- The workspace being removed is not connected to the channel. - `leaving_team_required` -- There are more than two teams in the channel--you must supplied a `leaving_team_id` parameter. - `missing_scope` -- The provided token does not have the required scopes to use this method. - `no_teams_to_disconnect` -- This channel is not shared, so there are no workspaces to disconnect. - `not_an_admin` -- The token provided is not associated with an Org Admin or Owner. - `not_an_enterprise` -- This endpoint can only be called for an Enterprise organization. - `not_supported` -- The passed `channel_id` was a DM, MPDM, or the 'general' channel. - `restricted_action` -- A workspace preference prevents the authenticated user from disconnecting a channel. - `team_not_found` -- At least one of the supplied `leaving_team_ids` are invalid. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated. - `default_org_wide_channel` -- The channel is a default org-wide channel, which isn't supported by this method. See https://docs.slack.dev/reference/methods/admin.conversations.disconnectShared */ export const disconnectShared: API.OperationMethod< DisconnectSharedRequest, DisconnectSharedResponse, DisconnectSharedError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(544, __c68, 0) as any as S.Schema, + input: __S(376, __c47, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotKickHomeTeam, + CannotKickTeam, + ChannelNotFound, + ChannelTypeNotSupported, + DefaultOrgWideChannel, + ExternalChannelMigrating, + FeatureNotEnabled, + LeavingTeamNotInChannel, + LeavingTeamRequired, + MissingScope, + NoTeamsToDisconnect, + NotAnAdmin, + NotAnEnterprise, + NotSupported, + RestrictedAction, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DisconnectShared", })); -export type ExportUsersUnsupportedVersionError = SlackOpError; -/** Ask Slackbot to send you an export listing all workspace members using unsupported software, presented as a zipped CSV file. Required scopes -- user: `admin.users:read` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `could_not_export` -- For some reason, the export could not be started - `invalid_auth` -- Invalid authentication token provided. - `invalid_team_id` -- The team ID passed is invalid - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_authed` -- No authentication token provided. - `not_an_enterprise` -- Only enterprises are supported. See https://docs.slack.dev/reference/methods/admin.users.unsupportedVersions.export */ +export type ExportUsersUnsupportedVersionError = + | CouldNotExport + | InvalidTeamId + | MissingScope + | NotAnEnterprise + | SlackOpError; +/** Ask Slackbot to send you an export listing all workspace members using unsupported software, presented as a zipped CSV file. Required scopes -- user: `admin.users:read` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `could_not_export` -- For some reason, the export could not be started - `invalid_auth` -- Invalid authentication token provided. - `invalid_team_id` -- The team ID passed is invalid - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_authed` -- No authentication token provided. - `not_an_enterprise` -- Only enterprises are supported. See https://docs.slack.dev/reference/methods/admin.users.unsupportedVersions.export */ export const exportUsersUnsupportedVersion: API.OperationMethod< ExportUsersUnsupportedVersionRequest, ExportUsersUnsupportedVersionResponse, ExportUsersUnsupportedVersionError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(552, __c69, 0) as any as S.Schema, + input: __S(384, __c48, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CouldNotExport, + InvalidTeamId, + MissingScope, + NotAnEnterprise, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ExportUsersUnsupportedVersion", })); -export type FetchUsergroupError = SlackOpError; -/** Fetch an organizational usergroup. Required scopes -- user: `admin.usergroups:read` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user is not allowed to view the specified usergroup. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `invalid_usergroup` -- A usergroup with the specified ID does not exist. See https://docs.slack.dev/reference/methods/admin.usergroups.fetch */ +export type FetchUsergroupError = + | FeatureNotEnabled + | InvalidUsergroup + | NotAnEnterprise + | RestrictedAction + | SlackOpError; +/** Fetch an organizational usergroup. Required scopes -- user: `admin.usergroups:read` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user is not allowed to view the specified usergroup. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `invalid_usergroup` -- A usergroup with the specified ID does not exist. See https://docs.slack.dev/reference/methods/admin.usergroups.fetch */ export const fetchUsergroup: API.OperationMethod< FetchUsergroupRequest, FetchUsergroupResponse, FetchUsergroupError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(560, __c70, 0) as any as S.Schema, - output: __S(561, __c70, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(392, __c49, 0) as any as S.Schema, + output: __S(393, __c49, 1) as any as S.Schema, + errors: [ + FeatureNotEnabled, + InvalidUsergroup, + NotAnEnterprise, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "FetchUsergroup", })); -export type GetConversationPrefsError = SlackOpError; -/** Get conversation preferences for a public or private channel. Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The value passed for `channel_id` was invalid, or the channel belongs to a workspace other than the token's workspace and isn't shared with it. - `channel_type_not_supported` -- The provided `channel_id` was a DM, MPDM, or the 'general' channel. - `could_not_get_conversation_prefs` -- There was an error getting the conversation preferences for this channel. - `feature_not_enabled` -- The token provided does not have access to this method. - `missing_scope` -- The token provided doesn't have the required scopes. - `not_an_admin` -- The token provided is not associated with an Org Admin or Owner. - `not_an_enterprise` -- This endpoint can only be called by an Enterprise organization. - `restricted_action` -- A workspace preference prevents the authenticated user from listing preferences. - `target_team_not_on_org` -- The specified target_team is not part of the organization. See https://docs.slack.dev/reference/methods/admin.conversations.getConversationPrefs */ +export type GetConversationPrefsError = + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotGetConversationPrefs + | FeatureNotEnabled + | MissingScope + | NotAnAdmin + | NotAnEnterprise + | RestrictedAction + | TargetTeamNotOnOrg + | SlackOpError; +/** Get conversation preferences for a public or private channel. Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The value passed for `channel_id` was invalid, or the channel belongs to a workspace other than the token's workspace and isn't shared with it. - `channel_type_not_supported` -- The provided `channel_id` was a DM, MPDM, or the 'general' channel. - `could_not_get_conversation_prefs` -- There was an error getting the conversation preferences for this channel. - `feature_not_enabled` -- The token provided does not have access to this method. - `missing_scope` -- The token provided doesn't have the required scopes. - `not_an_admin` -- The token provided is not associated with an Org Admin or Owner. - `not_an_enterprise` -- This endpoint can only be called by an Enterprise organization. - `restricted_action` -- A workspace preference prevents the authenticated user from listing preferences. - `target_team_not_on_org` -- The specified target_team is not part of the organization. See https://docs.slack.dev/reference/methods/admin.conversations.getConversationPrefs */ export const getConversationPrefs: API.OperationMethod< GetConversationPrefsRequest, GetConversationPrefsResponse, GetConversationPrefsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(568, __c71, 0) as any as S.Schema, - output: __S(573, __c71, 5) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(400, __c50, 0) as any as S.Schema, + output: __S(405, __c50, 5) as any as S.Schema, + errors: [ + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotGetConversationPrefs, + FeatureNotEnabled, + MissingScope, + NotAnAdmin, + NotAnEnterprise, + RestrictedAction, + TargetTeamNotOnOrg, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetConversationPrefs", })); -export type GetCustomRetentionError = SlackOpError; -/** This API endpoint can be used by any admin to get a conversation's retention policy. Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value given for `channel_id` was invalid. - `channel_type_not_supported` -- Value given for `channel_id` was a #general channel. - `could_not_get_retention` -- The retention policy could not be retrieved. - `default_org_wide_channel` -- The channel given is a default org-wide channel. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `not_an_admin` -- The token provided is not associated with an org admin. - `restricted_action` -- A team preference prevents the authenticated user from modifying the retention policy of this channel. - `retention_override_not_allowed` -- The current org retention policy disallows modifying the retention policy of this channel. - `not_supported` -- This type of channel isn't supported by this method. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated. See https://docs.slack.dev/reference/methods/admin.conversations.getCustomRetention */ +export type GetCustomRetentionError = + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotGetRetention + | DefaultOrgWideChannel + | ExternalChannelMigrating + | FeatureNotEnabled + | NotAnAdmin + | NotSupported + | RestrictedAction + | RetentionOverrideNotAllowed + | SlackOpError; +/** This API endpoint can be used by any admin to get a conversation's retention policy. Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value given for `channel_id` was invalid. - `channel_type_not_supported` -- Value given for `channel_id` was a #general channel. - `could_not_get_retention` -- The retention policy could not be retrieved. - `default_org_wide_channel` -- The channel given is a default org-wide channel. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `not_an_admin` -- The token provided is not associated with an org admin. - `restricted_action` -- A team preference prevents the authenticated user from modifying the retention policy of this channel. - `retention_override_not_allowed` -- The current org retention policy disallows modifying the retention policy of this channel. - `not_supported` -- This type of channel isn't supported by this method. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated. See https://docs.slack.dev/reference/methods/admin.conversations.getCustomRetention */ export const getCustomRetention: API.OperationMethod< GetCustomRetentionRequest, GetCustomRetentionResponse, GetCustomRetentionError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(584, __c73, 0) as any as S.Schema, - output: __S(585, __c73, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(408, __c51, 0) as any as S.Schema, + output: __S(409, __c51, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotGetRetention, + DefaultOrgWideChannel, + ExternalChannelMigrating, + FeatureNotEnabled, + NotAnAdmin, + NotSupported, + RestrictedAction, + RetentionOverrideNotAllowed, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetCustomRetention", })); -export type GetEntitiesError = SlackOpError; -/** Fetch all the entities assigned to a particular authentication policy by name. Required scopes -- user: `admin.users:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- This method is only available for Enterprise organizations. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The token doesn't have access to this endpoint. - `invalid_cursor` -- The cursor passed was invalid. - `not_an_admin` -- This method is only accessible by Org Owners and Admins. - `policy_not_found` -- The `policy_name` could not be found. - `ratelimited` -- The rate limit for this endpoint has been reached. See https://docs.slack.dev/reference/methods/admin.auth.policy.getEntities */ +export type GetEntitiesError = + | FeatureNotEnabled + | InvalidArguments + | InvalidCursor + | NotAnAdmin + | PolicyNotFound + | SlackOpError; +/** Fetch all the entities assigned to a particular authentication policy by name. Required scopes -- user: `admin.users:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- This method is only available for Enterprise organizations. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The token doesn't have access to this endpoint. - `invalid_cursor` -- The cursor passed was invalid. - `not_an_admin` -- This method is only accessible by Org Owners and Admins. - `policy_not_found` -- The `policy_name` could not be found. - `ratelimited` -- The rate limit for this endpoint has been reached. See https://docs.slack.dev/reference/methods/admin.auth.policy.getEntities */ export const getEntities: API.PaginatedOperationMethod< GetEntitiesRequest, GetEntitiesResponse, @@ -3261,9 +8660,17 @@ export const getEntities: API.PaginatedOperationMethod< GetEntitiesResponseEntitiesItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(592, __c74, 0) as any as S.Schema, - output: __S(595, __c74, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(416, __c52, 0) as any as S.Schema, + output: __S(419, __c52, 3) as any as S.Schema, + errors: [ + FeatureNotEnabled, + InvalidArguments, + InvalidCursor, + NotAnAdmin, + PolicyNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3279,178 +8686,416 @@ export const getEntities: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type GetExpirationError = SlackOpError; -/** Fetches the expiration timestamp for a guest Required scopes -- user: `admin.users:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `paid_teams_only` -- This feature is only accessible to paid teams - `no_perms` -- User does not have appropriate permissions. - `team_not_found` -- Team not found - `user_not_found` -- User not found - `not_permitted` -- This action is not permitted - `target_team_not_on_org` -- Target team specified is not on the org in context - `user_is_not_guest` -- The user is not a guest See https://docs.slack.dev/reference/methods/admin.users.getExpiration */ +export type GetExpirationError = + | NoPerms + | NotPermitted + | PaidTeamsOnly + | TargetTeamNotOnOrg + | TeamNotFound + | UserIsNotGuest + | UserNotFound + | SlackOpError; +/** Fetches the expiration timestamp for a guest Required scopes -- user: `admin.users:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `paid_teams_only` -- This feature is only accessible to paid teams - `no_perms` -- User does not have appropriate permissions. - `team_not_found` -- Team not found - `user_not_found` -- User not found - `not_permitted` -- This action is not permitted - `target_team_not_on_org` -- Target team specified is not on the org in context - `user_is_not_guest` -- The user is not a guest See https://docs.slack.dev/reference/methods/admin.users.getExpiration */ export const getExpiration: API.OperationMethod< GetExpirationRequest, GetExpirationResponse, GetExpirationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(600, __c75, 0) as any as S.Schema, - output: __S(602, __c75, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(424, __c53, 0) as any as S.Schema, + output: __S(426, __c53, 2) as any as S.Schema, + errors: [ + NoPerms, + NotPermitted, + PaidTeamsOnly, + TargetTeamNotOnOrg, + TeamNotFound, + UserIsNotGuest, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetExpiration", })); -export type GetFileError = SlackOpError; -/** Retrieve analytics data for a given date, presented as a compressed JSON file Required scopes -- user: `admin.analytics:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `data_not_available` -- The `date` was before the API became available. - `feature_not_available` -- The user token does not belong to an Enterprise or Business+ team. - `feature_not_enabled` -- This feature is not enabled on your workspace. - `file_not_found` -- The analytics data for the `date` specified weren't found. - `file_not_yet_available` -- The analytics data for the `date` isn't available yet. - `invalid_arguments` -- Arguments weren't fully provided. For example, the `date` argument wasn't passed. - `invalid_date` -- The `date` argument was invalid. - `invalid_type` -- The analytics data for the `type` specified weren't found. - `member_analytics_disabled` -- Member analytics are disabled for your organization. - `metadata_not_available` -- Metadata not available for the analytics `type` you provided. - `metadata_only_does_not_support_date` -- The `metadata_only` field gets the latest metadata file. The `date` field is not supported. - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- The user token does not have admin privileges. - `org_level_email_display_disabled` -- This API is unavailable for organizations with a _'Hide email addresses'_ policy. - `user_cannot_manage_public_channels` -- The user must have permissions to manage public channels at the Enterprise level. See https://docs.slack.dev/reference/methods/admin.analytics.getFile */ +export type GetFileError = + | DataNotAvailable + | FeatureNotAvailable + | FeatureNotEnabled + | FileNotFound + | FileNotYetAvailable + | InvalidArguments + | InvalidDate + | InvalidType + | MemberAnalyticsDisabled + | MetadataNotAvailable + | MetadataOnlyDoesNotSupportDate + | MissingScope + | NotAnAdmin + | OrgLevelEmailDisplayDisabled + | UserCannotManagePublicChannels + | SlackOpError; +/** Retrieve analytics data for a given date, presented as a compressed JSON file Required scopes -- user: `admin.analytics:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `data_not_available` -- The `date` was before the API became available. - `feature_not_available` -- The user token does not belong to an Enterprise or Business+ team. - `feature_not_enabled` -- This feature is not enabled on your workspace. - `file_not_found` -- The analytics data for the `date` specified weren't found. - `file_not_yet_available` -- The analytics data for the `date` isn't available yet. - `invalid_arguments` -- Arguments weren't fully provided. For example, the `date` argument wasn't passed. - `invalid_date` -- The `date` argument was invalid. - `invalid_type` -- The analytics data for the `type` specified weren't found. - `member_analytics_disabled` -- Member analytics are disabled for your organization. - `metadata_not_available` -- Metadata not available for the analytics `type` you provided. - `metadata_only_does_not_support_date` -- The `metadata_only` field gets the latest metadata file. The `date` field is not supported. - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- The user token does not have admin privileges. - `org_level_email_display_disabled` -- This API is unavailable for organizations with a _'Hide email addresses'_ policy. - `user_cannot_manage_public_channels` -- The user must have permissions to manage public channels at the Enterprise level. See https://docs.slack.dev/reference/methods/admin.analytics.getFile */ export const getFile: API.OperationMethod< GetFileRequest, GetFileResponse, GetFileError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(608, __c76, 0) as any as S.Schema, - output: __S(609, __c76, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(432, __c54, 0) as any as S.Schema, + output: __S(433, __c54, 1) as any as S.Schema, + errors: [ + DataNotAvailable, + FeatureNotAvailable, + FeatureNotEnabled, + FileNotFound, + FileNotYetAvailable, + InvalidArguments, + InvalidDate, + InvalidType, + MemberAnalyticsDisabled, + MetadataNotAvailable, + MetadataOnlyDoesNotSupportDate, + MissingScope, + NotAnAdmin, + OrgLevelEmailDisplayDisabled, + UserCannotManagePublicChannels, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetFile", })); -export type GetItemError = SlackOpError; -/** API to allow Enterprise org admins to read the allow list of IP blocks and ASNs from the enterprise configuration. Required scopes -- user: `admin` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `endpoint_unavailable` -- The requested endpoint is currently unavailable. - `not_an_enterprise` -- The user is not an enterprise admin. - `not_authed` -- auth token is not valid. - `unsupported_action_describe` -- The user specified action is unsupported - `unsupported_action_put` -- The user specified action is unsupported See https://docs.slack.dev/reference/methods/admin.audit.anomaly.allow.getItem */ +export type GetItemError = + | EndpointUnavailable + | NotAnEnterprise + | UnsupportedActionDescribe + | UnsupportedActionPut + | SlackOpError; +/** API to allow Enterprise org admins to read the allow list of IP blocks and ASNs from the enterprise configuration. Required scopes -- user: `admin` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `endpoint_unavailable` -- The requested endpoint is currently unavailable. - `not_an_enterprise` -- The user is not an enterprise admin. - `not_authed` -- auth token is not valid. - `unsupported_action_describe` -- The user specified action is unsupported - `unsupported_action_put` -- The user specified action is unsupported See https://docs.slack.dev/reference/methods/admin.audit.anomaly.allow.getItem */ export const getItem: API.OperationMethod< GetItemRequest, GetItemResponse, GetItemError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(616, __c77, 0) as any as S.Schema, - output: __S(617, __c77, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(440, __c55, 0) as any as S.Schema, + output: __S(441, __c55, 1) as any as S.Schema, + errors: [ + EndpointUnavailable, + NotAnEnterprise, + UnsupportedActionDescribe, + UnsupportedActionPut, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetItem", })); -export type GetSettingsError = SlackOpError; -/** Get user-specific session settings--the session duration and what happens when the client closes--given a list of users. Required scopes -- user: `admin.users:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `admin_unauthorized` -- The owner of this token isn't authorized to list sessions. - `bots_not_allowed` -- Bot sessions are not listed by this method. - `feature_not_enabled` -- This method is only available to Enterprise customers. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The provided token doesn't have access to this endpoint. - `restricted_action` -- The owner of this token isn't an Org Owner or Admin. - `not_an_admin` -- The owner of this token isn't an Org Owner or Admin. - `unknown_method` -- This method is currently not available. - `user_not_found` -- There was an error finding the requested user. See https://docs.slack.dev/reference/methods/admin.users.session.getSettings */ +export type GetSettingsError = + | AdminUnauthorized + | BotsNotAllowed + | FeatureNotEnabled + | InvalidArguments + | NotAnAdmin + | RestrictedAction + | UnknownMethod + | UserNotFound + | SlackOpError; +/** Get user-specific session settings--the session duration and what happens when the client closes--given a list of users. Required scopes -- user: `admin.users:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `admin_unauthorized` -- The owner of this token isn't authorized to list sessions. - `bots_not_allowed` -- Bot sessions are not listed by this method. - `feature_not_enabled` -- This method is only available to Enterprise customers. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The provided token doesn't have access to this endpoint. - `restricted_action` -- The owner of this token isn't an Org Owner or Admin. - `not_an_admin` -- The owner of this token isn't an Org Owner or Admin. - `unknown_method` -- This method is currently not available. - `user_not_found` -- There was an error finding the requested user. See https://docs.slack.dev/reference/methods/admin.users.session.getSettings */ export const getSettings: API.OperationMethod< GetSettingsRequest, GetSettingsResponse, GetSettingsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(632, __c79, 0) as any as S.Schema, - output: __S(635, __c79, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(456, __c57, 0) as any as S.Schema, + output: __S(459, __c57, 3) as any as S.Schema, + errors: [ + AdminUnauthorized, + BotsNotAllowed, + FeatureNotEnabled, + InvalidArguments, + NotAnAdmin, + RestrictedAction, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetSettings", })); -export type GetTeamsError = SlackOpError; -/** Get all the workspaces a given public or private channel is connected to within this Enterprise org. Required scopes -- user: `admin.conversations:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The channel wasn't found or isn't connected to multiple workspaces. - `channel_type_not_supported` -- The `channel_id` provided was a DM, MPDM, or the 'general' channel. - `could_not_get_teams` -- Could not fetch the workspaces that the channel is shared with in this organization. - `external_channel_migrating` -- The channel is actively being migrated - `feature_not_enabled` -- The token provided doesn't have access to this method. - `invalid_cursor` -- The provided cursor wasn't valid. - `invalid_limit` -- The value passed for `limit` wasn't valid. - `restricted_action` -- A workspace preference prevents the authenticated user from listing the workspaces connected to a channel. - `unsupported_team_type` -- This endpoint can only called by Enterprise organizations. - `target_team_not_on_org` -- The specified target_team is not part of the organization. - `not_supported` -- This type of channel isn't supported by this method. - `default_org_wide_channel` -- The channel is a default org-wide channel, which isn't supported by this method. See https://docs.slack.dev/reference/methods/admin.conversations.getTeams */ +export type GetTeamsError = + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotGetTeams + | DefaultOrgWideChannel + | ExternalChannelMigrating + | FeatureNotEnabled + | InvalidCursor + | InvalidLimit + | NotSupported + | RestrictedAction + | TargetTeamNotOnOrg + | UnsupportedTeamType + | SlackOpError; +/** Get all the workspaces a given public or private channel is connected to within this Enterprise org. Required scopes -- user: `admin.conversations:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The channel wasn't found or isn't connected to multiple workspaces. - `channel_type_not_supported` -- The `channel_id` provided was a DM, MPDM, or the 'general' channel. - `could_not_get_teams` -- Could not fetch the workspaces that the channel is shared with in this organization. - `external_channel_migrating` -- The channel is actively being migrated - `feature_not_enabled` -- The token provided doesn't have access to this method. - `invalid_cursor` -- The provided cursor wasn't valid. - `invalid_limit` -- The value passed for `limit` wasn't valid. - `restricted_action` -- A workspace preference prevents the authenticated user from listing the workspaces connected to a channel. - `unsupported_team_type` -- This endpoint can only called by Enterprise organizations. - `target_team_not_on_org` -- The specified target_team is not part of the organization. - `not_supported` -- This type of channel isn't supported by this method. - `default_org_wide_channel` -- The channel is a default org-wide channel, which isn't supported by this method. See https://docs.slack.dev/reference/methods/admin.conversations.getTeams */ export const getTeams: API.OperationMethod< GetTeamsRequest, GetTeamsResponse, GetTeamsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(640, __c80, 0) as any as S.Schema, - output: __S(641, __c80, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(464, __c58, 0) as any as S.Schema, + output: __S(465, __c58, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotGetTeams, + DefaultOrgWideChannel, + ExternalChannelMigrating, + FeatureNotEnabled, + InvalidCursor, + InvalidLimit, + NotSupported, + RestrictedAction, + TargetTeamNotOnOrg, + UnsupportedTeamType, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetTeams", })); -export type InvalidateUsersSessionError = SlackOpError; -/** Revoke a single session for a user. The user will be forced to login to Slack. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `admin_unauthorized` -- The token provided doesn't have permission to revoke a session. - `cannot_invalidate_primary_owner` -- Only the primary owner of an organization can invalidate a primary owner's sessions. - `feature_not_enabled` -- The token provided can't call this method. - `invalid_auth` -- The provided token doesn't have access to this endpoint. - `not_an_admin` -- This method must be called by an Org Owner or Admin. - `session_invalidation_failed` -- There was an error invalidating the session. - `session_not_found` -- The requested session wasn't found. - `unknown_method` -- This method is currently not available. - `user_not_found` -- The requested user wasn't found. See https://docs.slack.dev/reference/methods/admin.users.session.invalidate */ +export type InvalidateUsersSessionError = + | AdminUnauthorized + | CannotInvalidatePrimaryOwner + | FeatureNotEnabled + | NotAnAdmin + | SessionInvalidationFailed + | SessionNotFound + | UnknownMethod + | UserNotFound + | SlackOpError; +/** Revoke a single session for a user. The user will be forced to login to Slack. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `admin_unauthorized` -- The token provided doesn't have permission to revoke a session. - `cannot_invalidate_primary_owner` -- Only the primary owner of an organization can invalidate a primary owner's sessions. - `feature_not_enabled` -- The token provided can't call this method. - `invalid_auth` -- The provided token doesn't have access to this endpoint. - `not_an_admin` -- This method must be called by an Org Owner or Admin. - `session_invalidation_failed` -- There was an error invalidating the session. - `session_not_found` -- The requested session wasn't found. - `unknown_method` -- This method is currently not available. - `user_not_found` -- The requested user wasn't found. See https://docs.slack.dev/reference/methods/admin.users.session.invalidate */ export const invalidateUsersSession: API.OperationMethod< InvalidateUsersSessionRequest, InvalidateUsersSessionResponse, InvalidateUsersSessionError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(648, __c81, 0) as any as S.Schema, + input: __S(472, __c59, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AdminUnauthorized, + CannotInvalidatePrimaryOwner, + FeatureNotEnabled, + NotAnAdmin, + SessionInvalidationFailed, + SessionNotFound, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "InvalidateUsersSession", })); -export type InviteConversationError = SlackOpError; -/** Invite a user to a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The value passed for `channel_id` was invalid. - `channel_type_not_supported` -- The provided `channel_id` was a DM, MPDM, or the 'general' channel. - `default_org_wide_channel` -- Users may not be invited to the default org-wide channel. - `failed_for_some_users` -- The method failed for a subset of the users passed. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `restricted_action` -- A workspace preference prevents the authenticated user from inviting. - `user_must_be_admin` -- The token provided must be associated with an Org Admin or Owner. See https://docs.slack.dev/reference/methods/admin.conversations.invite */ +export type InviteConversationError = + | ChannelNotFound + | ChannelTypeNotSupported + | DefaultOrgWideChannel + | FailedForSomeUsers + | FeatureNotEnabled + | RestrictedAction + | UserMustBeAdmin + | SlackOpError; +/** Invite a user to a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The value passed for `channel_id` was invalid. - `channel_type_not_supported` -- The provided `channel_id` was a DM, MPDM, or the 'general' channel. - `default_org_wide_channel` -- Users may not be invited to the default org-wide channel. - `failed_for_some_users` -- The method failed for a subset of the users passed. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `restricted_action` -- A workspace preference prevents the authenticated user from inviting. - `user_must_be_admin` -- The token provided must be associated with an Org Admin or Owner. See https://docs.slack.dev/reference/methods/admin.conversations.invite */ export const inviteConversation: API.OperationMethod< InviteConversationRequest, InviteConversationResponse, InviteConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(656, __c82, 0) as any as S.Schema, + input: __S(480, __c60, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + ChannelTypeNotSupported, + DefaultOrgWideChannel, + FailedForSomeUsers, + FeatureNotEnabled, + RestrictedAction, + UserMustBeAdmin, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "InviteConversation", })); -export type InviteRequestsDenyError = SlackOpError; -/** Deny a workspace invite request. Required scopes -- user: `admin.invites:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `already_processed` -- The `invite_request_id` passed has already been approved or denied. - `feature_not_enabled` -- The Invite Request Admin APIs feature is not enabled - `invalid_request` -- The `invite_request_id` passed is invalid. - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- This token doesn't have admin privileges. - `team_not_found` -- The `team_id` specified wasn't found. See https://docs.slack.dev/reference/methods/admin.inviteRequests.deny */ +export type InviteRequestsDenyError = + | AlreadyProcessed + | FeatureNotEnabled + | InvalidRequest + | MissingScope + | NotAnAdmin + | TeamNotFound + | SlackOpError; +/** Deny a workspace invite request. Required scopes -- user: `admin.invites:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `already_processed` -- The `invite_request_id` passed has already been approved or denied. - `feature_not_enabled` -- The Invite Request Admin APIs feature is not enabled - `invalid_request` -- The `invite_request_id` passed is invalid. - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- This token doesn't have admin privileges. - `team_not_found` -- The `team_id` specified wasn't found. See https://docs.slack.dev/reference/methods/admin.inviteRequests.deny */ export const inviteRequestsDeny: API.OperationMethod< InviteRequestsDenyRequest, InviteRequestsDenyResponse, InviteRequestsDenyError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(664, __c83, 0) as any as S.Schema, + input: __S(488, __c61, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AlreadyProcessed, + FeatureNotEnabled, + InvalidRequest, + MissingScope, + NotAnAdmin, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "InviteRequestsDeny", })); -export type InviteUserError = SlackOpError; -/** Invite a user to a workspace. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `already_in_team` -- The user is already on the team. - `already_in_team_invited_user` -- The user has already been invited to the team. - `failed_looking_up_user` -- We couldn't find the requested user. - `failed_to_send_invite` -- The invite failed to send. - `failed_to_validate_caller` -- The token calling this method doesn't have permission to invite a user. - `failed_to_validate_channels` -- `channel_ids` was invalid. - `failed_to_validate_custom_message` -- `extra_message` was invalid. - `failed_to_validate_expiration` -- `expiration_ts` was invalid. - `failed_to_validate_team` -- The team calling this method was invalid. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_email` -- Email address was not valid. - `not_an_admin` -- The user token does not have admin privileges. - `team_not_found` -- `team_id` was not found. - `user_disabled` -- The user is disabled. - `inviter_email_not_verified` -- The user whose token is calling this method has not verified the email address on their own account. They must verify it before they can send invites, since the invite email presents that address as theirs. See https://docs.slack.dev/reference/methods/admin.users.invite */ +export type InviteUserError = + | AlreadyInTeam + | AlreadyInTeamInvitedUser + | FailedLookingUpUser + | FailedToSendInvite + | FailedToValidateCaller + | FailedToValidateChannels + | FailedToValidateCustomMessage + | FailedToValidateExpiration + | FailedToValidateTeam + | FeatureNotEnabled + | InvalidEmail + | InviterEmailNotVerified + | NotAnAdmin + | TeamNotFound + | UserDisabled + | SlackOpError; +/** Invite a user to a workspace. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `already_in_team` -- The user is already on the team. - `already_in_team_invited_user` -- The user has already been invited to the team. - `failed_looking_up_user` -- We couldn't find the requested user. - `failed_to_send_invite` -- The invite failed to send. - `failed_to_validate_caller` -- The token calling this method doesn't have permission to invite a user. - `failed_to_validate_channels` -- `channel_ids` was invalid. - `failed_to_validate_custom_message` -- `extra_message` was invalid. - `failed_to_validate_expiration` -- `expiration_ts` was invalid. - `failed_to_validate_team` -- The team calling this method was invalid. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_email` -- Email address was not valid. - `not_an_admin` -- The user token does not have admin privileges. - `team_not_found` -- `team_id` was not found. - `user_disabled` -- The user is disabled. - `inviter_email_not_verified` -- The user whose token is calling this method has not verified the email address on their own account. They must verify it before they can send invites, since the invite email presents that address as theirs. See https://docs.slack.dev/reference/methods/admin.users.invite */ export const inviteUser: API.OperationMethod< InviteUserRequest, InviteUserResponse, InviteUserError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(680, __c85, 0) as any as S.Schema, + input: __S(496, __c62, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AlreadyInTeam, + AlreadyInTeamInvitedUser, + FailedLookingUpUser, + FailedToSendInvite, + FailedToValidateCaller, + FailedToValidateChannels, + FailedToValidateCustomMessage, + FailedToValidateExpiration, + FailedToValidateTeam, + FeatureNotEnabled, + InvalidEmail, + InviterEmailNotVerified, + NotAnAdmin, + TeamNotFound, + UserDisabled, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "InviteUser", })); -export type LinkObjectsError = SlackOpError; -/** Link a Salesforce record to a channel Required scopes -- user: `admin.conversations:manage_objects` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_already_exists` -- Object is linked to a different channel. - `channel_conversion_incomplete` -- An active channel conversion is preventing linking. - `channel_is_archived` -- Channel is archived. - `channel_not_found` -- Value passed for `channel` is invalid. - `channel_not_org_wide_shared` -- Channel is not Org-wide shared. - `channel_shared_with_nonapproved_team` -- Channel is shared with a non-approved external team. - `config_not_found` -- Missing record configuration. - `invalid_channel_type` -- Channel type cannot be linked. - `name_taken` -- A channel cannot be created with the given name. - `not_allowed_for_grid_workspace` -- Channel type is not allowed for this Enterprise org workspace. - `restricted_action` -- User does not have access to perform this action. - `record_channel_already_exists` -- Record is linked to a different channel. - `record_channel_cannot_be_externally_shared` -- Channel cannot be linked because it is externally shared. - `record_not_found` -- Value passed for `record_id` is invalid. See https://docs.slack.dev/reference/methods/admin.conversations.linkObjects */ +export type LinkObjectsError = + | ChannelAlreadyExists + | ChannelConversionIncomplete + | ChannelIsArchived + | ChannelNotFound + | ChannelNotOrgWideShared + | ChannelSharedWithNonapprovedTeam + | ConfigNotFound + | InvalidChannelType + | NameTaken + | NotAllowedForGridWorkspace + | RecordChannelAlreadyExists + | RecordChannelCannotBeExternallyShared + | RecordNotFound + | RestrictedAction + | SlackOpError; +/** Link a Salesforce record to a channel Required scopes -- user: `admin.conversations:manage_objects` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_already_exists` -- Object is linked to a different channel. - `channel_conversion_incomplete` -- An active channel conversion is preventing linking. - `channel_is_archived` -- Channel is archived. - `channel_not_found` -- Value passed for `channel` is invalid. - `channel_not_org_wide_shared` -- Channel is not Org-wide shared. - `channel_shared_with_nonapproved_team` -- Channel is shared with a non-approved external team. - `config_not_found` -- Missing record configuration. - `invalid_channel_type` -- Channel type cannot be linked. - `name_taken` -- A channel cannot be created with the given name. - `not_allowed_for_grid_workspace` -- Channel type is not allowed for this Enterprise org workspace. - `restricted_action` -- User does not have access to perform this action. - `record_channel_already_exists` -- Record is linked to a different channel. - `record_channel_cannot_be_externally_shared` -- Channel cannot be linked because it is externally shared. - `record_not_found` -- Value passed for `record_id` is invalid. See https://docs.slack.dev/reference/methods/admin.conversations.linkObjects */ export const linkObjects: API.OperationMethod< LinkObjectsRequest, LinkObjectsResponse, LinkObjectsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(688, __c86, 0) as any as S.Schema, + input: __S(504, __c63, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelAlreadyExists, + ChannelConversionIncomplete, + ChannelIsArchived, + ChannelNotFound, + ChannelNotOrgWideShared, + ChannelSharedWithNonapprovedTeam, + ConfigNotFound, + InvalidChannelType, + NameTaken, + NotAllowedForGridWorkspace, + RecordChannelAlreadyExists, + RecordChannelCannotBeExternallyShared, + RecordNotFound, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "LinkObjects", })); -export type ListAppsActivitiesError = SlackOpError; -/** Get logs for a specified team/org Required scopes -- user: `admin.app_activities:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Something went wrong on our end, please try again. - `invalid_app_id` -- App ID provided is not valid. - `invalid_app` -- App ID provided is not valid for team and user. - `invalid_args` -- Required arguments either were not provided or contain invalid values. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_team` -- Team ID provided is not valid See https://docs.slack.dev/reference/methods/admin.apps.activities.list */ +export type ListAppsActivitiesError = + | InvalidApp + | InvalidAppId + | InvalidArgs + | InvalidCursor + | InvalidTeam + | SlackOpError; +/** Get logs for a specified team/org Required scopes -- user: `admin.app_activities:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `internal_error` -- Something went wrong on our end, please try again. - `invalid_app_id` -- App ID provided is not valid. - `invalid_app` -- App ID provided is not valid for team and user. - `invalid_args` -- Required arguments either were not provided or contain invalid values. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_team` -- Team ID provided is not valid See https://docs.slack.dev/reference/methods/admin.apps.activities.list */ export const listAppsActivities: API.PaginatedOperationMethod< ListAppsActivitiesRequest, ListAppsActivitiesResponse, @@ -3459,9 +9104,17 @@ export const listAppsActivities: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(696, __c87, 0) as any as S.Schema, - output: __S(697, __c87, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(512, __c64, 0) as any as S.Schema, + output: __S(513, __c64, 1) as any as S.Schema, + errors: [ + InvalidApp, + InvalidAppId, + InvalidArgs, + InvalidCursor, + InvalidTeam, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3477,8 +9130,18 @@ export const listAppsActivities: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListAppsApprovedError = SlackOpError; -/** List approved apps for an org or workspace. Required scopes -- user: `admin.apps:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_actor` -- The provided actor_id is not a valid user or application - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_allowed` -- The user is not allowed to access this API method - `not_an_admin` -- This method is only accessible by org/workspace owners and admins - `team_not_found` -- Returned when team id is not found. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id`. - `restricted_action` -- User does not have permission to access method See https://docs.slack.dev/reference/methods/admin.apps.approved.list */ +export type ListAppsApprovedError = + | AppManagementAppNotInstalledOnOrg + | FeatureNotEnabled + | InvalidActor + | InvalidCursor + | NotAllowed + | NotAnAdmin + | RestrictedAction + | TeamNotFound + | TooManyTeamsProvided + | SlackOpError; +/** List approved apps for an org or workspace. Required scopes -- user: `admin.apps:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_actor` -- The provided actor_id is not a valid user or application - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_allowed` -- The user is not allowed to access this API method - `not_an_admin` -- This method is only accessible by org/workspace owners and admins - `team_not_found` -- Returned when team id is not found. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id`. - `restricted_action` -- User does not have permission to access method See https://docs.slack.dev/reference/methods/admin.apps.approved.list */ export const listAppsApproved: API.PaginatedOperationMethod< ListAppsApprovedRequest, ListAppsApprovedResponse, @@ -3487,9 +9150,21 @@ export const listAppsApproved: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(712, __c89, 0) as any as S.Schema, - output: __S(713, __c89, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(528, __c66, 0) as any as S.Schema, + output: __S(529, __c66, 1) as any as S.Schema, + errors: [ + AppManagementAppNotInstalledOnOrg, + FeatureNotEnabled, + InvalidActor, + InvalidCursor, + NotAllowed, + NotAnAdmin, + RestrictedAction, + TeamNotFound, + TooManyTeamsProvided, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3505,8 +9180,13 @@ export const listAppsApproved: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListAppsMcpServersError = SlackOpError; -/** List third-party app MCP servers approved for an organization, derived from the org's MCP server allowlist. Entries reflect allowlist state, not install/scope liveness: servers of apps that are uninstalled (but not deleted) are still listed. Required scopes -- user: `admin.apps:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `restricted_action` -- User does not have permission to perform this action. - `invalid_auth` -- Invalid authorization token - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `internal_error` -- Internal error - `feature_not_enabled` -- The MCP server admin API feature is not enabled for this team. See https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.list */ +export type ListAppsMcpServersError = + | FeatureNotEnabled + | InvalidCursor + | NotAnEnterprise + | RestrictedAction + | SlackOpError; +/** List third-party app MCP servers approved for an organization, derived from the org's MCP server allowlist. Entries reflect allowlist state, not install/scope liveness: servers of apps that are uninstalled (but not deleted) are still listed. Required scopes -- user: `admin.apps:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `restricted_action` -- User does not have permission to perform this action. - `invalid_auth` -- Invalid authorization token - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `internal_error` -- Internal error - `feature_not_enabled` -- The MCP server admin API feature is not enabled for this team. See https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.list */ export const listAppsMcpServers: API.PaginatedOperationMethod< ListAppsMcpServersRequest, ListAppsMcpServersResponse, @@ -3515,9 +9195,16 @@ export const listAppsMcpServers: API.PaginatedOperationMethod< ListAppsMcpServersResponseServersItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(720, __c90, 0) as any as S.Schema, - output: __S(723, __c90, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(536, __c67, 0) as any as S.Schema, + output: __S(539, __c67, 3) as any as S.Schema, + errors: [ + FeatureNotEnabled, + InvalidCursor, + NotAnEnterprise, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3533,42 +9220,73 @@ export const listAppsMcpServers: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListAppsMcpServersPermissionsError = SlackOpError; -/** List MCP servers for an app with their access control permissions Required scopes -- user: `admin.apps:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `restricted_action` -- User does not have permission to perform this action. - `invalid_auth` -- Invalid authorization token - `app_not_found` -- This app does not exist. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `internal_error` -- An internal error occurred while resolving the app's approved domains or ACLs. Retry the request. See https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.permissions.list */ +export type ListAppsMcpServersPermissionsError = + | AppNotFound + | NotAnEnterprise + | RestrictedAction + | SlackOpError; +/** List MCP servers for an app with their access control permissions Required scopes -- user: `admin.apps:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `restricted_action` -- User does not have permission to perform this action. - `invalid_auth` -- Invalid authorization token - `app_not_found` -- This app does not exist. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `internal_error` -- An internal error occurred while resolving the app's approved domains or ACLs. Retry the request. See https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.permissions.list */ export const listAppsMcpServersPermissions: API.OperationMethod< ListAppsMcpServersPermissionsRequest, ListAppsMcpServersPermissionsResponse, ListAppsMcpServersPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(728, __c91, 0) as any as S.Schema, - output: __S(729, __c91, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(544, __c68, 0) as any as S.Schema, + output: __S(545, __c68, 1) as any as S.Schema, + errors: [AppNotFound, NotAnEnterprise, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListAppsMcpServersPermissions", })); -export type ListAppsPermissionsError = SlackOpError; -/** Returns the permission type of an app and if applicable, includes the entities that have been granted access Required scopes -- user: `admin.apps:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `restricted_action` -- User does not have permission to perform this action. - `invalid_auth` -- Invalid authorization token - `access_denied` -- This actor does not have access to the permissions on this resource. - `app_not_found` -- This app does not exist. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `invalid_permission_type` -- The ACL has an invalid permission type. See https://docs.slack.dev/reference/methods/admin.apps.permissions.list */ +export type ListAppsPermissionsError = + | AccessDenied + | AppNotFound + | InvalidPermissionType + | NotAnEnterprise + | RestrictedAction + | SlackOpError; +/** Returns the permission type of an app and if applicable, includes the entities that have been granted access Required scopes -- user: `admin.apps:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `restricted_action` -- User does not have permission to perform this action. - `invalid_auth` -- Invalid authorization token - `access_denied` -- This actor does not have access to the permissions on this resource. - `app_not_found` -- This app does not exist. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `invalid_permission_type` -- The ACL has an invalid permission type. See https://docs.slack.dev/reference/methods/admin.apps.permissions.list */ export const listAppsPermissions: API.OperationMethod< ListAppsPermissionsRequest, ListAppsPermissionsResponse, ListAppsPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(736, __c92, 0) as any as S.Schema, + input: __S(552, __c69, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppNotFound, + InvalidPermissionType, + NotAnEnterprise, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListAppsPermissions", })); -export type ListAppsRequestsError = SlackOpError; -/** List app requests for a team/workspace. Required scopes -- user: `admin.apps:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `enterprise_not_found` -- Returned when enterprise id is not found. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_auth` -- invalid token or actor does not have access - `not_allowed` -- The user is not allowed to access this API method - `not_an_admin` -- This method is only accessible by org owners and admins - `restricted_action` -- The action is restricted for this team - `user_is_restricted` -- This method is only accessible by org owners, admins, and integration managers - `no_team_or_enterprise_provided` -- Must provide team ID or enterprise ID - `team_not_found` -- Returned when team id is not found. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id` - `invalid_scopes` -- One or more of the given scopes is not a recognized OAuth scope See https://docs.slack.dev/reference/methods/admin.apps.requests.list */ +export type ListAppsRequestsError = + | AppManagementAppNotInstalledOnOrg + | EnterpriseNotFound + | FeatureNotEnabled + | InvalidCursor + | InvalidScopes + | NoTeamOrEnterpriseProvided + | NotAllowed + | NotAnAdmin + | RestrictedAction + | TeamNotFound + | TooManyTeamsProvided + | UserIsRestricted + | SlackOpError; +/** List app requests for a team/workspace. Required scopes -- user: `admin.apps:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `enterprise_not_found` -- Returned when enterprise id is not found. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_auth` -- invalid token or actor does not have access - `not_allowed` -- The user is not allowed to access this API method - `not_an_admin` -- This method is only accessible by org owners and admins - `restricted_action` -- The action is restricted for this team - `user_is_restricted` -- This method is only accessible by org owners, admins, and integration managers - `no_team_or_enterprise_provided` -- Must provide team ID or enterprise ID - `team_not_found` -- Returned when team id is not found. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id` - `invalid_scopes` -- One or more of the given scopes is not a recognized OAuth scope See https://docs.slack.dev/reference/methods/admin.apps.requests.list */ export const listAppsRequests: API.PaginatedOperationMethod< ListAppsRequestsRequest, ListAppsRequestsResponse, @@ -3577,9 +9295,24 @@ export const listAppsRequests: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(744, __c93, 0) as any as S.Schema, - output: __S(745, __c93, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(560, __c70, 0) as any as S.Schema, + output: __S(561, __c70, 1) as any as S.Schema, + errors: [ + AppManagementAppNotInstalledOnOrg, + EnterpriseNotFound, + FeatureNotEnabled, + InvalidCursor, + InvalidScopes, + NoTeamOrEnterpriseProvided, + NotAllowed, + NotAnAdmin, + RestrictedAction, + TeamNotFound, + TooManyTeamsProvided, + UserIsRestricted, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3595,8 +9328,18 @@ export const listAppsRequests: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListAppsRestrictedError = SlackOpError; -/** List restricted apps for an org or workspace. Required scopes -- user: `admin.apps:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_actor` -- The provided actor_id is not a valid user or application - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_allowed` -- The user is not allowed to access this API method - `not_an_admin` -- This method is only accessible by org/workspace owners and admins - `team_not_found` -- Returned when team id is not found. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id`. - `restricted_action` -- User does not have permission to access method See https://docs.slack.dev/reference/methods/admin.apps.restricted.list */ +export type ListAppsRestrictedError = + | AppManagementAppNotInstalledOnOrg + | FeatureNotEnabled + | InvalidActor + | InvalidCursor + | NotAllowed + | NotAnAdmin + | RestrictedAction + | TeamNotFound + | TooManyTeamsProvided + | SlackOpError; +/** List restricted apps for an org or workspace. Required scopes -- user: `admin.apps:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `app_management_app_not_installed_on_org` -- The app management app must be installed on the org. - `feature_not_enabled` -- Returned when the Admin APIs feature is not enabled for this team - `invalid_actor` -- The provided actor_id is not a valid user or application - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_allowed` -- The user is not allowed to access this API method - `not_an_admin` -- This method is only accessible by org/workspace owners and admins - `team_not_found` -- Returned when team id is not found. - `too_many_teams_provided` -- Please provide only `team_id` OR `enterprise_id`. - `restricted_action` -- User does not have permission to access method See https://docs.slack.dev/reference/methods/admin.apps.restricted.list */ export const listAppsRestricted: API.PaginatedOperationMethod< ListAppsRestrictedRequest, ListAppsRestrictedResponse, @@ -3605,9 +9348,21 @@ export const listAppsRestricted: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(752, __c94, 0) as any as S.Schema, - output: __S(753, __c94, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(568, __c71, 0) as any as S.Schema, + output: __S(569, __c71, 1) as any as S.Schema, + errors: [ + AppManagementAppNotInstalledOnOrg, + FeatureNotEnabled, + InvalidActor, + InvalidCursor, + NotAllowed, + NotAnAdmin, + RestrictedAction, + TeamNotFound, + TooManyTeamsProvided, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3623,8 +9378,15 @@ export const listAppsRestricted: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListAssignmentsError = SlackOpError; -/** Lists assignments for all roles across entities. Options to scope results by any combination of roles or entities Required scopes -- user: `admin.roles:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- This API is currently not enabled. - `invalid_actor` -- This API is only enabled for the Admins/Owners. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_cursor` -- The passed cursor was invalid. - `invalid_sort` -- Sort parameters are invalid. - `invalid_role_id` -- One or more role IDs could not be validated. See https://docs.slack.dev/reference/methods/admin.roles.listAssignments */ +export type ListAssignmentsError = + | FeatureNotEnabled + | InvalidActor + | InvalidArguments + | InvalidCursor + | InvalidRoleId + | InvalidSort + | SlackOpError; +/** Lists assignments for all roles across entities. Options to scope results by any combination of roles or entities Required scopes -- user: `admin.roles:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- This API is currently not enabled. - `invalid_actor` -- This API is only enabled for the Admins/Owners. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_cursor` -- The passed cursor was invalid. - `invalid_sort` -- Sort parameters are invalid. - `invalid_role_id` -- One or more role IDs could not be validated. See https://docs.slack.dev/reference/methods/admin.roles.listAssignments */ export const listAssignments: API.PaginatedOperationMethod< ListAssignmentsRequest, ListAssignmentsResponse, @@ -3633,9 +9395,18 @@ export const listAssignments: API.PaginatedOperationMethod< ListAssignmentsResponseRoleAssignmentsItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(760, __c95, 0) as any as S.Schema, - output: __S(763, __c95, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(576, __c72, 0) as any as S.Schema, + output: __S(579, __c72, 3) as any as S.Schema, + errors: [ + FeatureNotEnabled, + InvalidActor, + InvalidArguments, + InvalidCursor, + InvalidRoleId, + InvalidSort, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3651,8 +9422,8 @@ export const listAssignments: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListBarriersError = SlackOpError; -/** Get all Information Barriers for your organization Required scopes -- user: `admin.barriers:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- Feature not enabled - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_an_admin` -- The token provided is not associated with an org admin See https://docs.slack.dev/reference/methods/admin.barriers.list */ +export type ListBarriersError = FeatureNotEnabled | InvalidCursor | NotAnAdmin | SlackOpError; +/** Get all Information Barriers for your organization Required scopes -- user: `admin.barriers:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- Feature not enabled - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_an_admin` -- The token provided is not associated with an org admin See https://docs.slack.dev/reference/methods/admin.barriers.list */ export const listBarriers: API.PaginatedOperationMethod< ListBarriersRequest, ListBarriersResponse, @@ -3661,9 +9432,9 @@ export const listBarriers: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(776, __c97, 0) as any as S.Schema, - output: __S(777, __c97, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(584, __c73, 0) as any as S.Schema, + output: __S(585, __c73, 1) as any as S.Schema, + errors: [FeatureNotEnabled, InvalidCursor, NotAnAdmin, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3679,42 +9450,62 @@ export const listBarriers: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListChannelsError = SlackOpError; -/** List the channels linked to an org-level IDP group (user group). Required scopes -- user: `admin.usergroups:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this Enterprise organization. - `invalid_user` -- The calling user is not valid. - `not_allowed` -- The calling user is not an admin or does not have necessary role - `not_an_admin` -- The token provided is not associated with an Org Admin or Owner. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `team_not_found` -- The workspace was not found. - `usergroup_not_found` -- The IDP group provided was not found. - `usergroup_not_linked_to_team` -- The IDP group provided is not linked to the specified workspace. See https://docs.slack.dev/reference/methods/admin.usergroups.listChannels */ +export type ListChannelsError = + | FeatureNotEnabled + | InvalidUser + | NotAllowed + | NotAnAdmin + | NotAnEnterprise + | TeamNotFound + | UsergroupNotFound + | UsergroupNotLinkedToTeam + | SlackOpError; +/** List the channels linked to an org-level IDP group (user group). Required scopes -- user: `admin.usergroups:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this Enterprise organization. - `invalid_user` -- The calling user is not valid. - `not_allowed` -- The calling user is not an admin or does not have necessary role - `not_an_admin` -- The token provided is not associated with an Org Admin or Owner. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `team_not_found` -- The workspace was not found. - `usergroup_not_found` -- The IDP group provided was not found. - `usergroup_not_linked_to_team` -- The IDP group provided is not linked to the specified workspace. See https://docs.slack.dev/reference/methods/admin.usergroups.listChannels */ export const listChannels: API.OperationMethod< ListChannelsRequest, ListChannelsResponse, ListChannelsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(784, __c98, 0) as any as S.Schema, - output: __S(785, __c98, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(592, __c74, 0) as any as S.Schema, + output: __S(593, __c74, 1) as any as S.Schema, + errors: [ + FeatureNotEnabled, + InvalidUser, + NotAllowed, + NotAnAdmin, + NotAnEnterprise, + TeamNotFound, + UsergroupNotFound, + UsergroupNotLinkedToTeam, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListChannels", })); -export type ListEmojiError = SlackOpError; -/** List emoji for an Enterprise organization. Required scopes -- user: `admin.teams:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_an_admin` -- This method is only accessible by org owners and Admins. See https://docs.slack.dev/reference/methods/admin.emoji.list */ +export type ListEmojiError = FeatureNotEnabled | InvalidCursor | NotAnAdmin | SlackOpError; +/** List emoji for an Enterprise organization. Required scopes -- user: `admin.teams:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_an_admin` -- This method is only accessible by org owners and Admins. See https://docs.slack.dev/reference/methods/admin.emoji.list */ export const listEmoji: API.OperationMethod< ListEmojiRequest, ListEmojiResponse, ListEmojiError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(792, __c99, 0) as any as S.Schema, - output: __S(793, __c99, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(600, __c75, 0) as any as S.Schema, + output: __S(601, __c75, 1) as any as S.Schema, + errors: [FeatureNotEnabled, InvalidCursor, NotAnAdmin, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListEmoji", })); -export type ListFunctionsError = SlackOpError; -/** Look up functions by a set of apps. Required scopes -- user: `admin.workflows:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_allowed` -- The user is not allowed to access this API method. - `restricted_action` -- The user is not allowed to access this API method. See https://docs.slack.dev/reference/methods/admin.functions.list */ +export type ListFunctionsError = InvalidCursor | NotAllowed | RestrictedAction | SlackOpError; +/** Look up functions by a set of apps. Required scopes -- user: `admin.workflows:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_allowed` -- The user is not allowed to access this API method. - `restricted_action` -- The user is not allowed to access this API method. See https://docs.slack.dev/reference/methods/admin.functions.list */ export const listFunctions: API.PaginatedOperationMethod< ListFunctionsRequest, ListFunctionsResponse, @@ -3723,9 +9514,9 @@ export const listFunctions: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(808, __c101, 0) as any as S.Schema, - output: __S(809, __c101, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(616, __c77, 0) as any as S.Schema, + output: __S(617, __c77, 1) as any as S.Schema, + errors: [InvalidCursor, NotAllowed, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3741,25 +9532,44 @@ export const listFunctions: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListGroupsError = SlackOpError; -/** List all IDP Groups linked to a channel Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- `channel_id` wasn't found. - `feature_not_enabled` -- Feature not enabled - `invalid_auth` -- Token does not belong to enterprise or team id passed in not part of this enterprise - `invalid_channel` -- The requested channel couldn't be linked to an IDP group. It might be a public channel or an externally-shared channel. - `not_an_admin` -- This token doesn't belong to an Org Admin or Owner. - `team_not_found` -- `team_id` wasn't found. See https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.listGroups */ +export type ListGroupsError = + | ChannelNotFound + | FeatureNotEnabled + | InvalidChannel + | NotAnAdmin + | TeamNotFound + | SlackOpError; +/** List all IDP Groups linked to a channel Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- `channel_id` wasn't found. - `feature_not_enabled` -- Feature not enabled - `invalid_auth` -- Token does not belong to enterprise or team id passed in not part of this enterprise - `invalid_channel` -- The requested channel couldn't be linked to an IDP group. It might be a public channel or an externally-shared channel. - `not_an_admin` -- This token doesn't belong to an Org Admin or Owner. - `team_not_found` -- `team_id` wasn't found. See https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.listGroups */ export const listGroups: API.OperationMethod< ListGroupsRequest, ListGroupsResponse, ListGroupsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(816, __c102, 0) as any as S.Schema, - output: __S(817, __c102, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(624, __c78, 0) as any as S.Schema, + output: __S(625, __c78, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + FeatureNotEnabled, + InvalidChannel, + NotAnAdmin, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListGroups", })); -export type ListInviteRequestsError = SlackOpError; -/** List all pending workspace invite requests. Required scopes -- user: `admin.invites:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Invite Request Admin APIs feature is not enabled - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- This token doesn't have admin privileges. - `team_not_found` -- The `team_id` specified wasn't found. See https://docs.slack.dev/reference/methods/admin.inviteRequests.list */ +export type ListInviteRequestsError = + | FeatureNotEnabled + | MissingScope + | NotAnAdmin + | TeamNotFound + | SlackOpError; +/** List all pending workspace invite requests. Required scopes -- user: `admin.invites:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Invite Request Admin APIs feature is not enabled - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- This token doesn't have admin privileges. - `team_not_found` -- The `team_id` specified wasn't found. See https://docs.slack.dev/reference/methods/admin.inviteRequests.list */ export const listInviteRequests: API.PaginatedOperationMethod< ListInviteRequestsRequest, ListInviteRequestsResponse, @@ -3768,9 +9578,16 @@ export const listInviteRequests: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(824, __c103, 0) as any as S.Schema, - output: __S(825, __c103, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(632, __c79, 0) as any as S.Schema, + output: __S(633, __c79, 1) as any as S.Schema, + errors: [ + FeatureNotEnabled, + MissingScope, + NotAnAdmin, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3786,8 +9603,13 @@ export const listInviteRequests: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListInviteRequestsApprovedError = SlackOpError; -/** List all approved workspace invite requests. Required scopes -- user: `admin.invites:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Invite Requests admin APIs feature is not enabled - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- This token doesn't have admin privileges. - `team_not_found` -- The `team_id` specified wasn't found. See https://docs.slack.dev/reference/methods/admin.inviteRequests.approved.list */ +export type ListInviteRequestsApprovedError = + | FeatureNotEnabled + | MissingScope + | NotAnAdmin + | TeamNotFound + | SlackOpError; +/** List all approved workspace invite requests. Required scopes -- user: `admin.invites:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Invite Requests admin APIs feature is not enabled - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- This token doesn't have admin privileges. - `team_not_found` -- The `team_id` specified wasn't found. See https://docs.slack.dev/reference/methods/admin.inviteRequests.approved.list */ export const listInviteRequestsApproved: API.PaginatedOperationMethod< ListInviteRequestsApprovedRequest, ListInviteRequestsApprovedResponse, @@ -3796,9 +9618,16 @@ export const listInviteRequestsApproved: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(832, __c104, 0) as any as S.Schema, - output: __S(833, __c104, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(640, __c80, 0) as any as S.Schema, + output: __S(641, __c80, 1) as any as S.Schema, + errors: [ + FeatureNotEnabled, + MissingScope, + NotAnAdmin, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3814,8 +9643,13 @@ export const listInviteRequestsApproved: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListInviteRequestsDeniedError = SlackOpError; -/** List all denied workspace invite requests. Required scopes -- user: `admin.invites:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Invite Request admin APIs feature is not enabled - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- This token doesn't have admin privileges. - `team_not_found` -- The `team_id` specified wasn't found. See https://docs.slack.dev/reference/methods/admin.inviteRequests.denied.list */ +export type ListInviteRequestsDeniedError = + | FeatureNotEnabled + | MissingScope + | NotAnAdmin + | TeamNotFound + | SlackOpError; +/** List all denied workspace invite requests. Required scopes -- user: `admin.invites:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Invite Request admin APIs feature is not enabled - `missing_scope` -- This token doesn't have the scope required. - `not_an_admin` -- This token doesn't have admin privileges. - `team_not_found` -- The `team_id` specified wasn't found. See https://docs.slack.dev/reference/methods/admin.inviteRequests.denied.list */ export const listInviteRequestsDenied: API.PaginatedOperationMethod< ListInviteRequestsDeniedRequest, ListInviteRequestsDeniedResponse, @@ -3824,9 +9658,16 @@ export const listInviteRequestsDenied: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(840, __c105, 0) as any as S.Schema, - output: __S(841, __c105, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(648, __c81, 0) as any as S.Schema, + output: __S(649, __c81, 1) as any as S.Schema, + errors: [ + FeatureNotEnabled, + MissingScope, + NotAnAdmin, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3842,8 +9683,15 @@ export const listInviteRequestsDenied: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListOriginalConnectedChannelInfoError = SlackOpError; -/** List all disconnected channels--i.e., channels that were once connected to other workspaces and then disconnected--and the corresponding original channel IDs for key revocation with EKM. Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Invalid cursor. - `invalid_limit` -- The value passed for `limit` was not valid. - `not_an_admin` -- This method is only accessible by Org owners and Admins. - `not_enabled` -- The API endpoint is not enabled for your team. - `restricted_action` -- The caller of this API is not allowed to perform this operation. - `unsupported_arguments` -- The provided method arguments are not supported. See https://docs.slack.dev/reference/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo */ +export type ListOriginalConnectedChannelInfoError = + | InvalidCursor + | InvalidLimit + | NotAnAdmin + | NotEnabled + | RestrictedAction + | UnsupportedArguments + | SlackOpError; +/** List all disconnected channels--i.e., channels that were once connected to other workspaces and then disconnected--and the corresponding original channel IDs for key revocation with EKM. Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- Invalid cursor. - `invalid_limit` -- The value passed for `limit` was not valid. - `not_an_admin` -- This method is only accessible by Org owners and Admins. - `not_enabled` -- The API endpoint is not enabled for your team. - `restricted_action` -- The caller of this API is not allowed to perform this operation. - `unsupported_arguments` -- The provided method arguments are not supported. See https://docs.slack.dev/reference/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo */ export const listOriginalConnectedChannelInfo: API.PaginatedOperationMethod< ListOriginalConnectedChannelInfoRequest, ListOriginalConnectedChannelInfoResponse, @@ -3852,9 +9700,18 @@ export const listOriginalConnectedChannelInfo: API.PaginatedOperationMethod< ListOriginalConnectedChannelInfoResponseChannelsItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(848, __c106, 0) as any as S.Schema, - output: __S(851, __c106, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(656, __c82, 0) as any as S.Schema, + output: __S(659, __c82, 3) as any as S.Schema, + errors: [ + InvalidCursor, + InvalidLimit, + NotAnAdmin, + NotEnabled, + RestrictedAction, + UnsupportedArguments, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3870,8 +9727,13 @@ export const listOriginalConnectedChannelInfo: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListSlackbotSkillsError = SlackOpError; -/** Lists metadata for skills owned by the organization, including invite-only skills. Required scopes -- user: `admin.skills:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- The cursor is malformed or belongs to different filters, sorting, user, or organization. - `invalid_category` -- The category isn't one of the supported skill categories. - `feature_not_enabled` -- The Skills API isn't enabled for this organization or workspace. - `restricted_action` -- The caller must be an org admin or owner with permission to manage skills. - `internal_error` -- A lookup failed, so the page couldn't be built completely. Retry the request with the same cursor. See https://docs.slack.dev/reference/methods/admin.slackbot.skills.list */ +export type ListSlackbotSkillsError = + | FeatureNotEnabled + | InvalidCategory + | InvalidCursor + | RestrictedAction + | SlackOpError; +/** Lists metadata for skills owned by the organization, including invite-only skills. Required scopes -- user: `admin.skills:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- The cursor is malformed or belongs to different filters, sorting, user, or organization. - `invalid_category` -- The category isn't one of the supported skill categories. - `feature_not_enabled` -- The Skills API isn't enabled for this organization or workspace. - `restricted_action` -- The caller must be an org admin or owner with permission to manage skills. - `internal_error` -- A lookup failed, so the page couldn't be built completely. Retry the request with the same cursor. See https://docs.slack.dev/reference/methods/admin.slackbot.skills.list */ export const listSlackbotSkills: API.PaginatedOperationMethod< ListSlackbotSkillsRequest, ListSlackbotSkillsResponse, @@ -3880,9 +9742,16 @@ export const listSlackbotSkills: API.PaginatedOperationMethod< ListSlackbotSkillsResponseSkillsItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(856, __c107, 0) as any as S.Schema, - output: __S(860, __c107, 4) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(664, __c83, 0) as any as S.Schema, + output: __S(668, __c83, 4) as any as S.Schema, + errors: [ + FeatureNotEnabled, + InvalidCategory, + InvalidCursor, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3898,8 +9767,13 @@ export const listSlackbotSkills: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListTeamsError = SlackOpError; -/** List all teams in an Enterprise organization Required scopes -- user: `admin.teams:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_cursor` -- Invalid cursor. - `invalid_limit` -- Value passed for `limit` was not valid. - `not_an_admin` -- This method is only accessible by org owners and admins. See https://docs.slack.dev/reference/methods/admin.teams.list */ +export type ListTeamsError = + | FeatureNotEnabled + | InvalidCursor + | InvalidLimit + | NotAnAdmin + | SlackOpError; +/** List all teams in an Enterprise organization Required scopes -- user: `admin.teams:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_cursor` -- Invalid cursor. - `invalid_limit` -- Value passed for `limit` was not valid. - `not_an_admin` -- This method is only accessible by org owners and admins. See https://docs.slack.dev/reference/methods/admin.teams.list */ export const listTeams: API.PaginatedOperationMethod< ListTeamsRequest, ListTeamsResponse, @@ -3908,9 +9782,16 @@ export const listTeams: API.PaginatedOperationMethod< ListTeamsResponseTeamsItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(880, __c110, 0) as any as S.Schema, - output: __S(884, __c110, 4) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(672, __c84, 0) as any as S.Schema, + output: __S(676, __c84, 4) as any as S.Schema, + errors: [ + FeatureNotEnabled, + InvalidCursor, + InvalidLimit, + NotAnAdmin, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3926,8 +9807,14 @@ export const listTeams: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListTeamsAdminsError = SlackOpError; -/** List all of the admins on a given workspace. Required scopes -- user: `admin.teams:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_auth` -- The given token is not authorized for the requested `team_id`. - `invalid_cursor` -- Invalid cursor. - `invalid_limit` -- Limit must be between 1 and 1000 inclusive. - `not_an_admin` -- This method is only accessible by org owners and admins. - `team_not_found` -- `team_id` was not found. See https://docs.slack.dev/reference/methods/admin.teams.admins.list */ +export type ListTeamsAdminsError = + | FeatureNotEnabled + | InvalidCursor + | InvalidLimit + | NotAnAdmin + | TeamNotFound + | SlackOpError; +/** List all of the admins on a given workspace. Required scopes -- user: `admin.teams:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_auth` -- The given token is not authorized for the requested `team_id`. - `invalid_cursor` -- Invalid cursor. - `invalid_limit` -- Limit must be between 1 and 1000 inclusive. - `not_an_admin` -- This method is only accessible by org owners and admins. - `team_not_found` -- `team_id` was not found. See https://docs.slack.dev/reference/methods/admin.teams.admins.list */ export const listTeamsAdmins: API.PaginatedOperationMethod< ListTeamsAdminsRequest, ListTeamsAdminsResponse, @@ -3936,9 +9823,17 @@ export const listTeamsAdmins: API.PaginatedOperationMethod< string > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(888, __c111, 0) as any as S.Schema, - output: __S(889, __c111, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(680, __c85, 0) as any as S.Schema, + output: __S(681, __c85, 1) as any as S.Schema, + errors: [ + FeatureNotEnabled, + InvalidCursor, + InvalidLimit, + NotAnAdmin, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3954,8 +9849,13 @@ export const listTeamsAdmins: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListTeamsOwnersError = SlackOpError; -/** List all of the owners on a given workspace. Required scopes -- user: `admin.teams:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_auth` -- The given token is not authorized for the requested team. - `invalid_cursor` -- Invalid cursor. - `not_an_admin` -- This method is only accessible by org owners and admins. - `team_not_found` -- `team_id was not found. See https://docs.slack.dev/reference/methods/admin.teams.owners.list */ +export type ListTeamsOwnersError = + | FeatureNotEnabled + | InvalidCursor + | NotAnAdmin + | TeamNotFound + | SlackOpError; +/** List all of the owners on a given workspace. Required scopes -- user: `admin.teams:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_auth` -- The given token is not authorized for the requested team. - `invalid_cursor` -- Invalid cursor. - `not_an_admin` -- This method is only accessible by org owners and admins. - `team_not_found` -- `team_id was not found. See https://docs.slack.dev/reference/methods/admin.teams.owners.list */ export const listTeamsOwners: API.PaginatedOperationMethod< ListTeamsOwnersRequest, ListTeamsOwnersResponse, @@ -3964,9 +9864,16 @@ export const listTeamsOwners: API.PaginatedOperationMethod< string > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(896, __c112, 0) as any as S.Schema, - output: __S(897, __c112, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(688, __c86, 0) as any as S.Schema, + output: __S(689, __c86, 1) as any as S.Schema, + errors: [ + FeatureNotEnabled, + InvalidCursor, + NotAnAdmin, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -3982,8 +9889,14 @@ export const listTeamsOwners: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListUsersError = SlackOpError; -/** List users on a workspace Required scopes -- user: `admin.users:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_arguments` -- The passed arguments were invalid. - `invalid_auth` -- This request could not be authorized. - `invalid_cursor` -- The passed cursor could not be validated. - `team_not_found` -- `team_id` was not found. - `include_deactivated_user_workspaces_invalid` -- `include_deactivated_user_workspaces` only applies with org token and no team_id. See https://docs.slack.dev/reference/methods/admin.users.list */ +export type ListUsersError = + | FeatureNotEnabled + | IncludeDeactivatedUserWorkspacesInvalid + | InvalidArguments + | InvalidCursor + | TeamNotFound + | SlackOpError; +/** List users on a workspace Required scopes -- user: `admin.users:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_arguments` -- The passed arguments were invalid. - `invalid_auth` -- This request could not be authorized. - `invalid_cursor` -- The passed cursor could not be validated. - `team_not_found` -- `team_id` was not found. - `include_deactivated_user_workspaces_invalid` -- `include_deactivated_user_workspaces` only applies with org token and no team_id. See https://docs.slack.dev/reference/methods/admin.users.list */ export const listUsers: API.PaginatedOperationMethod< ListUsersRequest, ListUsersResponse, @@ -3992,9 +9905,17 @@ export const listUsers: API.PaginatedOperationMethod< ListUsersResponseUsersItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(904, __c113, 0) as any as S.Schema, - output: __S(907, __c113, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(696, __c87, 0) as any as S.Schema, + output: __S(699, __c87, 3) as any as S.Schema, + errors: [ + FeatureNotEnabled, + IncludeDeactivatedUserWorkspacesInvalid, + InvalidArguments, + InvalidCursor, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -4010,8 +9931,20 @@ export const listUsers: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListUsersSessionError = SlackOpError; -/** List active user sessions for an organization Required scopes -- user: `admin.users:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `admin_unauthorized` -- The owner of this token isn't authorized to list sessions. - `bots_not_allowed` -- Bot sessions are not listed by this method. - `feature_not_enabled` -- This method is only available to Enterprise customers. - `invalid_auth` -- The provided token doesn't have access to this endpoint. - `invalid_cursor` -- The cursor passed was invalid. - `no_active_sessions` -- No active sessions were found. - `not_an_admin` -- The owner of this token isn't an Org Owner or Admin. - `missing_team` -- A `team_id` must be provided with a `user_id`. - `missing_user` -- A `user_id` must be provided with a `team_id`. - `team_not_found` -- There was an error finding the requested workspace. - `unknown_method` -- This method is currently not available. - `user_not_found` -- There was an error finding the requested user. See https://docs.slack.dev/reference/methods/admin.users.session.list */ +export type ListUsersSessionError = + | AdminUnauthorized + | BotsNotAllowed + | FeatureNotEnabled + | InvalidCursor + | MissingTeam + | MissingUser + | NoActiveSessions + | NotAnAdmin + | TeamNotFound + | UnknownMethod + | UserNotFound + | SlackOpError; +/** List active user sessions for an organization Required scopes -- user: `admin.users:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `admin_unauthorized` -- The owner of this token isn't authorized to list sessions. - `bots_not_allowed` -- Bot sessions are not listed by this method. - `feature_not_enabled` -- This method is only available to Enterprise customers. - `invalid_auth` -- The provided token doesn't have access to this endpoint. - `invalid_cursor` -- The cursor passed was invalid. - `no_active_sessions` -- No active sessions were found. - `not_an_admin` -- The owner of this token isn't an Org Owner or Admin. - `missing_team` -- A `team_id` must be provided with a `user_id`. - `missing_user` -- A `user_id` must be provided with a `team_id`. - `team_not_found` -- There was an error finding the requested workspace. - `unknown_method` -- This method is currently not available. - `user_not_found` -- There was an error finding the requested user. See https://docs.slack.dev/reference/methods/admin.users.session.list */ export const listUsersSession: API.PaginatedOperationMethod< ListUsersSessionRequest, ListUsersSessionResponse, @@ -4020,9 +9953,23 @@ export const listUsersSession: API.PaginatedOperationMethod< ListUsersSessionResponseActiveSessionsItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(912, __c114, 0) as any as S.Schema, - output: __S(916, __c114, 4) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(704, __c88, 0) as any as S.Schema, + output: __S(708, __c88, 4) as any as S.Schema, + errors: [ + AdminUnauthorized, + BotsNotAllowed, + FeatureNotEnabled, + InvalidCursor, + MissingTeam, + MissingUser, + NoActiveSessions, + NotAnAdmin, + TeamNotFound, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -4038,25 +9985,29 @@ export const listUsersSession: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type LookupAppsConfigError = SlackOpError; -/** Look up the app config for connectors by their IDs Required scopes -- user: `admin.apps:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_args` -- Either app_ids or rich_link_preview_types must be provided See https://docs.slack.dev/reference/methods/admin.apps.config.lookup */ +export type LookupAppsConfigError = MissingArgs | SlackOpError; +/** Look up the app config for connectors by their IDs Required scopes -- user: `admin.apps:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `missing_args` -- Either app_ids or rich_link_preview_types must be provided See https://docs.slack.dev/reference/methods/admin.apps.config.lookup */ export const lookupAppsConfig: API.OperationMethod< LookupAppsConfigRequest, LookupAppsConfigResponse, LookupAppsConfigError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(920, __c115, 0) as any as S.Schema, - output: __S(923, __c115, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(712, __c89, 0) as any as S.Schema, + output: __S(715, __c89, 3) as any as S.Schema, + errors: [MissingArgs, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "LookupAppsConfig", })); -export type LookupConversationError = SlackOpError; -/** Returns channels on the given team using the filters. Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `feature_not_enabled` -- The feature is not enabled - `no_valid_teams` -- The team_ids argument doesn't contain any valid teams - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. See https://docs.slack.dev/reference/methods/admin.conversations.lookup */ +export type LookupConversationError = + | FeatureNotEnabled + | InvalidCursor + | NoValidTeams + | SlackOpError; +/** Returns channels on the given team using the filters. Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `internal_error` -- Something unexpected happened, try again in a little bit. Sorry for that! - `feature_not_enabled` -- The feature is not enabled - `no_valid_teams` -- The team_ids argument doesn't contain any valid teams - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. See https://docs.slack.dev/reference/methods/admin.conversations.lookup */ export const lookupConversation: API.PaginatedOperationMethod< LookupConversationRequest, LookupConversationResponse, @@ -4065,9 +10016,9 @@ export const lookupConversation: API.PaginatedOperationMethod< string > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(928, __c116, 0) as any as S.Schema, - output: __S(929, __c116, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(720, __c90, 0) as any as S.Schema, + output: __S(721, __c90, 1) as any as S.Schema, + errors: [FeatureNotEnabled, InvalidCursor, NoValidTeams, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -4083,17 +10034,17 @@ export const lookupConversation: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type LookupFunctionsPermissionsError = SlackOpError; -/** Lookup the visibility of multiple Slack functions and include the users if it is limited to particular named entities. Required scopes -- user: `admin.workflows:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- This actor does not have access to the permissions on this resource. - `restricted_action` -- User does not have access to this API. See https://docs.slack.dev/reference/methods/admin.functions.permissions.lookup */ +export type LookupFunctionsPermissionsError = AccessDenied | RestrictedAction | SlackOpError; +/** Lookup the visibility of multiple Slack functions and include the users if it is limited to particular named entities. Required scopes -- user: `admin.workflows:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `access_denied` -- This actor does not have access to the permissions on this resource. - `restricted_action` -- User does not have access to this API. See https://docs.slack.dev/reference/methods/admin.functions.permissions.lookup */ export const lookupFunctionsPermissions: API.OperationMethod< LookupFunctionsPermissionsRequest, LookupFunctionsPermissionsResponse, LookupFunctionsPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(936, __c117, 0) as any as S.Schema, - output: __S(937, __c117, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(728, __c91, 0) as any as S.Schema, + output: __S(729, __c91, 1) as any as S.Schema, + errors: [AccessDenied, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -4108,8 +10059,8 @@ export const lookupWorkflowsPermissions: API.OperationMethod< LookupWorkflowsPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(944, __c118, 0) as any as S.Schema, - output: __S(945, __c118, 1) as any as S.Schema, + input: __S(736, __c92, 0) as any as S.Schema, + output: __S(737, __c92, 1) as any as S.Schema, errors: [SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, @@ -4117,331 +10068,664 @@ export const lookupWorkflowsPermissions: API.OperationMethod< span: "LookupWorkflowsPermissions", })); -export type LookupWorkflowsTriggersTypesPermissionsError = SlackOpError; -/** List the permissions for using each trigger type. Required scopes -- user: `client` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `restricted_action` -- This actor does not have access to view the permissions on this resource - `trigger_type_id_not_found` -- The given trigger type ID(s) do not map to valid trigger types See https://docs.slack.dev/reference/methods/admin.workflows.triggers.types.permissions.lookup */ +export type LookupWorkflowsTriggersTypesPermissionsError = + | RestrictedAction + | TriggerTypeIdNotFound + | SlackOpError; +/** List the permissions for using each trigger type. Required scopes -- user: `client` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `restricted_action` -- This actor does not have access to view the permissions on this resource - `trigger_type_id_not_found` -- The given trigger type ID(s) do not map to valid trigger types See https://docs.slack.dev/reference/methods/admin.workflows.triggers.types.permissions.lookup */ export const lookupWorkflowsTriggersTypesPermissions: API.OperationMethod< LookupWorkflowsTriggersTypesPermissionsRequest, LookupWorkflowsTriggersTypesPermissionsResponse, LookupWorkflowsTriggersTypesPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(952, __c119, 0) as any as S.Schema, - output: __S(953, __c119, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(744, __c93, 0) as any as S.Schema, + output: __S(745, __c93, 1) as any as S.Schema, + errors: [RestrictedAction, TriggerTypeIdNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "LookupWorkflowsTriggersTypesPermissions", })); -export type PauseUsersAccessError = SlackOpError; -/** Pause access across the organization for up to 1,000 frontline members. Success means the request was queued, not that all updates have completed. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `restricted_action` -- Only organization admins and owners can perform this action. - `feature_not_enabled` -- Frontline access management is not enabled for this organization. - `failed_job_enqueue` -- The access change could not be queued. Retry the request. - `failed_for_all_users` -- No valid users were found. Nothing was queued. invalid_users lists the rejected IDs and reasons. - `failed_for_some_users` -- Valid users were queued, but some users were rejected. invalid_users lists the rejected IDs and reasons. Correct and retry only those IDs. See https://docs.slack.dev/reference/methods/admin.users.access.pause */ +export type PauseUsersAccessError = + | FailedForAllUsers + | FailedForSomeUsers + | FailedJobEnqueue + | FeatureNotEnabled + | RestrictedAction + | SlackOpError; +/** Pause access across the organization for up to 1,000 frontline members. Success means the request was queued, not that all updates have completed. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `restricted_action` -- Only organization admins and owners can perform this action. - `feature_not_enabled` -- Frontline access management is not enabled for this organization. - `failed_job_enqueue` -- The access change could not be queued. Retry the request. - `failed_for_all_users` -- No valid users were found. Nothing was queued. invalid_users lists the rejected IDs and reasons. - `failed_for_some_users` -- Valid users were queued, but some users were rejected. invalid_users lists the rejected IDs and reasons. Correct and retry only those IDs. See https://docs.slack.dev/reference/methods/admin.users.access.pause */ export const pauseUsersAccess: API.OperationMethod< PauseUsersAccessRequest, PauseUsersAccessResponse, PauseUsersAccessError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(968, __c121, 0) as any as S.Schema, - output: __S(976, __c122, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(752, __c94, 0) as any as S.Schema, + output: __S(760, __c95, 0) as any as S.Schema, + errors: [ + FailedForAllUsers, + FailedForSomeUsers, + FailedJobEnqueue, + FeatureNotEnabled, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PauseUsersAccess", })); -export type PublishSlackbotSkillError = SlackOpError; -/** Publishes Slackbot skills to an organization's catalog. Required scopes -- user: `admin.skills:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Skills API is not enabled for this organization or workspace. - `restricted_action` -- The caller must be an org admin or owner with permission to manage skills, and must be able to edit and share any canvas that needs org-wide access. - `internal_error` -- The operation could not be completed. Retry the request. - `failed_for_some_skills` -- Some skills failed. `failed_skills` lists each distinct failed skill ID and its error: `skill_not_found`, `method_not_supported_for_skill_type`, `restricted_action`, or `internal_error`. Missing, deleted, non-skill, and other organizations' files all return `skill_not_found`. See https://docs.slack.dev/reference/methods/admin.slackbot.skills.publish */ +export type PublishSlackbotSkillError = + | FailedForSomeSkills + | FeatureNotEnabled + | RestrictedAction + | SlackOpError; +/** Publishes Slackbot skills to an organization's catalog. Required scopes -- user: `admin.skills:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Skills API is not enabled for this organization or workspace. - `restricted_action` -- The caller must be an org admin or owner with permission to manage skills, and must be able to edit and share any canvas that needs org-wide access. - `internal_error` -- The operation could not be completed. Retry the request. - `failed_for_some_skills` -- Some skills failed. `failed_skills` lists each distinct failed skill ID and its error: `skill_not_found`, `method_not_supported_for_skill_type`, `restricted_action`, or `internal_error`. Missing, deleted, non-skill, and other organizations' files all return `skill_not_found`. See https://docs.slack.dev/reference/methods/admin.slackbot.skills.publish */ export const publishSlackbotSkill: API.OperationMethod< PublishSlackbotSkillRequest, PublishSlackbotSkillResponse, PublishSlackbotSkillError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(984, __c123, 0) as any as S.Schema, + input: __S(768, __c96, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [FailedForSomeSkills, FeatureNotEnabled, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PublishSlackbotSkill", })); -export type RemoveAppsPermissionsError = SlackOpError; -/** Revoke an entity's access to an app that has its permission type set to named_entities Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_auth` -- Invalid authorization token - `access_denied` -- This actor does not have access to the permissions on this resource. - `named_entities_cannot_be_empty` -- There must be at least one valid named entity - `app_not_found` -- This app does not exist. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `invalid_permission_type` -- This app requires permission_type to be set as named_entities before removing users. - `too_many_named_entities` -- Too many named entities passed into the app permissions setting. - `app_acl_not_found` -- This app does not have an ACL. - `internal_error` -- Internal error - `user_not_found` -- Value passed for `user_ids` was invalid. - `invalid_channel_restriction_mode` -- Cannot remove channels when channel_restriction_mode is all_channels. - `channel_not_found` -- One or more channel IDs are not valid. - `failed_to_update_channels` -- An error occurred while updating the channel restriction list. - `restricted_action` -- User does not have permission to perform this action. - `app_acl_write_failed` -- A transient database error (e.g. a deadlock) prevented the permission change from being saved. No change was applied; retry the request. See https://docs.slack.dev/reference/methods/admin.apps.permissions.remove */ +export type RemoveAppsPermissionsError = + | AccessDenied + | AppAclNotFound + | AppAclWriteFailed + | AppNotFound + | ChannelNotFound + | FailedToUpdateChannels + | InvalidChannelRestrictionMode + | InvalidPermissionType + | NamedEntitiesCannotBeEmpty + | NotAnEnterprise + | RestrictedAction + | TooManyNamedEntities + | UserNotFound + | SlackOpError; +/** Revoke an entity's access to an app that has its permission type set to named_entities Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_auth` -- Invalid authorization token - `access_denied` -- This actor does not have access to the permissions on this resource. - `named_entities_cannot_be_empty` -- There must be at least one valid named entity - `app_not_found` -- This app does not exist. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `invalid_permission_type` -- This app requires permission_type to be set as named_entities before removing users. - `too_many_named_entities` -- Too many named entities passed into the app permissions setting. - `app_acl_not_found` -- This app does not have an ACL. - `internal_error` -- Internal error - `user_not_found` -- Value passed for `user_ids` was invalid. - `invalid_channel_restriction_mode` -- Cannot remove channels when channel_restriction_mode is all_channels. - `channel_not_found` -- One or more channel IDs are not valid. - `failed_to_update_channels` -- An error occurred while updating the channel restriction list. - `restricted_action` -- User does not have permission to perform this action. - `app_acl_write_failed` -- A transient database error (e.g. a deadlock) prevented the permission change from being saved. No change was applied; retry the request. See https://docs.slack.dev/reference/methods/admin.apps.permissions.remove */ export const removeAppsPermissions: API.OperationMethod< RemoveAppsPermissionsRequest, RemoveAppsPermissionsResponse, RemoveAppsPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(992, __c124, 0) as any as S.Schema, + input: __S(776, __c97, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppAclNotFound, + AppAclWriteFailed, + AppNotFound, + ChannelNotFound, + FailedToUpdateChannels, + InvalidChannelRestrictionMode, + InvalidPermissionType, + NamedEntitiesCannotBeEmpty, + NotAnEnterprise, + RestrictedAction, + TooManyNamedEntities, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveAppsPermissions", })); -export type RemoveAssignmentsError = SlackOpError; -/** Removes a set of users from a role for the given scopes and entities Required scopes -- user: `admin.roles:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `failed_for_some_entities` -- At least one role scope ID was invalid - `failed_for_some_users` -- At least one user ID was invalid - `failed_for_some_users_and_entities` -- At least one role scope ID was invalid - `feature_not_enabled` -- This API is currently not enabled. - `invalid_actor` -- This API is only enabled for the Admins/Owners. - `invalid_role_id` -- The role type passed does not exist. - `no_valid_entities` -- None of the entities passed were valid. - `no_valid_users` -- None of the users passed were valid. - `too_many_entities` -- More than 10 role scopes were passed. - `too_many_users` -- More than 10 users were passed. - `cannot_modify_role_admin` -- The user does not have permission to modify the admin role. See https://docs.slack.dev/reference/methods/admin.roles.removeAssignments */ +export type RemoveAssignmentsError = + | CannotModifyRoleAdmin + | FailedForSomeEntities + | FailedForSomeUsers + | FailedForSomeUsersAndEntities + | FeatureNotEnabled + | InvalidActor + | InvalidRoleId + | NoValidEntities + | NoValidUsers + | TooManyEntities + | TooManyUsers + | SlackOpError; +/** Removes a set of users from a role for the given scopes and entities Required scopes -- user: `admin.roles:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `failed_for_some_entities` -- At least one role scope ID was invalid - `failed_for_some_users` -- At least one user ID was invalid - `failed_for_some_users_and_entities` -- At least one role scope ID was invalid - `feature_not_enabled` -- This API is currently not enabled. - `invalid_actor` -- This API is only enabled for the Admins/Owners. - `invalid_role_id` -- The role type passed does not exist. - `no_valid_entities` -- None of the entities passed were valid. - `no_valid_users` -- None of the users passed were valid. - `too_many_entities` -- More than 10 role scopes were passed. - `too_many_users` -- More than 10 users were passed. - `cannot_modify_role_admin` -- The user does not have permission to modify the admin role. See https://docs.slack.dev/reference/methods/admin.roles.removeAssignments */ export const removeAssignments: API.OperationMethod< RemoveAssignmentsRequest, RemoveAssignmentsResponse, RemoveAssignmentsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1000, __c125, 0) as any as S.Schema, - output: __S(376, __c47, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(784, __c98, 0) as any as S.Schema, + output: __S(40, __c5, 0) as any as S.Schema, + errors: [ + CannotModifyRoleAdmin, + FailedForSomeEntities, + FailedForSomeUsers, + FailedForSomeUsersAndEntities, + FeatureNotEnabled, + InvalidActor, + InvalidRoleId, + NoValidEntities, + NoValidUsers, + TooManyEntities, + TooManyUsers, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveAssignments", })); -export type RemoveChannelsError = SlackOpError; -/** Remove one or more default channels from an org-level IDP group (user group). Required scopes -- user: `admin.usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- At least one of the provided channel IDs could not be found, or one of those channels has a type that is not supported. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this Enterprise organization. - `invalid_channels_limit` -- The number of channel IDs passed in is larger than 100. - `not_an_admin` -- The calling user cannot update the specified usergroup. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `usergroup_not_found` -- The IDP group provided was not found. - `internal_error` -- There was an internal error processing this request--please retry. See https://docs.slack.dev/reference/methods/admin.usergroups.removeChannels */ +export type RemoveChannelsError = + | ChannelNotFound + | FeatureNotEnabled + | InvalidChannelsLimit + | NotAnAdmin + | NotAnEnterprise + | UsergroupNotFound + | SlackOpError; +/** Remove one or more default channels from an org-level IDP group (user group). Required scopes -- user: `admin.usergroups:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- At least one of the provided channel IDs could not be found, or one of those channels has a type that is not supported. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this Enterprise organization. - `invalid_channels_limit` -- The number of channel IDs passed in is larger than 100. - `not_an_admin` -- The calling user cannot update the specified usergroup. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `usergroup_not_found` -- The IDP group provided was not found. - `internal_error` -- There was an internal error processing this request--please retry. See https://docs.slack.dev/reference/methods/admin.usergroups.removeChannels */ export const removeChannels: API.OperationMethod< RemoveChannelsRequest, RemoveChannelsResponse, RemoveChannelsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1008, __c126, 0) as any as S.Schema, - output: __S(488, __c61, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(792, __c99, 0) as any as S.Schema, + output: __S(56, __c7, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + FeatureNotEnabled, + InvalidChannelsLimit, + NotAnAdmin, + NotAnEnterprise, + UsergroupNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveChannels", })); -export type RemoveCustomRetentionError = SlackOpError; -/** This API endpoint can be used by any admin to remove a conversation's retention policy. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value given for `channel_id` was invalid. - `channel_type_not_supported` -- Value given for `channel_id` was a #general channel. - `could_not_remove_retention` -- The retention policy could not be removed. - `default_org_wide_channel` -- The channel given is a default org-wide channel. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `not_an_admin` -- The token provided is not associated with an admin. - `restricted_action` -- A team preference prevents the authenticated user from modifying the retention policy of this channel. - `retention_override_not_allowed` -- The current retention policy disallows modifying the retention policy of this channel. - `not_supported` -- This type of channel isn't supported by this method. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated. See https://docs.slack.dev/reference/methods/admin.conversations.removeCustomRetention */ +export type RemoveCustomRetentionError = + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotRemoveRetention + | DefaultOrgWideChannel + | ExternalChannelMigrating + | FeatureNotEnabled + | NotAnAdmin + | NotSupported + | RestrictedAction + | RetentionOverrideNotAllowed + | SlackOpError; +/** This API endpoint can be used by any admin to remove a conversation's retention policy. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value given for `channel_id` was invalid. - `channel_type_not_supported` -- Value given for `channel_id` was a #general channel. - `could_not_remove_retention` -- The retention policy could not be removed. - `default_org_wide_channel` -- The channel given is a default org-wide channel. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `not_an_admin` -- The token provided is not associated with an admin. - `restricted_action` -- A team preference prevents the authenticated user from modifying the retention policy of this channel. - `retention_override_not_allowed` -- The current retention policy disallows modifying the retention policy of this channel. - `not_supported` -- This type of channel isn't supported by this method. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated. See https://docs.slack.dev/reference/methods/admin.conversations.removeCustomRetention */ export const removeCustomRetention: API.OperationMethod< RemoveCustomRetentionRequest, RemoveCustomRetentionResponse, RemoveCustomRetentionError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1016, __c127, 0) as any as S.Schema, + input: __S(800, __c100, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotRemoveRetention, + DefaultOrgWideChannel, + ExternalChannelMigrating, + FeatureNotEnabled, + NotAnAdmin, + NotSupported, + RestrictedAction, + RetentionOverrideNotAllowed, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveCustomRetention", })); -export type RemoveEmojiError = SlackOpError; -/** Remove an emoji across an Enterprise organization Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `emoji_not_found` -- Value passed for `name` was invalid. - `failed_to_remove_emoji` -- Failed to remove the specified emoji. - `failure_removing_emoji` -- This emoji could not be removed. It might be part of the standard Unicode set or the default Slack package. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `not_an_admin` -- This method is only accessible by org owners and Admins. See https://docs.slack.dev/reference/methods/admin.emoji.remove */ +export type RemoveEmojiError = + | EmojiNotFound + | FailedToRemoveEmoji + | FailureRemovingEmoji + | FeatureNotEnabled + | NotAnAdmin + | SlackOpError; +/** Remove an emoji across an Enterprise organization Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `emoji_not_found` -- Value passed for `name` was invalid. - `failed_to_remove_emoji` -- Failed to remove the specified emoji. - `failure_removing_emoji` -- This emoji could not be removed. It might be part of the standard Unicode set or the default Slack package. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `not_an_admin` -- This method is only accessible by org owners and Admins. See https://docs.slack.dev/reference/methods/admin.emoji.remove */ export const removeEmoji: API.OperationMethod< RemoveEmojiRequest, RemoveEmojiResponse, RemoveEmojiError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1024, __c128, 0) as any as S.Schema, + input: __S(808, __c101, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + EmojiNotFound, + FailedToRemoveEmoji, + FailureRemovingEmoji, + FeatureNotEnabled, + NotAnAdmin, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveEmoji", })); -export type RemoveEntitiesError = SlackOpError; -/** Remove specified entities from a specified authentication policy. Required scopes -- user: `admin.users:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `entity_not_found` -- At least one `entity_id` was not found - `feature_not_enabled` -- This method is only available to Enterprise customers. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The provided token doesn't have access to this endpoint. - `not_an_admin` -- This method is only accessible by Org Owners and Admins. - `policy_not_found` -- The `policy_name` could not be found. - `ratelimited` -- The rate limit for this endpoint has been reached. See https://docs.slack.dev/reference/methods/admin.auth.policy.removeEntities */ +export type RemoveEntitiesError = + | EntityNotFound + | FeatureNotEnabled + | InvalidArguments + | NotAnAdmin + | PolicyNotFound + | SlackOpError; +/** Remove specified entities from a specified authentication policy. Required scopes -- user: `admin.users:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `entity_not_found` -- At least one `entity_id` was not found - `feature_not_enabled` -- This method is only available to Enterprise customers. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The provided token doesn't have access to this endpoint. - `not_an_admin` -- This method is only accessible by Org Owners and Admins. - `policy_not_found` -- The `policy_name` could not be found. - `ratelimited` -- The rate limit for this endpoint has been reached. See https://docs.slack.dev/reference/methods/admin.auth.policy.removeEntities */ export const removeEntities: API.OperationMethod< RemoveEntitiesRequest, RemoveEntitiesResponse, RemoveEntitiesError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1032, __c129, 0) as any as S.Schema, - output: __S(312, __c39, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(816, __c102, 0) as any as S.Schema, + output: __S(176, __c22, 0) as any as S.Schema, + errors: [ + EntityNotFound, + FeatureNotEnabled, + InvalidArguments, + NotAnAdmin, + PolicyNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveEntities", })); -export type RemoveGroupError = SlackOpError; -/** Remove a linked IDP group linked from a private channel Required scopes -- user: `admin.conversations:write` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- `channel_id` can't be found. - `failed_to_remove_group_users` -- Returned when could not remove the users in the channel of the group being removed - `failed_to_unlink_channel` -- Removing the link in the database failed. Please retry. - `feature_not_enabled` -- Feature not enabled - `group_not_found` -- `group_id` can't be found. - `invalid_auth` -- Token does not belong to enterprise or team id passed in not part of this enterprise - `invalid_channel` -- The channel could not be linked to an IDP group (i.e., it's a public channel or external shared channel). - `link_not_found` -- There was no link found between the specified channel and the IDP group. - `not_an_admin` -- This token does not belong to an Org Admin or Owner. - `team_not_found` -- `team_id` can't be found. - `unable_to_unlink_idp_group_and_channel` -- The IDP group and channel cannot be unlinked. See https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.removeGroup */ +export type RemoveGroupError = + | ChannelNotFound + | FailedToRemoveGroupUsers + | FailedToUnlinkChannel + | FeatureNotEnabled + | GroupNotFound + | InvalidChannel + | LinkNotFound + | NotAnAdmin + | TeamNotFound + | UnableToUnlinkIdpGroupAndChannel + | SlackOpError; +/** Remove a linked IDP group linked from a private channel Required scopes -- user: `admin.conversations:write` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- `channel_id` can't be found. - `failed_to_remove_group_users` -- Returned when could not remove the users in the channel of the group being removed - `failed_to_unlink_channel` -- Removing the link in the database failed. Please retry. - `feature_not_enabled` -- Feature not enabled - `group_not_found` -- `group_id` can't be found. - `invalid_auth` -- Token does not belong to enterprise or team id passed in not part of this enterprise - `invalid_channel` -- The channel could not be linked to an IDP group (i.e., it's a public channel or external shared channel). - `link_not_found` -- There was no link found between the specified channel and the IDP group. - `not_an_admin` -- This token does not belong to an Org Admin or Owner. - `team_not_found` -- `team_id` can't be found. - `unable_to_unlink_idp_group_and_channel` -- The IDP group and channel cannot be unlinked. See https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.removeGroup */ export const removeGroup: API.OperationMethod< RemoveGroupRequest, RemoveGroupResponse, RemoveGroupError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1040, __c130, 0) as any as S.Schema, + input: __S(824, __c103, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + FailedToRemoveGroupUsers, + FailedToUnlinkChannel, + FeatureNotEnabled, + GroupNotFound, + InvalidChannel, + LinkNotFound, + NotAnAdmin, + TeamNotFound, + UnableToUnlinkIdpGroupAndChannel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveGroup", })); -export type RemoveTeamsError = SlackOpError; -/** Remove one or more default workspaces from an organization-wide IDP Group or Admin Group. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- An unexpected error occurred. - `invalid_team_ids` -- One or more team IDs provided were invalid; see the `errors` field in the response for the list of invalid team IDs. - `no_team_ids_given` -- The `team_ids` parameter was empty. - `usergroup_not_found` -- `usergroup_id` wasn't found. - `restricted_action` -- The calling user cannot update the specified usergroup. See https://docs.slack.dev/reference/methods/admin.usergroups.removeTeams */ +export type RemoveTeamsError = + | InvalidTeamIds + | NoTeamIdsGiven + | RestrictedAction + | UsergroupNotFound + | SlackOpError; +/** Remove one or more default workspaces from an organization-wide IDP Group or Admin Group. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `internal_error` -- An unexpected error occurred. - `invalid_team_ids` -- One or more team IDs provided were invalid; see the `errors` field in the response for the list of invalid team IDs. - `no_team_ids_given` -- The `team_ids` parameter was empty. - `usergroup_not_found` -- `usergroup_id` wasn't found. - `restricted_action` -- The calling user cannot update the specified usergroup. See https://docs.slack.dev/reference/methods/admin.usergroups.removeTeams */ export const removeTeams: API.OperationMethod< RemoveTeamsRequest, RemoveTeamsResponse, RemoveTeamsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1048, __c131, 0) as any as S.Schema, + input: __S(832, __c104, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + InvalidTeamIds, + NoTeamIdsGiven, + RestrictedAction, + UsergroupNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveTeams", })); -export type RemoveUserError = SlackOpError; -/** Remove a user from a workspace. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_modify_primary_owner` -- The primary owner cannot be modified. - `failed_to_remove_user_from_workspace` -- Removing this user from the workspace failed. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_auth` -- The request could not be authorized - `invalid_permissions` -- This method is only accessible by org owners and admins. - `team_not_found` -- `team_id` was not found. - `user_already_deleted` -- The requested user has already been marked as deleted. - `user_not_found` -- The user was not found. See https://docs.slack.dev/reference/methods/admin.users.remove */ +export type RemoveUserError = + | CannotModifyPrimaryOwner + | FailedToRemoveUserFromWorkspace + | FeatureNotEnabled + | InvalidPermissions + | TeamNotFound + | UserAlreadyDeleted + | UserNotFound + | SlackOpError; +/** Remove a user from a workspace. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_modify_primary_owner` -- The primary owner cannot be modified. - `failed_to_remove_user_from_workspace` -- Removing this user from the workspace failed. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_auth` -- The request could not be authorized - `invalid_permissions` -- This method is only accessible by org owners and admins. - `team_not_found` -- `team_id` was not found. - `user_already_deleted` -- The requested user has already been marked as deleted. - `user_not_found` -- The user was not found. See https://docs.slack.dev/reference/methods/admin.users.remove */ export const removeUser: API.OperationMethod< RemoveUserRequest, RemoveUserResponse, RemoveUserError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1072, __c134, 0) as any as S.Schema, + input: __S(840, __c105, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotModifyPrimaryOwner, + FailedToRemoveUserFromWorkspace, + FeatureNotEnabled, + InvalidPermissions, + TeamNotFound, + UserAlreadyDeleted, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveUser", })); -export type RemoveUsersError = SlackOpError; -/** Remove members from an existing organizational usergroup. This method is only available to Enterprise Grid organizations. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user cannot modify the specified usergroup, or the usergroup's membership is managed by an identity provider (IdP) and can only be changed through SCIM. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `invalid_usergroup` -- A usergroup with the specified ID does not exist. - `invalid_users` -- One or more users provided can not be removed from the usergroup. - `user_not_found` -- One or more users provided are invalid or are not a member of the organization. See https://docs.slack.dev/reference/methods/admin.usergroups.removeUsers */ +export type RemoveUsersError = + | FeatureNotEnabled + | InvalidUsergroup + | InvalidUsers + | NotAnEnterprise + | RestrictedAction + | UserNotFound + | SlackOpError; +/** Remove members from an existing organizational usergroup. This method is only available to Enterprise Grid organizations. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user cannot modify the specified usergroup, or the usergroup's membership is managed by an identity provider (IdP) and can only be changed through SCIM. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `invalid_usergroup` -- A usergroup with the specified ID does not exist. - `invalid_users` -- One or more users provided can not be removed from the usergroup. - `user_not_found` -- One or more users provided are invalid or are not a member of the organization. See https://docs.slack.dev/reference/methods/admin.usergroups.removeUsers */ export const removeUsers: API.OperationMethod< RemoveUsersRequest, RemoveUsersResponse, RemoveUsersError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1080, __c135, 0) as any as S.Schema, + input: __S(848, __c106, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + FeatureNotEnabled, + InvalidUsergroup, + InvalidUsers, + NotAnEnterprise, + RestrictedAction, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveUsers", })); -export type RemoveWorkflowsCollaboratorError = SlackOpError; -/** Remove collaborators from workflows within the team or enterprise Required scopes -- user: `admin.workflows:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_allowed` -- The user is not allowed to access this API method - `error_removing_collaborators` -- There were one or more errors adding workflow collaborators See https://docs.slack.dev/reference/methods/admin.workflows.collaborators.remove */ +export type RemoveWorkflowsCollaboratorError = + | ErrorRemovingCollaborators + | NotAllowed + | SlackOpError; +/** Remove collaborators from workflows within the team or enterprise Required scopes -- user: `admin.workflows:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `not_allowed` -- The user is not allowed to access this API method - `error_removing_collaborators` -- There were one or more errors adding workflow collaborators See https://docs.slack.dev/reference/methods/admin.workflows.collaborators.remove */ export const removeWorkflowsCollaborator: API.OperationMethod< RemoveWorkflowsCollaboratorRequest, RemoveWorkflowsCollaboratorResponse, RemoveWorkflowsCollaboratorError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1088, __c136, 0) as any as S.Schema, + input: __S(856, __c107, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ErrorRemovingCollaborators, NotAllowed, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveWorkflowsCollaborator", })); -export type RenameConversationError = SlackOpError; -/** Rename a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The value passed for `channel_id` was invalid. - `channel_type_not_supported` -- The provided `channel_id` was a DM, MPDM, or the 'general' channel. - `could_not_rename_channel` -- The channel could not be renamed. - `default_org_wide_channel` -- The default org-wide channel can't be renamed. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `invalid_name_maxlength` -- The channel name exceeds the maximum allowed length. - `name_taken` -- The channel's name is already being used elsewhere. - `restricted_action` -- A workspace preference prevents the authenticated user from renaming a channel. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated and can't be renamed. - `not_supported` -- This type of channel doesn't support renaming through this method. See https://docs.slack.dev/reference/methods/admin.conversations.rename */ +export type RenameConversationError = + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotRenameChannel + | DefaultOrgWideChannel + | ExternalChannelMigrating + | FeatureNotEnabled + | InvalidNameMaxlength + | NameTaken + | NotSupported + | RestrictedAction + | SlackOpError; +/** Rename a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The value passed for `channel_id` was invalid. - `channel_type_not_supported` -- The provided `channel_id` was a DM, MPDM, or the 'general' channel. - `could_not_rename_channel` -- The channel could not be renamed. - `default_org_wide_channel` -- The default org-wide channel can't be renamed. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `invalid_name_maxlength` -- The channel name exceeds the maximum allowed length. - `name_taken` -- The channel's name is already being used elsewhere. - `restricted_action` -- A workspace preference prevents the authenticated user from renaming a channel. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated and can't be renamed. - `not_supported` -- This type of channel doesn't support renaming through this method. See https://docs.slack.dev/reference/methods/admin.conversations.rename */ export const renameConversation: API.OperationMethod< RenameConversationRequest, RenameConversationResponse, RenameConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1096, __c137, 0) as any as S.Schema, + input: __S(864, __c108, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotRenameChannel, + DefaultOrgWideChannel, + ExternalChannelMigrating, + FeatureNotEnabled, + InvalidNameMaxlength, + NameTaken, + NotSupported, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RenameConversation", })); -export type RenameEmojiError = SlackOpError; -/** Rename an emoji. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_resolve_alias` -- The alias emoji could not be resolved - `error_bad_name_i18n` -- Value passed for `new_name` was invalid. - `error_invalid_emoji_to_rename` -- Value passed for `name` was invalid. - `error_missing_name` -- Value passed for `name` is missing or empty. - `error_name_taken` -- Value passed for `name` already exists. - `error_name_taken_i18n` -- The name has already been taken by another emoji, in the international set. Emoji must have unique names. - `failed_to_fetch_active_team` -- There are no active teams on the org and we need at least one. - `failed_to_rename_emoji` -- The emoji could not be renamed. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `not_an_admin` -- This method is only accessible by org owners and Admins. See https://docs.slack.dev/reference/methods/admin.emoji.rename */ +export type RenameEmojiError = + | CannotResolveAlias + | ErrorBadNameI18n + | ErrorInvalidEmojiToRename + | ErrorMissingName + | ErrorNameTaken + | ErrorNameTakenI18n + | FailedToFetchActiveTeam + | FailedToRenameEmoji + | FeatureNotEnabled + | NotAnAdmin + | SlackOpError; +/** Rename an emoji. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_resolve_alias` -- The alias emoji could not be resolved - `error_bad_name_i18n` -- Value passed for `new_name` was invalid. - `error_invalid_emoji_to_rename` -- Value passed for `name` was invalid. - `error_missing_name` -- Value passed for `name` is missing or empty. - `error_name_taken` -- Value passed for `name` already exists. - `error_name_taken_i18n` -- The name has already been taken by another emoji, in the international set. Emoji must have unique names. - `failed_to_fetch_active_team` -- There are no active teams on the org and we need at least one. - `failed_to_rename_emoji` -- The emoji could not be renamed. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `not_an_admin` -- This method is only accessible by org owners and Admins. See https://docs.slack.dev/reference/methods/admin.emoji.rename */ export const renameEmoji: API.OperationMethod< RenameEmojiRequest, RenameEmojiResponse, RenameEmojiError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1104, __c138, 0) as any as S.Schema, + input: __S(872, __c109, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotResolveAlias, + ErrorBadNameI18n, + ErrorInvalidEmojiToRename, + ErrorMissingName, + ErrorNameTaken, + ErrorNameTakenI18n, + FailedToFetchActiveTeam, + FailedToRenameEmoji, + FeatureNotEnabled, + NotAnAdmin, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RenameEmoji", })); -export type ResetBulkError = SlackOpError; -/** Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_reset_bot` -- Cannot reset bot users - `cannot_reset_primary_owner` -- Only primary owner can reset primary owner's sessions - `failed_for_some_users` -- Some user ids failed to have their session invalidated. Details in extended comments - `feature_not_enabled` -- This method is not available for this product level - `internal_error` -- There was an internal error processing this request! Please try again. - `invalid_auth` -- The token doesn't have access to this endpoint - `not_an_admin` -- This method is only accessible by org/compliance team owners and admins - `session_reset_not_allowed` -- Only primary owner can reset primary owner's sessions - `unknown_method` -- This method is currently not available - `user_not_found` -- Error fetching user - `user_session_reset_failed` -- There was an error starting the session reset. Try again. - `restricted_action` -- Restricted action. See https://docs.slack.dev/reference/methods/admin.users.session.resetBulk */ +export type ResetBulkError = + | CannotResetBot + | CannotResetPrimaryOwner + | FailedForSomeUsers + | FeatureNotEnabled + | NotAnAdmin + | RestrictedAction + | SessionResetNotAllowed + | UnknownMethod + | UserNotFound + | UserSessionResetFailed + | SlackOpError; +/** Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_reset_bot` -- Cannot reset bot users - `cannot_reset_primary_owner` -- Only primary owner can reset primary owner's sessions - `failed_for_some_users` -- Some user ids failed to have their session invalidated. Details in extended comments - `feature_not_enabled` -- This method is not available for this product level - `internal_error` -- There was an internal error processing this request! Please try again. - `invalid_auth` -- The token doesn't have access to this endpoint - `not_an_admin` -- This method is only accessible by org/compliance team owners and admins - `session_reset_not_allowed` -- Only primary owner can reset primary owner's sessions - `unknown_method` -- This method is currently not available - `user_not_found` -- Error fetching user - `user_session_reset_failed` -- There was an error starting the session reset. Try again. - `restricted_action` -- Restricted action. See https://docs.slack.dev/reference/methods/admin.users.session.resetBulk */ export const resetBulk: API.OperationMethod< ResetBulkRequest, ResetBulkResponse, ResetBulkError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1112, __c139, 0) as any as S.Schema, + input: __S(880, __c110, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotResetBot, + CannotResetPrimaryOwner, + FailedForSomeUsers, + FeatureNotEnabled, + NotAnAdmin, + RestrictedAction, + SessionResetNotAllowed, + UnknownMethod, + UserNotFound, + UserSessionResetFailed, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ResetBulk", })); -export type ResetUsersSessionError = SlackOpError; -/** Wipes all valid sessions on all devices for a given user Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_reset_bot` -- Cannot reset bot users - `cannot_reset_primary_owner` -- Only primary owner can reset primary owner's sessions - `feature_not_enabled` -- This method is not available for this product level - `internal_error` -- There was an internal error processing this request! Please try again. - `invalid_auth` -- The token doesn't have access to this endpoint - `not_an_admin` -- This method is only accessible by org/compliance team owners and admins - `unknown_method` -- This method is currently not available - `user_not_found` -- Error fetching user - `user_session_reset_failed` -- There was an error starting the session reset. Try again. See https://docs.slack.dev/reference/methods/admin.users.session.reset */ +export type ResetUsersSessionError = + | CannotResetBot + | CannotResetPrimaryOwner + | FeatureNotEnabled + | NotAnAdmin + | UnknownMethod + | UserNotFound + | UserSessionResetFailed + | SlackOpError; +/** Wipes all valid sessions on all devices for a given user Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_reset_bot` -- Cannot reset bot users - `cannot_reset_primary_owner` -- Only primary owner can reset primary owner's sessions - `feature_not_enabled` -- This method is not available for this product level - `internal_error` -- There was an internal error processing this request! Please try again. - `invalid_auth` -- The token doesn't have access to this endpoint - `not_an_admin` -- This method is only accessible by org/compliance team owners and admins - `unknown_method` -- This method is currently not available - `user_not_found` -- Error fetching user - `user_session_reset_failed` -- There was an error starting the session reset. Try again. See https://docs.slack.dev/reference/methods/admin.users.session.reset */ export const resetUsersSession: API.OperationMethod< ResetUsersSessionRequest, ResetUsersSessionResponse, ResetUsersSessionError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1120, __c140, 0) as any as S.Schema, + input: __S(888, __c111, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotResetBot, + CannotResetPrimaryOwner, + FeatureNotEnabled, + NotAnAdmin, + UnknownMethod, + UserNotFound, + UserSessionResetFailed, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ResetUsersSession", })); -export type ResumeUsersAccessError = SlackOpError; -/** Resume access across the organization for up to 1,000 frontline members. Success means the request was queued, not that all updates have completed. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `restricted_action` -- Only organization admins and owners can perform this action. - `failed_job_enqueue` -- The access change could not be queued. Retry the request. - `failed_for_all_users` -- No valid users were found. Nothing was queued. invalid_users lists the rejected IDs and reasons. - `failed_for_some_users` -- Valid users were queued, but some users were rejected. invalid_users lists the rejected IDs and reasons. Correct and retry only those IDs. See https://docs.slack.dev/reference/methods/admin.users.access.resume */ +export type ResumeUsersAccessError = + | FailedForAllUsers + | FailedForSomeUsers + | FailedJobEnqueue + | RestrictedAction + | SlackOpError; +/** Resume access across the organization for up to 1,000 frontline members. Success means the request was queued, not that all updates have completed. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `restricted_action` -- Only organization admins and owners can perform this action. - `failed_job_enqueue` -- The access change could not be queued. Retry the request. - `failed_for_all_users` -- No valid users were found. Nothing was queued. invalid_users lists the rejected IDs and reasons. - `failed_for_some_users` -- Valid users were queued, but some users were rejected. invalid_users lists the rejected IDs and reasons. Correct and retry only those IDs. See https://docs.slack.dev/reference/methods/admin.users.access.resume */ export const resumeUsersAccess: API.OperationMethod< ResumeUsersAccessRequest, ResumeUsersAccessResponse, ResumeUsersAccessError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(1128, __c141, 0) as any as S.Schema, - output: __S(976, __c122, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(896, __c112, 0) as any as S.Schema, + output: __S(760, __c95, 0) as any as S.Schema, + errors: [ + FailedForAllUsers, + FailedForSomeUsers, + FailedJobEnqueue, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ResumeUsersAccess", })); -export type SearchConversationError = SlackOpError; -/** Search for public or private channels in an Enterprise organization. Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `connected_team_passed_in_is_not_top_level_team` -- One of the orgs provided in the external connected teams filter is not a top level team. Pass the connected org's top-level ID. - `external_team_not_connected_to_this_org` -- One of the teams provided in the external connected teams filter is not connected to the org. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `invalid_auth` -- The token provided does not belong to an Enterprise organization, or a specified workspace wasn't part of this Enterprise. - `invalid_cursor` -- The provided cursor is not valid, often due to not urlencoding query parameters. - `invalid_search_channel_type` -- An invalid `search_channel_types` arg was passed. Make sure there are no spaces between your args and that each is one of the enumerated options listed above. - `invalid_sort` -- The provided `sort` argument wasn't valid. - `invalid_sort_dir` -- The provided `sort_dir` argument wasn't valid. - `not_allowed` -- The authenticated user does not have the permission to call this method. - `not_an_admin` -- The token provided is not associated with an Org Admin or Owner. - `not_an_enterprise` -- This endpoint can only be called by an Enterprise organization. - `team_not_found` -- One of the workspaces provided in the list wasn't found. - `target_team_not_on_org` -- The specified target_team is not part of the organization. See https://docs.slack.dev/reference/methods/admin.conversations.search */ +export type SearchConversationError = + | ConnectedTeamPassedInIsNotTopLevelTeam + | ExternalTeamNotConnectedToThisOrg + | FeatureNotEnabled + | InvalidCursor + | InvalidSearchChannelType + | InvalidSort + | InvalidSortDir + | NotAllowed + | NotAnAdmin + | NotAnEnterprise + | TargetTeamNotOnOrg + | TeamNotFound + | SlackOpError; +/** Search for public or private channels in an Enterprise organization. Required scopes -- user: `admin.conversations:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `connected_team_passed_in_is_not_top_level_team` -- One of the orgs provided in the external connected teams filter is not a top level team. Pass the connected org's top-level ID. - `external_team_not_connected_to_this_org` -- One of the teams provided in the external connected teams filter is not connected to the org. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `invalid_auth` -- The token provided does not belong to an Enterprise organization, or a specified workspace wasn't part of this Enterprise. - `invalid_cursor` -- The provided cursor is not valid, often due to not urlencoding query parameters. - `invalid_search_channel_type` -- An invalid `search_channel_types` arg was passed. Make sure there are no spaces between your args and that each is one of the enumerated options listed above. - `invalid_sort` -- The provided `sort` argument wasn't valid. - `invalid_sort_dir` -- The provided `sort_dir` argument wasn't valid. - `not_allowed` -- The authenticated user does not have the permission to call this method. - `not_an_admin` -- The token provided is not associated with an Org Admin or Owner. - `not_an_enterprise` -- This endpoint can only be called by an Enterprise organization. - `team_not_found` -- One of the workspaces provided in the list wasn't found. - `target_team_not_on_org` -- The specified target_team is not part of the organization. See https://docs.slack.dev/reference/methods/admin.conversations.search */ export const searchConversation: API.PaginatedOperationMethod< SearchConversationRequest, SearchConversationResponse, @@ -4450,9 +10734,24 @@ export const searchConversation: API.PaginatedOperationMethod< string > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(1136, __c142, 0) as any as S.Schema, - output: __S(1137, __c142, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(904, __c113, 0) as any as S.Schema, + output: __S(905, __c113, 1) as any as S.Schema, + errors: [ + ConnectedTeamPassedInIsNotTopLevelTeam, + ExternalTeamNotConnectedToThisOrg, + FeatureNotEnabled, + InvalidCursor, + InvalidSearchChannelType, + InvalidSort, + InvalidSortDir, + NotAllowed, + NotAnAdmin, + NotAnEnterprise, + TargetTeamNotOnOrg, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -4468,8 +10767,8 @@ export const searchConversation: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type SearchWorkflowError = SlackOpError; -/** Search workflows within the team or enterprise Required scopes -- user: `admin.workflows:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_allowed` -- The user is not allowed to access this API method. See https://docs.slack.dev/reference/methods/admin.workflows.search */ +export type SearchWorkflowError = InvalidCursor | NotAllowed | SlackOpError; +/** Search workflows within the team or enterprise Required scopes -- user: `admin.workflows:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `not_allowed` -- The user is not allowed to access this API method. See https://docs.slack.dev/reference/methods/admin.workflows.search */ export const searchWorkflow: API.PaginatedOperationMethod< SearchWorkflowRequest, SearchWorkflowResponse, @@ -4478,9 +10777,9 @@ export const searchWorkflow: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(1144, __c143, 0) as any as S.Schema, - output: __S(1145, __c143, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(912, __c114, 0) as any as S.Schema, + output: __S(913, __c114, 1) as any as S.Schema, + errors: [InvalidCursor, NotAllowed, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -4496,493 +10795,1049 @@ export const searchWorkflow: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type SetAdminError = SlackOpError; -/** Set an existing regular user or owner to be a workspace or org admin. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_modify_primary_owner` -- The primary owner cannot be modified. - `failed_to_set_user_to_admin` -- Designating this user as an admin failed. - `failed_to_set_admin_on_workspaces` -- Failed to set the user as an admin on all workspaces. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_permissions` -- This method is only accessible by org owners and admins. - `invalid_role_for_user` -- The user cannot be made into an admin. - `not_an_admin` -- This method can only be accessed by org owners and admins. - `team_not_found` -- `team_id` was not found. - `user_not_found` -- The user was not found. See https://docs.slack.dev/reference/methods/admin.users.setAdmin */ +export type SetAdminError = + | CannotModifyPrimaryOwner + | FailedToSetAdminOnWorkspaces + | FailedToSetUserToAdmin + | FeatureNotEnabled + | InvalidPermissions + | InvalidRoleForUser + | NotAnAdmin + | TeamNotFound + | UserNotFound + | SlackOpError; +/** Set an existing regular user or owner to be a workspace or org admin. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_modify_primary_owner` -- The primary owner cannot be modified. - `failed_to_set_user_to_admin` -- Designating this user as an admin failed. - `failed_to_set_admin_on_workspaces` -- Failed to set the user as an admin on all workspaces. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_permissions` -- This method is only accessible by org owners and admins. - `invalid_role_for_user` -- The user cannot be made into an admin. - `not_an_admin` -- This method can only be accessed by org owners and admins. - `team_not_found` -- `team_id` was not found. - `user_not_found` -- The user was not found. See https://docs.slack.dev/reference/methods/admin.users.setAdmin */ export const setAdmin: API.OperationMethod< SetAdminRequest, SetAdminResponse, SetAdminError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(40, __c5, 0) as any as S.Schema, + input: __S(920, __c115, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotModifyPrimaryOwner, + FailedToSetAdminOnWorkspaces, + FailedToSetUserToAdmin, + FeatureNotEnabled, + InvalidPermissions, + InvalidRoleForUser, + NotAnAdmin, + TeamNotFound, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetAdmin", })); -export type SetAppsConfigError = SlackOpError; -/** Set the app config for a connector Required scopes -- user: `admin.apps:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- This actor does not have access to the permissions on this resource. - `no_domains_provided` -- At least one allowed domain must be specified if populating the argument - `too_many_domains_provided` -- Too many domains provided. Please provide 50 or less for each type of domain - `url_restriction_not_supported` -- URL restriction is not supported for this app. - `invalid_domains` -- At least one URL or email is invalid - `invalid_app` -- App is invalid - `invalid_workflow_auth_strategy` -- workflow auth strategy is invalid - `restricted_plan_level` -- The given parameter is not supported on this team. - `unknown_method` -- This method does not exist. See https://docs.slack.dev/reference/methods/admin.apps.config.set */ +export type SetAppsConfigError = + | AccessDenied + | InvalidApp + | InvalidDomains + | InvalidWorkflowAuthStrategy + | NoDomainsProvided + | RestrictedPlanLevel + | TooManyDomainsProvided + | UnknownMethod + | UrlRestrictionNotSupported + | SlackOpError; +/** Set the app config for a connector Required scopes -- user: `admin.apps:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `access_denied` -- This actor does not have access to the permissions on this resource. - `no_domains_provided` -- At least one allowed domain must be specified if populating the argument - `too_many_domains_provided` -- Too many domains provided. Please provide 50 or less for each type of domain - `url_restriction_not_supported` -- URL restriction is not supported for this app. - `invalid_domains` -- At least one URL or email is invalid - `invalid_app` -- App is invalid - `invalid_workflow_auth_strategy` -- workflow auth strategy is invalid - `restricted_plan_level` -- The given parameter is not supported on this team. - `unknown_method` -- This method does not exist. See https://docs.slack.dev/reference/methods/admin.apps.config.set */ export const setAppsConfig: API.OperationMethod< SetAppsConfigRequest, SetAppsConfigResponse, SetAppsConfigError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(49, __c6, 1) as any as S.Schema, + input: __S(929, __c116, 1) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + InvalidApp, + InvalidDomains, + InvalidWorkflowAuthStrategy, + NoDomainsProvided, + RestrictedPlanLevel, + TooManyDomainsProvided, + UnknownMethod, + UrlRestrictionNotSupported, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetAppsConfig", })); -export type SetAppsMcpServersPermissionsError = SlackOpError; -/** Set the access control permission for who can use an MCP server Required scopes -- user: `admin.apps:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `restricted_action` -- User does not have permission to perform this action. - `invalid_auth` -- Invalid authorization token - `app_not_found` -- This app does not exist. - `server_not_found` -- The specified MCP server does not exist for this app. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `invalid_permission_type` -- The permission_type value is not valid. - `named_entities_cannot_be_empty` -- Must pass at least one valid named entity when permission_type is named_entities or named_entities_exclude. - `no_valid_named_entities` -- None of the provided named entities were valid. - `user_not_found` -- One or more user IDs are not valid. - `usergroup_not_found` -- One or more usergroup IDs are not valid. - `server_acl_type_broader_than_app` -- The chosen permission type is broader than the app-level ACL allows. - `server_acl_entities_not_in_scope` -- One or more entities in the server ACL are not in scope of the app-level ACL. - `entities_not_supported` -- user_ids or usergroup_ids were provided, but the permission_type does not accept named entities. Only named_entities and named_entities_exclude do. See https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.permissions.set */ +export type SetAppsMcpServersPermissionsError = + | AppNotFound + | EntitiesNotSupported + | InvalidPermissionType + | NamedEntitiesCannotBeEmpty + | NoValidNamedEntities + | NotAnEnterprise + | RestrictedAction + | ServerAclEntitiesNotInScope + | ServerAclTypeBroaderThanApp + | ServerNotFound + | UserNotFound + | UsergroupNotFound + | SlackOpError; +/** Set the access control permission for who can use an MCP server Required scopes -- user: `admin.apps:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `restricted_action` -- User does not have permission to perform this action. - `invalid_auth` -- Invalid authorization token - `app_not_found` -- This app does not exist. - `server_not_found` -- The specified MCP server does not exist for this app. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `invalid_permission_type` -- The permission_type value is not valid. - `named_entities_cannot_be_empty` -- Must pass at least one valid named entity when permission_type is named_entities or named_entities_exclude. - `no_valid_named_entities` -- None of the provided named entities were valid. - `user_not_found` -- One or more user IDs are not valid. - `usergroup_not_found` -- One or more usergroup IDs are not valid. - `server_acl_type_broader_than_app` -- The chosen permission type is broader than the app-level ACL allows. - `server_acl_entities_not_in_scope` -- One or more entities in the server ACL are not in scope of the app-level ACL. - `entities_not_supported` -- user_ids or usergroup_ids were provided, but the permission_type does not accept named entities. Only named_entities and named_entities_exclude do. See https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.permissions.set */ export const setAppsMcpServersPermissions: API.OperationMethod< SetAppsMcpServersPermissionsRequest, SetAppsMcpServersPermissionsResponse, SetAppsMcpServersPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(56, __c7, 0) as any as S.Schema, + input: __S(936, __c117, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AppNotFound, + EntitiesNotSupported, + InvalidPermissionType, + NamedEntitiesCannotBeEmpty, + NoValidNamedEntities, + NotAnEnterprise, + RestrictedAction, + ServerAclEntitiesNotInScope, + ServerAclTypeBroaderThanApp, + ServerNotFound, + UserNotFound, + UsergroupNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetAppsMcpServersPermissions", })); -export type SetAppsPermissionsError = SlackOpError; -/** Set the permission type for who can access an app Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_auth` -- Invalid authorization token - `access_denied` -- This actor does not have access to the permissions on this resource. - `invalid_permission_type` -- This app requires permission_type to be set as named_entities before adding users. - `named_entities_cannot_be_empty` -- Must pass at least one valid named entity. - `no_valid_named_entities` -- None of the provided named entities were valid - `too_many_named_entities` -- Too many named_entities passed into the app permissions setting. - `app_not_found` -- This app does not exist. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `user_not_found` -- This actor does not have access to at least one valid named entity. - `usergroup_not_found` -- The usergroup is not valid. - `invalid_channel_restriction_mode` -- The channel_restriction_mode value is not valid. - `channel_ids_required` -- channel_ids is required when channel_restriction_mode is specific_channels or all_channels_except. - `channel_not_found` -- One or more channel IDs are not valid, are not in this organization, or name a private channel that is not already set on the app and that the caller is neither a member of nor permitted to manage. - `restricted_action` -- User does not have permission to perform this action. - `channel_restrictions_not_available` -- Channel restrictions are not available for this workspace. - `channel_restriction_requires_app_access` -- Channel access cannot be configured while the app is set to no_one, since the app can't be used in any channel. - `app_acl_write_failed` -- A transient database error (e.g. a deadlock) prevented the permission change from being saved. No change was applied; retry the request. See https://docs.slack.dev/reference/methods/admin.apps.permissions.set */ +export type SetAppsPermissionsError = + | AccessDenied + | AppAclWriteFailed + | AppNotFound + | ChannelIdsRequired + | ChannelNotFound + | ChannelRestrictionRequiresAppAccess + | ChannelRestrictionsNotAvailable + | InvalidChannelRestrictionMode + | InvalidPermissionType + | NamedEntitiesCannotBeEmpty + | NoValidNamedEntities + | NotAnEnterprise + | RestrictedAction + | TooManyNamedEntities + | UserNotFound + | UsergroupNotFound + | SlackOpError; +/** Set the permission type for who can access an app Required scopes -- user: `admin.apps:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_auth` -- Invalid authorization token - `access_denied` -- This actor does not have access to the permissions on this resource. - `invalid_permission_type` -- This app requires permission_type to be set as named_entities before adding users. - `named_entities_cannot_be_empty` -- Must pass at least one valid named entity. - `no_valid_named_entities` -- None of the provided named entities were valid - `too_many_named_entities` -- Too many named_entities passed into the app permissions setting. - `app_not_found` -- This app does not exist. - `not_an_enterprise` -- This feature is only available on Enterprise Grid plans. - `user_not_found` -- This actor does not have access to at least one valid named entity. - `usergroup_not_found` -- The usergroup is not valid. - `invalid_channel_restriction_mode` -- The channel_restriction_mode value is not valid. - `channel_ids_required` -- channel_ids is required when channel_restriction_mode is specific_channels or all_channels_except. - `channel_not_found` -- One or more channel IDs are not valid, are not in this organization, or name a private channel that is not already set on the app and that the caller is neither a member of nor permitted to manage. - `restricted_action` -- User does not have permission to perform this action. - `channel_restrictions_not_available` -- Channel restrictions are not available for this workspace. - `channel_restriction_requires_app_access` -- Channel access cannot be configured while the app is set to no_one, since the app can't be used in any channel. - `app_acl_write_failed` -- A transient database error (e.g. a deadlock) prevented the permission change from being saved. No change was applied; retry the request. See https://docs.slack.dev/reference/methods/admin.apps.permissions.set */ export const setAppsPermissions: API.OperationMethod< SetAppsPermissionsRequest, SetAppsPermissionsResponse, SetAppsPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(64, __c8, 0) as any as S.Schema, + input: __S(944, __c118, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppAclWriteFailed, + AppNotFound, + ChannelIdsRequired, + ChannelNotFound, + ChannelRestrictionRequiresAppAccess, + ChannelRestrictionsNotAvailable, + InvalidChannelRestrictionMode, + InvalidPermissionType, + NamedEntitiesCannotBeEmpty, + NoValidNamedEntities, + NotAnEnterprise, + RestrictedAction, + TooManyNamedEntities, + UserNotFound, + UsergroupNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetAppsPermissions", })); -export type SetAutoEnabledError = SlackOpError; -/** Sets who a Slackbot skill is automatically turned on for. Required scopes -- user: `admin.skills:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Skills API is not enabled for this organization or workspace. - `restricted_action` -- The caller must be an org admin or owner with permission to manage skills. - `internal_error` -- The operation could not be completed. Retry the request. - `skill_not_found` -- The skill is missing, deleted, no longer a skill, or outside this organization or workspace. - `method_not_supported_for_skill_type` -- Only canvas skills can be deployed. - `skill_not_visible_to_audience` -- Share the skill first. usergroup_ids lists the groups that cannot view it. - `audience_too_large` -- Validating this audience requires more than 1,000 member checks across the requested groups. Overlapping members count once per group. Select a smaller audience, or share the canvas org-wide if that access is intended, before retrying. - `named_entities_cannot_be_empty` -- Provide at least one user group for named_entities. - `usergroup_not_found` -- invalid_usergroup_ids lists missing, deleted or foreign user groups. - `too_many_named_entities` -- Provide at most 100 user groups. - `invalid_permission_type` -- Use everyone, named_entities or no_one. - `usergroup_ids_not_allowed` -- Only named_entities accepts usergroup_ids. See https://docs.slack.dev/reference/methods/admin.slackbot.skills.setAutoEnabled */ +export type SetAutoEnabledError = + | AudienceTooLarge + | FeatureNotEnabled + | InvalidPermissionType + | MethodNotSupportedForSkillType + | NamedEntitiesCannotBeEmpty + | RestrictedAction + | SkillNotFound + | SkillNotVisibleToAudience + | TooManyNamedEntities + | UsergroupIdsNotAllowed + | UsergroupNotFound + | SlackOpError; +/** Sets who a Slackbot skill is automatically turned on for. Required scopes -- user: `admin.skills:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Skills API is not enabled for this organization or workspace. - `restricted_action` -- The caller must be an org admin or owner with permission to manage skills. - `internal_error` -- The operation could not be completed. Retry the request. - `skill_not_found` -- The skill is missing, deleted, no longer a skill, or outside this organization or workspace. - `method_not_supported_for_skill_type` -- Only canvas skills can be deployed. - `skill_not_visible_to_audience` -- Share the skill first. usergroup_ids lists the groups that cannot view it. - `audience_too_large` -- Validating this audience requires more than 1,000 member checks across the requested groups. Overlapping members count once per group. Select a smaller audience, or share the canvas org-wide if that access is intended, before retrying. - `named_entities_cannot_be_empty` -- Provide at least one user group for named_entities. - `usergroup_not_found` -- invalid_usergroup_ids lists missing, deleted or foreign user groups. - `too_many_named_entities` -- Provide at most 100 user groups. - `invalid_permission_type` -- Use everyone, named_entities or no_one. - `usergroup_ids_not_allowed` -- Only named_entities accepts usergroup_ids. See https://docs.slack.dev/reference/methods/admin.slackbot.skills.setAutoEnabled */ export const setAutoEnabled: API.OperationMethod< SetAutoEnabledRequest, SetAutoEnabledResponse, SetAutoEnabledError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(72, __c9, 0) as any as S.Schema, - output: __S(73, __c9, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(952, __c119, 0) as any as S.Schema, + output: __S(953, __c119, 1) as any as S.Schema, + errors: [ + AudienceTooLarge, + FeatureNotEnabled, + InvalidPermissionType, + MethodNotSupportedForSkillType, + NamedEntitiesCannotBeEmpty, + RestrictedAction, + SkillNotFound, + SkillNotVisibleToAudience, + TooManyNamedEntities, + UsergroupIdsNotAllowed, + UsergroupNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetAutoEnabled", })); -export type SetConversationPrefsError = SlackOpError; -/** Set the posting permissions for a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_mention_sync_required` -- If setting channel mention restriction prefs, both mention prefs must be passed and they must be the same value. - `channel_not_found` -- Value passed for `channel` was invalid. - `channel_type_not_supported` -- Value given for `channel_id` was a #general channel. - `could_not_set_channel_pref` -- Setting the preference or permission failed. - `default_org_wide_channel` -- Returned when you try to modify a default org wide channel. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_value` -- Value passed for the preferences are invalid - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_an_admin` -- The token provided is not associated with an org admin. - `restricted_action` -- A workspace preference prevents the authenticated user from archiving. See https://docs.slack.dev/reference/methods/admin.conversations.setConversationPrefs */ +export type SetConversationPrefsError = + | ChannelMentionSyncRequired + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotSetChannelPref + | DefaultOrgWideChannel + | FeatureNotEnabled + | InvalidValue + | MissingScope + | NotAnAdmin + | RestrictedAction + | SlackOpError; +/** Set the posting permissions for a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_mention_sync_required` -- If setting channel mention restriction prefs, both mention prefs must be passed and they must be the same value. - `channel_not_found` -- Value passed for `channel` was invalid. - `channel_type_not_supported` -- Value given for `channel_id` was a #general channel. - `could_not_set_channel_pref` -- Setting the preference or permission failed. - `default_org_wide_channel` -- Returned when you try to modify a default org wide channel. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_value` -- Value passed for the preferences are invalid - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_an_admin` -- The token provided is not associated with an org admin. - `restricted_action` -- A workspace preference prevents the authenticated user from archiving. See https://docs.slack.dev/reference/methods/admin.conversations.setConversationPrefs */ export const setConversationPrefs: API.OperationMethod< SetConversationPrefsRequest, SetConversationPrefsResponse, SetConversationPrefsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(80, __c10, 0) as any as S.Schema, + input: __S(960, __c120, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelMentionSyncRequired, + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotSetChannelPref, + DefaultOrgWideChannel, + FeatureNotEnabled, + InvalidValue, + MissingScope, + NotAnAdmin, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetConversationPrefs", })); -export type SetCustomRetentionError = SlackOpError; -/** This API endpoint can be used by any admin to set a conversation's retention policy. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value given for `channel_id` was invalid. - `channel_type_not_supported` -- Value given for `channel_id` was a group dm, direct message, or #general channel. - `could_not_set_retention` -- The retention policy could not be set. - `default_org_wide_channel` -- The channel given is a default org-wide channel. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_duration` -- Retention `duration_days` must be an integer greater than 0 days and less than 36500 days (100 years). - `not_an_admin` -- The token provided is not associated with an admin. - `restricted_action` -- A team preference prevents the authenticated user from modifying the retention policy of this channel. - `retention_override_not_allowed` -- The current retention policy disallows modifying the retention policy of this channel. - `not_supported` -- This type of channel isn't supported by this method. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated. See https://docs.slack.dev/reference/methods/admin.conversations.setCustomRetention */ +export type SetCustomRetentionError = + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotSetRetention + | DefaultOrgWideChannel + | ExternalChannelMigrating + | FeatureNotEnabled + | InvalidDuration + | NotAnAdmin + | NotSupported + | RestrictedAction + | RetentionOverrideNotAllowed + | SlackOpError; +/** This API endpoint can be used by any admin to set a conversation's retention policy. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value given for `channel_id` was invalid. - `channel_type_not_supported` -- Value given for `channel_id` was a group dm, direct message, or #general channel. - `could_not_set_retention` -- The retention policy could not be set. - `default_org_wide_channel` -- The channel given is a default org-wide channel. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_duration` -- Retention `duration_days` must be an integer greater than 0 days and less than 36500 days (100 years). - `not_an_admin` -- The token provided is not associated with an admin. - `restricted_action` -- A team preference prevents the authenticated user from modifying the retention policy of this channel. - `retention_override_not_allowed` -- The current retention policy disallows modifying the retention policy of this channel. - `not_supported` -- This type of channel isn't supported by this method. - `external_channel_migrating` -- The channel is an externally shared channel that is currently being migrated. See https://docs.slack.dev/reference/methods/admin.conversations.setCustomRetention */ export const setCustomRetention: API.OperationMethod< SetCustomRetentionRequest, SetCustomRetentionResponse, SetCustomRetentionError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(88, __c11, 0) as any as S.Schema, + input: __S(968, __c121, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotSetRetention, + DefaultOrgWideChannel, + ExternalChannelMigrating, + FeatureNotEnabled, + InvalidDuration, + NotAnAdmin, + NotSupported, + RestrictedAction, + RetentionOverrideNotAllowed, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetCustomRetention", })); -export type SetDefaultChannelsError = SlackOpError; -/** Set the default channels of a workspace. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `failed_to_set_default_channels` -- We encountered an error while trying to set the default channel. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_auth` -- The given token is not authorized for the requested `team_id`. - `not_an_admin` -- This method is only accessible by org owners and admins. - `one_or_more_invalid_channels` -- One or more of the passed channel IDs was invalid. - `restricted_action` -- The actor does not have admin permissions for the team in context - `team_not_found` -- `team_id` was not found. See https://docs.slack.dev/reference/methods/admin.teams.settings.setDefaultChannels */ +export type SetDefaultChannelsError = + | FailedToSetDefaultChannels + | FeatureNotEnabled + | NotAnAdmin + | OneOrMoreInvalidChannels + | RestrictedAction + | TeamNotFound + | SlackOpError; +/** Set the default channels of a workspace. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `failed_to_set_default_channels` -- We encountered an error while trying to set the default channel. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_auth` -- The given token is not authorized for the requested `team_id`. - `not_an_admin` -- This method is only accessible by org owners and admins. - `one_or_more_invalid_channels` -- One or more of the passed channel IDs was invalid. - `restricted_action` -- The actor does not have admin permissions for the team in context - `team_not_found` -- `team_id` was not found. See https://docs.slack.dev/reference/methods/admin.teams.settings.setDefaultChannels */ export const setDefaultChannels: API.OperationMethod< SetDefaultChannelsRequest, SetDefaultChannelsResponse, SetDefaultChannelsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(96, __c12, 0) as any as S.Schema, + input: __S(976, __c122, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + FailedToSetDefaultChannels, + FeatureNotEnabled, + NotAnAdmin, + OneOrMoreInvalidChannels, + RestrictedAction, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetDefaultChannels", })); -export type SetDescriptionError = SlackOpError; -/** Set the description of a given workspace. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `failed_to_set_description` -- There was an error setting the description. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `team_not_found` -- The requested `team_id` can't be found. See https://docs.slack.dev/reference/methods/admin.teams.settings.setDescription */ +export type SetDescriptionError = + | FailedToSetDescription + | FeatureNotEnabled + | TeamNotFound + | SlackOpError; +/** Set the description of a given workspace. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `failed_to_set_description` -- There was an error setting the description. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `team_not_found` -- The requested `team_id` can't be found. See https://docs.slack.dev/reference/methods/admin.teams.settings.setDescription */ export const setDescription: API.OperationMethod< SetDescriptionRequest, SetDescriptionResponse, SetDescriptionError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(104, __c13, 0) as any as S.Schema, + input: __S(984, __c123, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [FailedToSetDescription, FeatureNotEnabled, TeamNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetDescription", })); -export type SetDiscoverabilityError = SlackOpError; -/** An API method that allows admins to set the discoverability of a given workspace Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `discoverability_setting_invalid` -- The discovery setting must be set to one of `open`, `invite_only`, `closed`, or `unlisted`. - `failed_to_set_discoverability` -- There was an error setting the discoverability of this workspace. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `team_not_found` -- The `team_id` was not found. See https://docs.slack.dev/reference/methods/admin.teams.settings.setDiscoverability */ +export type SetDiscoverabilityError = + | DiscoverabilitySettingInvalid + | FailedToSetDiscoverability + | FeatureNotEnabled + | TeamNotFound + | SlackOpError; +/** An API method that allows admins to set the discoverability of a given workspace Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `discoverability_setting_invalid` -- The discovery setting must be set to one of `open`, `invite_only`, `closed`, or `unlisted`. - `failed_to_set_discoverability` -- There was an error setting the discoverability of this workspace. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `team_not_found` -- The `team_id` was not found. See https://docs.slack.dev/reference/methods/admin.teams.settings.setDiscoverability */ export const setDiscoverability: API.OperationMethod< SetDiscoverabilityRequest, SetDiscoverabilityResponse, SetDiscoverabilityError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(112, __c14, 0) as any as S.Schema, + input: __S(992, __c124, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + DiscoverabilitySettingInvalid, + FailedToSetDiscoverability, + FeatureNotEnabled, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetDiscoverability", })); -export type SetExpirationError = SlackOpError; -/** Set an expiration for a guest user Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_modify_external_guest` -- The user is an external huddle guest, whose expiration can't be changed. - `failed_looking_up_user` -- We couldn't find the requested user. - `failed_to_set_expiration` -- The expiration could not be set for the user. - `failed_to_validate_caller` -- The token calling this method doesn't have permission to invite a user. - `failed_to_validate_expiration` -- `expiration_ts` was invalid. - `failed_to_validate_team` -- The team calling this method was invalid. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_arguments` -- The passed arguments were invalid. - `invalid_auth` -- This action could not be authorized. - `team_id_required_for_enterprise` -- Team ID required. - `team_not_found` -- `team_id` was not found. - `user_is_already_deleted` -- The user has already been deleted and disabled. - `user_is_deactivated` -- User has been deactivated. - `user_is_not_a_guest` -- The passed user_id does not belong to a guest user. - `user_not_found` -- The user could not be found. See https://docs.slack.dev/reference/methods/admin.users.setExpiration */ +export type SetExpirationError = + | CannotModifyExternalGuest + | FailedLookingUpUser + | FailedToSetExpiration + | FailedToValidateCaller + | FailedToValidateExpiration + | FailedToValidateTeam + | FeatureNotEnabled + | InvalidArguments + | TeamIdRequiredForEnterprise + | TeamNotFound + | UserIsAlreadyDeleted + | UserIsDeactivated + | UserIsNotAGuest + | UserNotFound + | SlackOpError; +/** Set an expiration for a guest user Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_modify_external_guest` -- The user is an external huddle guest, whose expiration can't be changed. - `failed_looking_up_user` -- We couldn't find the requested user. - `failed_to_set_expiration` -- The expiration could not be set for the user. - `failed_to_validate_caller` -- The token calling this method doesn't have permission to invite a user. - `failed_to_validate_expiration` -- `expiration_ts` was invalid. - `failed_to_validate_team` -- The team calling this method was invalid. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_arguments` -- The passed arguments were invalid. - `invalid_auth` -- This action could not be authorized. - `team_id_required_for_enterprise` -- Team ID required. - `team_not_found` -- `team_id` was not found. - `user_is_already_deleted` -- The user has already been deleted and disabled. - `user_is_deactivated` -- User has been deactivated. - `user_is_not_a_guest` -- The passed user_id does not belong to a guest user. - `user_not_found` -- The user could not be found. See https://docs.slack.dev/reference/methods/admin.users.setExpiration */ export const setExpiration: API.OperationMethod< SetExpirationRequest, SetExpirationResponse, SetExpirationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(128, __c16, 0) as any as S.Schema, + input: __S(1000, __c125, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotModifyExternalGuest, + FailedLookingUpUser, + FailedToSetExpiration, + FailedToValidateCaller, + FailedToValidateExpiration, + FailedToValidateTeam, + FeatureNotEnabled, + InvalidArguments, + TeamIdRequiredForEnterprise, + TeamNotFound, + UserIsAlreadyDeleted, + UserIsDeactivated, + UserIsNotAGuest, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetExpiration", })); -export type SetFunctionsPermissionsError = SlackOpError; -/** Set the visibility of a Slack function and define the users or workspaces if it is set to named_entities. Required scopes -- user: `admin.workflows:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- This actor does not have access to the permissions on this resource. - `function_not_found` -- The referenced function does not exist. - `invalid_visibility` -- Invalid value for visibility. - `invalid_permission_type` -- Invalid value for permission type. - `invalid_permission` -- Invalid value for permission - `unknown_method` -- This method does not exist. - `invalid_setting` -- The `app_collaborators` setting is not allowed for apps not owned by your team/org. - `restricted_action` -- This actor does not have access to the permissions on this resource. See https://docs.slack.dev/reference/methods/admin.functions.permissions.set */ +export type SetFunctionsPermissionsError = + | AccessDenied + | FunctionNotFound + | InvalidPermission + | InvalidPermissionType + | InvalidSetting + | InvalidVisibility + | RestrictedAction + | UnknownMethod + | SlackOpError; +/** Set the visibility of a Slack function and define the users or workspaces if it is set to named_entities. Required scopes -- user: `admin.workflows:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `access_denied` -- This actor does not have access to the permissions on this resource. - `function_not_found` -- The referenced function does not exist. - `invalid_visibility` -- Invalid value for visibility. - `invalid_permission_type` -- Invalid value for permission type. - `invalid_permission` -- Invalid value for permission - `unknown_method` -- This method does not exist. - `invalid_setting` -- The `app_collaborators` setting is not allowed for apps not owned by your team/org. - `restricted_action` -- This actor does not have access to the permissions on this resource. See https://docs.slack.dev/reference/methods/admin.functions.permissions.set */ export const setFunctionsPermissions: API.OperationMethod< SetFunctionsPermissionsRequest, SetFunctionsPermissionsResponse, SetFunctionsPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(138, __c17, 2) as any as S.Schema, + input: __S(1010, __c126, 2) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + FunctionNotFound, + InvalidPermission, + InvalidPermissionType, + InvalidSetting, + InvalidVisibility, + RestrictedAction, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetFunctionsPermissions", })); -export type SetIconError = SlackOpError; -/** Sets the icon of a workspace. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `failed_to_set_icon` -- Setting the url in the database failed. This may be transient, please try again soon. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_auth` -- The given token is not authorized for the requested `team_id`. - `invalid_url` -- Invalid url. - `not_an_admin` -- This method is only accessible by org owners and admins. - `team_not_found` -- `team_id` was not found. See https://docs.slack.dev/reference/methods/admin.teams.settings.setIcon */ +export type SetIconError = + | FailedToSetIcon + | FeatureNotEnabled + | InvalidUrl + | NotAnAdmin + | TeamNotFound + | SlackOpError; +/** Sets the icon of a workspace. Required scopes -- user: `admin.teams:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `failed_to_set_icon` -- Setting the url in the database failed. This may be transient, please try again soon. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_auth` -- The given token is not authorized for the requested `team_id`. - `invalid_url` -- Invalid url. - `not_an_admin` -- This method is only accessible by org owners and admins. - `team_not_found` -- `team_id` was not found. See https://docs.slack.dev/reference/methods/admin.teams.settings.setIcon */ export const setIcon: API.OperationMethod< SetIconRequest, SetIconResponse, SetIconError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(144, __c18, 0) as any as S.Schema, + input: __S(1016, __c127, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + FailedToSetIcon, + FeatureNotEnabled, + InvalidUrl, + NotAnAdmin, + TeamNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetIcon", })); -export type SetNameError = SlackOpError; -/** Set the name of a given workspace. Required scopes -- user: `admin.teams:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `failed_to_set_name` -- Returned when there is an error to set the name - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `team_not_found` -- Returned when team_id can't be resolved See https://docs.slack.dev/reference/methods/admin.teams.settings.setName */ +export type SetNameError = FailedToSetName | FeatureNotEnabled | TeamNotFound | SlackOpError; +/** Set the name of a given workspace. Required scopes -- user: `admin.teams:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `failed_to_set_name` -- Returned when there is an error to set the name - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `team_not_found` -- Returned when team_id can't be resolved See https://docs.slack.dev/reference/methods/admin.teams.settings.setName */ export const setName: API.OperationMethod< SetNameRequest, SetNameResponse, SetNameError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(152, __c19, 0) as any as S.Schema, + input: __S(1024, __c128, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [FailedToSetName, FeatureNotEnabled, TeamNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetName", })); -export type SetOwnerError = SlackOpError; -/** Set an existing regular user or admin to be a workspace or org owner. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_modify_primary_owner` -- The primary owner cannot be modified. - `failed_to_set_user_to_owner` -- The change to the user's role failed. - `failed_to_set_owner_on_workspaces` -- Failed to set the user as an owner on all workspaces. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_role_for_user` -- The user cannot be made into an owner. - `not_an_admin` -- This method can only be accessed by org owners and admins. - `not_supported` -- This is not a supported action. - `team_not_found` -- `team_id` was not found. - `user_must_be_in_workspace` -- This user must be a member of at least one workspace. - `user_not_found` -- The requested user was not found. See https://docs.slack.dev/reference/methods/admin.users.setOwner */ +export type SetOwnerError = + | CannotModifyPrimaryOwner + | FailedToSetOwnerOnWorkspaces + | FailedToSetUserToOwner + | FeatureNotEnabled + | InvalidRoleForUser + | NotAnAdmin + | NotSupported + | TeamNotFound + | UserMustBeInWorkspace + | UserNotFound + | SlackOpError; +/** Set an existing regular user or admin to be a workspace or org owner. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_modify_primary_owner` -- The primary owner cannot be modified. - `failed_to_set_user_to_owner` -- The change to the user's role failed. - `failed_to_set_owner_on_workspaces` -- Failed to set the user as an owner on all workspaces. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_role_for_user` -- The user cannot be made into an owner. - `not_an_admin` -- This method can only be accessed by org owners and admins. - `not_supported` -- This is not a supported action. - `team_not_found` -- `team_id` was not found. - `user_must_be_in_workspace` -- This user must be a member of at least one workspace. - `user_not_found` -- The requested user was not found. See https://docs.slack.dev/reference/methods/admin.users.setOwner */ export const setOwner: API.OperationMethod< SetOwnerRequest, SetOwnerResponse, SetOwnerError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(160, __c20, 0) as any as S.Schema, + input: __S(1032, __c129, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotModifyPrimaryOwner, + FailedToSetOwnerOnWorkspaces, + FailedToSetUserToOwner, + FeatureNotEnabled, + InvalidRoleForUser, + NotAnAdmin, + NotSupported, + TeamNotFound, + UserMustBeInWorkspace, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetOwner", })); -export type SetRegularError = SlackOpError; -/** Set an existing guest user, admin user, or owner to be a regular user. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_set_org_admin_to_regular_at_workspace_level` -- Org admins cannot be set to regular at the workspace level. Change their user type at the org level instead. - `cannot_set_this_guest_to_regular_at_team_level` -- This guest cannot be set to regular because they are active on multiple workspaces. - `cannot_modify_primary_owner` -- The primary owner cannot be modified. - `failed_to_set_user_to_regular` -- Changing a user to a regular member failed. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_role_for_user` -- The user's current role does not allow this change. - `not_an_admin` -- This method can only be accessed by org owners and admins. - `team_not_found` -- `team_id` was not found. - `user_not_found` -- The requested user was not found. - `inviter_email_not_verified` -- The target is an invited user, and the user whose token is calling this method has not verified the email address on their own account. They must verify it before changing an invited user's account type. See https://docs.slack.dev/reference/methods/admin.users.setRegular */ +export type SetRegularError = + | CannotModifyPrimaryOwner + | CannotSetOrgAdminToRegularAtWorkspaceLevel + | CannotSetThisGuestToRegularAtTeamLevel + | FailedToSetUserToRegular + | FeatureNotEnabled + | InvalidRoleForUser + | InviterEmailNotVerified + | NotAnAdmin + | TeamNotFound + | UserNotFound + | SlackOpError; +/** Set an existing guest user, admin user, or owner to be a regular user. Required scopes -- user: `admin.users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_set_org_admin_to_regular_at_workspace_level` -- Org admins cannot be set to regular at the workspace level. Change their user type at the org level instead. - `cannot_set_this_guest_to_regular_at_team_level` -- This guest cannot be set to regular because they are active on multiple workspaces. - `cannot_modify_primary_owner` -- The primary owner cannot be modified. - `failed_to_set_user_to_regular` -- Changing a user to a regular member failed. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `invalid_role_for_user` -- The user's current role does not allow this change. - `not_an_admin` -- This method can only be accessed by org owners and admins. - `team_not_found` -- `team_id` was not found. - `user_not_found` -- The requested user was not found. - `inviter_email_not_verified` -- The target is an invited user, and the user whose token is calling this method has not verified the email address on their own account. They must verify it before changing an invited user's account type. See https://docs.slack.dev/reference/methods/admin.users.setRegular */ export const setRegular: API.OperationMethod< SetRegularRequest, SetRegularResponse, SetRegularError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(168, __c21, 0) as any as S.Schema, + input: __S(1040, __c130, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotModifyPrimaryOwner, + CannotSetOrgAdminToRegularAtWorkspaceLevel, + CannotSetThisGuestToRegularAtTeamLevel, + FailedToSetUserToRegular, + FeatureNotEnabled, + InvalidRoleForUser, + InviterEmailNotVerified, + NotAnAdmin, + TeamNotFound, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetRegular", })); -export type SetSettingsError = SlackOpError; -/** Configure the user-level session settings--the session duration and what happens when the client closes--for one or more users. Required scopes -- user: `admin.users:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `admin_unauthorized` -- The token provided doesn't have permission to revoke a session. - `at_least_one_session_setting_required` -- At least one session setting is required. - `bots_not_allowed` -- Bot sessions are not listed by this method. - `feature_not_enabled` -- This method is only available for Enterprise organizations. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The token doesn't have access to this endpoint. - `not_an_admin` -- This method is only accessible by Org Owners and Admins - `ratelimited` -- The rate limit for this endpoint has been reached. - `unable_to_update_existing_sessions` -- The session settings could not be applied to users' existing sessions. - `unknown_method` -- This method is currently not available. - `user_not_found` -- At least one of the requested users doesn't exist. See https://docs.slack.dev/reference/methods/admin.users.session.setSettings */ +export type SetSettingsError = + | AdminUnauthorized + | AtLeastOneSessionSettingRequired + | BotsNotAllowed + | FeatureNotEnabled + | InvalidArguments + | NotAnAdmin + | UnableToUpdateExistingSessions + | UnknownMethod + | UserNotFound + | SlackOpError; +/** Configure the user-level session settings--the session duration and what happens when the client closes--for one or more users. Required scopes -- user: `admin.users:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `admin_unauthorized` -- The token provided doesn't have permission to revoke a session. - `at_least_one_session_setting_required` -- At least one session setting is required. - `bots_not_allowed` -- Bot sessions are not listed by this method. - `feature_not_enabled` -- This method is only available for Enterprise organizations. - `internal_error` -- There was an internal error processing this request--please retry. - `invalid_arguments` -- Required arguments either were not provided or contain invalid values. - `invalid_auth` -- The token doesn't have access to this endpoint. - `not_an_admin` -- This method is only accessible by Org Owners and Admins - `ratelimited` -- The rate limit for this endpoint has been reached. - `unable_to_update_existing_sessions` -- The session settings could not be applied to users' existing sessions. - `unknown_method` -- This method is currently not available. - `user_not_found` -- At least one of the requested users doesn't exist. See https://docs.slack.dev/reference/methods/admin.users.session.setSettings */ export const setSettings: API.OperationMethod< SetSettingsRequest, SetSettingsResponse, SetSettingsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(176, __c22, 0) as any as S.Schema, + input: __S(1048, __c131, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AdminUnauthorized, + AtLeastOneSessionSettingRequired, + BotsNotAllowed, + FeatureNotEnabled, + InvalidArguments, + NotAnAdmin, + UnableToUpdateExistingSessions, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetSettings", })); -export type SetTeamsError = SlackOpError; -/** Set the workspaces in an Enterprise org that connect to a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_add_legacy_disconnected_channel_to_workspaces` -- Cannot add legacy disconnected channel to workspaces - `cannot_move_local_channel` -- This API cannot be used to move a local channel from one workspace to another. - `channel_cannot_be_unshared` -- Channel cannot be unshared from this workspace. - `channel_not_found` -- The channel wasn't found or isn't shared to this workspace. - `channel_type_not_supported` -- The requested `channel_id` is not a supported type of channel. - `could_not_set_teams_for_channel` -- The requested `channel_id` has not been shared with the target workspace. - `default_org_wide_channel` -- Default org wide channel cannot be unshared from a workspace. - `externally_shared_or_disconnected_channel` -- The channel is or was externally shared. - `invalid_channel_id` -- `channel_id` was invalid. - `invalid_target_team` -- Target workspace is invalid. - `managed_channel_not_supported` -- Cannot unshare a managed channel - `name_taken` -- The proposed new name for the channel is already in use within your organization. - `not_allowed_for_grid_workspace` -- Slack Connect is not allowed for this Enterprise org workspace - `not_enabled` -- The API endpoint is not enabled for your team. - `restricted_action` -- The caller of this API is not allowed to perform this operation. - `too_many_target_teams` -- Too many `target_team_ids` were provided. - `unsupported_arguments` -- The provided method arguments are not supported. - `insufficient_permissions_to_share_channel` -- The authenticated user isn't an org admin or owner and tried to add or remove an unlisted workspace that isn't visible to them. Ask an org admin or owner with permission to manage the channel to make this change. See https://docs.slack.dev/reference/methods/admin.conversations.setTeams */ +export type SetTeamsError = + | CannotAddLegacyDisconnectedChannelToWorkspaces + | CannotMoveLocalChannel + | ChannelCannotBeUnshared + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotSetTeamsForChannel + | DefaultOrgWideChannel + | ExternallySharedOrDisconnectedChannel + | InsufficientPermissionsToShareChannel + | InvalidChannelId + | InvalidTargetTeam + | ManagedChannelNotSupported + | NameTaken + | NotAllowedForGridWorkspace + | NotEnabled + | RestrictedAction + | TooManyTargetTeams + | UnsupportedArguments + | SlackOpError; +/** Set the workspaces in an Enterprise org that connect to a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_add_legacy_disconnected_channel_to_workspaces` -- Cannot add legacy disconnected channel to workspaces - `cannot_move_local_channel` -- This API cannot be used to move a local channel from one workspace to another. - `channel_cannot_be_unshared` -- Channel cannot be unshared from this workspace. - `channel_not_found` -- The channel wasn't found or isn't shared to this workspace. - `channel_type_not_supported` -- The requested `channel_id` is not a supported type of channel. - `could_not_set_teams_for_channel` -- The requested `channel_id` has not been shared with the target workspace. - `default_org_wide_channel` -- Default org wide channel cannot be unshared from a workspace. - `externally_shared_or_disconnected_channel` -- The channel is or was externally shared. - `invalid_channel_id` -- `channel_id` was invalid. - `invalid_target_team` -- Target workspace is invalid. - `managed_channel_not_supported` -- Cannot unshare a managed channel - `name_taken` -- The proposed new name for the channel is already in use within your organization. - `not_allowed_for_grid_workspace` -- Slack Connect is not allowed for this Enterprise org workspace - `not_enabled` -- The API endpoint is not enabled for your team. - `restricted_action` -- The caller of this API is not allowed to perform this operation. - `too_many_target_teams` -- Too many `target_team_ids` were provided. - `unsupported_arguments` -- The provided method arguments are not supported. - `insufficient_permissions_to_share_channel` -- The authenticated user isn't an org admin or owner and tried to add or remove an unlisted workspace that isn't visible to them. Ask an org admin or owner with permission to manage the channel to make this change. See https://docs.slack.dev/reference/methods/admin.conversations.setTeams */ export const setTeams: API.OperationMethod< SetTeamsRequest, SetTeamsResponse, SetTeamsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(184, __c23, 0) as any as S.Schema, - output: __S(185, __c23, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(1056, __c132, 0) as any as S.Schema, + output: __S(1057, __c132, 1) as any as S.Schema, + errors: [ + CannotAddLegacyDisconnectedChannelToWorkspaces, + CannotMoveLocalChannel, + ChannelCannotBeUnshared, + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotSetTeamsForChannel, + DefaultOrgWideChannel, + ExternallySharedOrDisconnectedChannel, + InsufficientPermissionsToShareChannel, + InvalidChannelId, + InvalidTargetTeam, + ManagedChannelNotSupported, + NameTaken, + NotAllowedForGridWorkspace, + NotEnabled, + RestrictedAction, + TooManyTargetTeams, + UnsupportedArguments, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetTeams", })); -export type SetWorkflowsTriggersTypesPermissionsError = SlackOpError; -/** Set the permissions for using a trigger type Required scopes -- user: `client` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_named_entities` -- Named entities visibility requires a valid set of named entities to be specified - `invalid_permission_type` -- This permission type is invalid. - `invalid_permission_set` -- This permission set is invalid. - `required_visibility` -- Visibility is required on this resource. - `restricted_action` -- This actor does not have access to the permissions on this resource. - `trigger_type_id_not_found` -- The referenced trigger type ID does not exist. - `visibility_is_not_named_entities` -- The visibility should be named entities when the user_ids, team_ids, or org_ids args are set - `user_not_found` -- A value passed in `user_ids` was invalid. See https://docs.slack.dev/reference/methods/admin.workflows.triggers.types.permissions.set */ +export type SetWorkflowsTriggersTypesPermissionsError = + | InvalidNamedEntities + | InvalidPermissionSet + | InvalidPermissionType + | RequiredVisibility + | RestrictedAction + | TriggerTypeIdNotFound + | UserNotFound + | VisibilityIsNotNamedEntities + | SlackOpError; +/** Set the permissions for using a trigger type Required scopes -- user: `client` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_named_entities` -- Named entities visibility requires a valid set of named entities to be specified - `invalid_permission_type` -- This permission type is invalid. - `invalid_permission_set` -- This permission set is invalid. - `required_visibility` -- Visibility is required on this resource. - `restricted_action` -- This actor does not have access to the permissions on this resource. - `trigger_type_id_not_found` -- The referenced trigger type ID does not exist. - `visibility_is_not_named_entities` -- The visibility should be named entities when the user_ids, team_ids, or org_ids args are set - `user_not_found` -- A value passed in `user_ids` was invalid. See https://docs.slack.dev/reference/methods/admin.workflows.triggers.types.permissions.set */ export const setWorkflowsTriggersTypesPermissions: API.OperationMethod< SetWorkflowsTriggersTypesPermissionsRequest, SetWorkflowsTriggersTypesPermissionsResponse, SetWorkflowsTriggersTypesPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(193, __c24, 1) as any as S.Schema, + input: __S(1065, __c133, 1) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + InvalidNamedEntities, + InvalidPermissionSet, + InvalidPermissionType, + RequiredVisibility, + RestrictedAction, + TriggerTypeIdNotFound, + UserNotFound, + VisibilityIsNotNamedEntities, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetWorkflowsTriggersTypesPermissions", })); -export type TeamsSettingsInfoError = SlackOpError; -/** Fetch information about settings in a workspace Required scopes -- user: `admin.teams:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `failed_to_fetch_info` -- There was an error fetching info for this workspace. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `team_not_found` -- The `team_id` was not found. See https://docs.slack.dev/reference/methods/admin.teams.settings.info */ +export type TeamsSettingsInfoError = + | FailedToFetchInfo + | FeatureNotEnabled + | TeamNotFound + | SlackOpError; +/** Fetch information about settings in a workspace Required scopes -- user: `admin.teams:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `failed_to_fetch_info` -- There was an error fetching info for this workspace. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `team_not_found` -- The `team_id` was not found. See https://docs.slack.dev/reference/methods/admin.teams.settings.info */ export const teamsSettingsInfo: API.OperationMethod< TeamsSettingsInfoRequest, TeamsSettingsInfoResponse, TeamsSettingsInfoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(200, __c25, 0) as any as S.Schema, - output: __S(202, __c25, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(1072, __c134, 0) as any as S.Schema, + output: __S(1074, __c134, 2) as any as S.Schema, + errors: [FailedToFetchInfo, FeatureNotEnabled, TeamNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "TeamsSettingsInfo", })); -export type UnarchiveConversationError = SlackOpError; -/** Unarchive a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_archived` -- The passed channel is not currently archived. - `channel_not_found` -- The value passed for `channel_id` was invalid, or the channel belongs to a workspace other than the token's workspace and isn't shared with it. - `channel_type_not_supported` -- The value passed for `channel` was a DM, MPDM, or the 'general' channel - `could_not_unarchive_channel` -- The channel could not be unarchived. - `default_org_wide_channel` -- You can't unarchive a default org-wide channel. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `missing_scope` -- The token provided doesn't have the required scopes. - `restricted_action` -- A workspace preference prevents the authenticated user from unarchiving. - `target_team_not_on_org` -- The specified target_team is not part of the organization. See https://docs.slack.dev/reference/methods/admin.conversations.unarchive */ +export type UnarchiveConversationError = + | ChannelNotArchived + | ChannelNotFound + | ChannelTypeNotSupported + | CouldNotUnarchiveChannel + | DefaultOrgWideChannel + | FeatureNotEnabled + | MissingScope + | RestrictedAction + | TargetTeamNotOnOrg + | SlackOpError; +/** Unarchive a public or private channel. Required scopes -- user: `admin.conversations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_archived` -- The passed channel is not currently archived. - `channel_not_found` -- The value passed for `channel_id` was invalid, or the channel belongs to a workspace other than the token's workspace and isn't shared with it. - `channel_type_not_supported` -- The value passed for `channel` was a DM, MPDM, or the 'general' channel - `could_not_unarchive_channel` -- The channel could not be unarchived. - `default_org_wide_channel` -- You can't unarchive a default org-wide channel. - `feature_not_enabled` -- The token provided doesn't have access to this method. - `missing_scope` -- The token provided doesn't have the required scopes. - `restricted_action` -- A workspace preference prevents the authenticated user from unarchiving. - `target_team_not_on_org` -- The specified target_team is not part of the organization. See https://docs.slack.dev/reference/methods/admin.conversations.unarchive */ export const unarchiveConversation: API.OperationMethod< UnarchiveConversationRequest, UnarchiveConversationResponse, UnarchiveConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(216, __c27, 0) as any as S.Schema, + input: __S(1080, __c135, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotArchived, + ChannelNotFound, + ChannelTypeNotSupported, + CouldNotUnarchiveChannel, + DefaultOrgWideChannel, + FeatureNotEnabled, + MissingScope, + RestrictedAction, + TargetTeamNotOnOrg, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UnarchiveConversation", })); -export type UninstallAppError = SlackOpError; -/** Uninstall an app from one or many workspaces, or an entire enterprise organization. Required scopes -- user: `admin.apps:write` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `app_not_found` -- The provided `app_id` was not found. - `can_not_uninstall` -- This application can not be uninstalled via the API. - `enterprise_not_found` -- The provided `enterprise_id` was not found. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `must_revoke_access` -- Organization-deployed apps cannot be uninstalled from specific workspaces using this API. - `permission_denied` -- You do not have permission to uninstall applications from the requested org or workspaces. - `specify_enterprise_or_teams` -- Provide exactly one of `enterprise_id` or `team_ids`. - `teams_not_found` -- One or more of the provided `team_ids` were not found. - `too_many_teams` -- Too many IDs are present in `team_ids`. - `restricted_action` -- the user is not authorized to perform this action See https://docs.slack.dev/reference/methods/admin.apps.uninstall */ +export type UninstallAppError = + | AppNotFound + | CanNotUninstall + | EnterpriseNotFound + | FeatureNotEnabled + | MustRevokeAccess + | PermissionDenied + | RestrictedAction + | SpecifyEnterpriseOrTeams + | TeamsNotFound + | TooManyTeams + | SlackOpError; +/** Uninstall an app from one or many workspaces, or an entire enterprise organization. Required scopes -- user: `admin.apps:write` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `app_not_found` -- The provided `app_id` was not found. - `can_not_uninstall` -- This application can not be uninstalled via the API. - `enterprise_not_found` -- The provided `enterprise_id` was not found. - `feature_not_enabled` -- The Admin APIs feature is not enabled for this team. - `must_revoke_access` -- Organization-deployed apps cannot be uninstalled from specific workspaces using this API. - `permission_denied` -- You do not have permission to uninstall applications from the requested org or workspaces. - `specify_enterprise_or_teams` -- Provide exactly one of `enterprise_id` or `team_ids`. - `teams_not_found` -- One or more of the provided `team_ids` were not found. - `too_many_teams` -- Too many IDs are present in `team_ids`. - `restricted_action` -- the user is not authorized to perform this action See https://docs.slack.dev/reference/methods/admin.apps.uninstall */ export const uninstallApp: API.OperationMethod< UninstallAppRequest, UninstallAppResponse, UninstallAppError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(224, __c28, 0) as any as S.Schema, + input: __S(1088, __c136, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AppNotFound, + CanNotUninstall, + EnterpriseNotFound, + FeatureNotEnabled, + MustRevokeAccess, + PermissionDenied, + RestrictedAction, + SpecifyEnterpriseOrTeams, + TeamsNotFound, + TooManyTeams, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UninstallApp", })); -export type UnlinkObjectsError = SlackOpError; -/** Unlink a Salesforce record from a channel Required scopes -- user: `admin.conversations:manage_objects` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` is invalid. - `restricted_action` -- User does not have access to perform this action. - `invalid_name_specials` -- Value passed for `name` contained unallowed special characters or upper case characters. - `name_taken` -- A channel cannot be created with the given name. See https://docs.slack.dev/reference/methods/admin.conversations.unlinkObjects */ +export type UnlinkObjectsError = + | ChannelNotFound + | InvalidNameSpecials + | NameTaken + | RestrictedAction + | SlackOpError; +/** Unlink a Salesforce record from a channel Required scopes -- user: `admin.conversations:manage_objects` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` is invalid. - `restricted_action` -- User does not have access to perform this action. - `invalid_name_specials` -- Value passed for `name` contained unallowed special characters or upper case characters. - `name_taken` -- A channel cannot be created with the given name. See https://docs.slack.dev/reference/methods/admin.conversations.unlinkObjects */ export const unlinkObjects: API.OperationMethod< UnlinkObjectsRequest, UnlinkObjectsResponse, UnlinkObjectsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(232, __c29, 0) as any as S.Schema, + input: __S(1096, __c137, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + InvalidNameSpecials, + NameTaken, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UnlinkObjects", })); -export type UnpublishSlackbotSkillError = SlackOpError; -/** Removes Slackbot skills from the org catalog, preserving access, libraries, and deployments. Required scopes -- user: `admin.skills:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Skills API is not enabled for this organization or workspace. - `restricted_action` -- The caller must be an org admin or owner with permission to manage skills. - `internal_error` -- The operation could not be completed. Retry the request. - `failed_for_some_skills` -- Some skills failed. `failed_skills` lists each distinct failed skill ID and its error: `skill_not_found`, `method_not_supported_for_skill_type`, `restricted_action`, or `internal_error`. Missing, deleted, non-skill, and other organizations' files all return `skill_not_found`. See https://docs.slack.dev/reference/methods/admin.slackbot.skills.unpublish */ +export type UnpublishSlackbotSkillError = + | FailedForSomeSkills + | FeatureNotEnabled + | RestrictedAction + | SlackOpError; +/** Removes Slackbot skills from the org catalog, preserving access, libraries, and deployments. Required scopes -- user: `admin.skills:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Skills API is not enabled for this organization or workspace. - `restricted_action` -- The caller must be an org admin or owner with permission to manage skills. - `internal_error` -- The operation could not be completed. Retry the request. - `failed_for_some_skills` -- Some skills failed. `failed_skills` lists each distinct failed skill ID and its error: `skill_not_found`, `method_not_supported_for_skill_type`, `restricted_action`, or `internal_error`. Missing, deleted, non-skill, and other organizations' files all return `skill_not_found`. See https://docs.slack.dev/reference/methods/admin.slackbot.skills.unpublish */ export const unpublishSlackbotSkill: API.OperationMethod< UnpublishSlackbotSkillRequest, UnpublishSlackbotSkillResponse, UnpublishSlackbotSkillError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(240, __c30, 0) as any as S.Schema, + input: __S(1104, __c138, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [FailedForSomeSkills, FeatureNotEnabled, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UnpublishSlackbotSkill", })); -export type UnpublishWorkflowError = SlackOpError; -/** Unpublish workflows within the team or enterprise Required scopes -- user: `admin.workflows:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_allowed` -- The user is not allowed to access this API method - `error_unpublishing_workflows` -- There were one or more errors unpublishing workflows See https://docs.slack.dev/reference/methods/admin.workflows.unpublish */ +export type UnpublishWorkflowError = ErrorUnpublishingWorkflows | NotAllowed | SlackOpError; +/** Unpublish workflows within the team or enterprise Required scopes -- user: `admin.workflows:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `not_allowed` -- The user is not allowed to access this API method - `error_unpublishing_workflows` -- There were one or more errors unpublishing workflows See https://docs.slack.dev/reference/methods/admin.workflows.unpublish */ export const unpublishWorkflow: API.OperationMethod< UnpublishWorkflowRequest, UnpublishWorkflowResponse, UnpublishWorkflowError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(248, __c31, 0) as any as S.Schema, + input: __S(1112, __c139, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ErrorUnpublishingWorkflows, NotAllowed, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UnpublishWorkflow", })); -export type UpdateBarrierError = SlackOpError; -/** Update an existing Information Barrier Required scopes -- user: `admin.barriers:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `barrier_already_exists` -- There already exists another barrier restricting activity between two or more of your requested usergroups. - `barrier_not_found` -- The barrier you're trying to update cannot be found. - `barriered_from_usergroups_not_found` -- One or more of the ids passed in for barriered_from_usergroup_ids can't be found. - `feature_not_enabled` -- The information barrier feature is not enabled, please reach out to your CSM. - `invalid_restricted_subjects` -- The restricted subjects provided are invalid or not currently supported. - `not_an_admin` -- The token provided is not associated with an org admin. - `primary_usergroup_not_found` -- The id passed in for primary_usergroup_id can't be found. See https://docs.slack.dev/reference/methods/admin.barriers.update */ +export type UpdateBarrierError = + | BarrierAlreadyExists + | BarrierNotFound + | BarrieredFromUsergroupsNotFound + | FeatureNotEnabled + | InvalidRestrictedSubjects + | NotAnAdmin + | PrimaryUsergroupNotFound + | SlackOpError; +/** Update an existing Information Barrier Required scopes -- user: `admin.barriers:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `barrier_already_exists` -- There already exists another barrier restricting activity between two or more of your requested usergroups. - `barrier_not_found` -- The barrier you're trying to update cannot be found. - `barriered_from_usergroups_not_found` -- One or more of the ids passed in for barriered_from_usergroup_ids can't be found. - `feature_not_enabled` -- The information barrier feature is not enabled, please reach out to your CSM. - `invalid_restricted_subjects` -- The restricted subjects provided are invalid or not currently supported. - `not_an_admin` -- The token provided is not associated with an org admin. - `primary_usergroup_not_found` -- The id passed in for primary_usergroup_id can't be found. See https://docs.slack.dev/reference/methods/admin.barriers.update */ export const updateBarrier: API.OperationMethod< UpdateBarrierRequest, UpdateBarrierResponse, UpdateBarrierError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(256, __c32, 0) as any as S.Schema, - output: __S(456, __c57, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(1120, __c140, 0) as any as S.Schema, + output: __S(312, __c39, 0) as any as S.Schema, + errors: [ + BarrierAlreadyExists, + BarrierNotFound, + BarrieredFromUsergroupsNotFound, + FeatureNotEnabled, + InvalidRestrictedSubjects, + NotAnAdmin, + PrimaryUsergroupNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateBarrier", })); -export type UpdateItemError = SlackOpError; -/** API to allow Enterprise org admins to write/overwrite the allow list of IP blocks and ASNs from the enterprise configuration. Required scopes -- user: `admin` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `endpoint_unavailable` -- The requested endpoint is currently unavailable. - `invalid_field_or_data` -- user attempted to write and invalid field or data to the team config - `unable_to_process_post_request` -- The user sent a malformed post request - `unsupported_action_describe` -- The user specified describe action is unsupported - `unsupported_action_put` -- The user specified put action is unsupported See https://docs.slack.dev/reference/methods/admin.audit.anomaly.allow.updateItem */ +export type UpdateItemError = + | EndpointUnavailable + | InvalidFieldOrData + | UnableToProcessPostRequest + | UnsupportedActionDescribe + | UnsupportedActionPut + | SlackOpError; +/** API to allow Enterprise org admins to write/overwrite the allow list of IP blocks and ASNs from the enterprise configuration. Required scopes -- user: `admin` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `endpoint_unavailable` -- The requested endpoint is currently unavailable. - `invalid_field_or_data` -- user attempted to write and invalid field or data to the team config - `unable_to_process_post_request` -- The user sent a malformed post request - `unsupported_action_describe` -- The user specified describe action is unsupported - `unsupported_action_put` -- The user specified put action is unsupported See https://docs.slack.dev/reference/methods/admin.audit.anomaly.allow.updateItem */ export const updateItem: API.OperationMethod< UpdateItemRequest, UpdateItemResponse, UpdateItemError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(264, __c33, 0) as any as S.Schema, + input: __S(1128, __c141, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + EndpointUnavailable, + InvalidFieldOrData, + UnableToProcessPostRequest, + UnsupportedActionDescribe, + UnsupportedActionPut, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateItem", })); -export type UpdateUsergroupError = SlackOpError; -/** Update one or more properties of an existing organizational usergroup. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user cannot modify the specified usergroup, or the usergroup is managed by an identity provider (IdP) and its name cannot be changed through this API. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `invalid_usergroup` -- A usergroup with the specified ID does not exist. - `name_already_exists` -- The name specified is used by another usergroup and cannot be updated. - `handle_already_exists` -- The handle specified is used by another usergroup or entity and cannot be updated. - `visible_group_needs_handle` -- Tried to set the group to visible but did not provide a handle. - `too_many_usergroup_members_to_make_visible` -- Tried to set the group to visible but the group has too many members - `user_channel_limit_exceeded` -- Adding these channels would cause one or more members to exceed their channel limit. - `cannot_modify_pref_after_creation` -- This preference can only be set when the group is created and cannot be changed afterward. See https://docs.slack.dev/reference/methods/admin.usergroups.update */ +export type UpdateUsergroupError = + | CannotModifyPrefAfterCreation + | FeatureNotEnabled + | HandleAlreadyExists + | InvalidUsergroup + | NameAlreadyExists + | NotAnEnterprise + | RestrictedAction + | TooManyUsergroupMembersToMakeVisible + | UserChannelLimitExceeded + | VisibleGroupNeedsHandle + | SlackOpError; +/** Update one or more properties of an existing organizational usergroup. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user cannot modify the specified usergroup, or the usergroup is managed by an identity provider (IdP) and its name cannot be changed through this API. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `invalid_usergroup` -- A usergroup with the specified ID does not exist. - `name_already_exists` -- The name specified is used by another usergroup and cannot be updated. - `handle_already_exists` -- The handle specified is used by another usergroup or entity and cannot be updated. - `visible_group_needs_handle` -- Tried to set the group to visible but did not provide a handle. - `too_many_usergroup_members_to_make_visible` -- Tried to set the group to visible but the group has too many members - `user_channel_limit_exceeded` -- Adding these channels would cause one or more members to exceed their channel limit. - `cannot_modify_pref_after_creation` -- This preference can only be set when the group is created and cannot be changed afterward. See https://docs.slack.dev/reference/methods/admin.usergroups.update */ export const updateUsergroup: API.OperationMethod< UpdateUsergroupRequest, UpdateUsergroupResponse, UpdateUsergroupError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(272, __c34, 0) as any as S.Schema, - output: __S(273, __c34, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(1136, __c142, 0) as any as S.Schema, + output: __S(1137, __c142, 1) as any as S.Schema, + errors: [ + CannotModifyPrefAfterCreation, + FeatureNotEnabled, + HandleAlreadyExists, + InvalidUsergroup, + NameAlreadyExists, + NotAnEnterprise, + RestrictedAction, + TooManyUsergroupMembersToMakeVisible, + UserChannelLimitExceeded, + VisibleGroupNeedsHandle, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateUsergroup", })); -export type UploadUsersError = SlackOpError; -/** Add members to an existing organizational usergroup in bulk via CSV upload. This method is only available to Enterprise Grid organizations. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user cannot modify the specified usergroup, or the usergroup's membership is managed by an identity provider (IdP) and can only be changed through SCIM. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `invalid_usergroup` -- A usergroup with the specified ID does not exist. - `no_valid_users` -- There were no valid users provided in the csv. - `unable_to_parse_csv` -- Could not parse the uploaded csv. - `member_count_would_exceed_visible_limit` -- The usergroup is visible and the member count would exceed the limit. - `cannot_modify_role_admin` -- The user does not have permission to modify the roles admin role. - `subteam_limit_exceeded` -- A csv upload can only contain at most 15k users. See https://docs.slack.dev/reference/methods/admin.usergroups.uploadUsers */ +export type UploadUsersError = + | CannotModifyRoleAdmin + | FeatureNotEnabled + | InvalidUsergroup + | MemberCountWouldExceedVisibleLimit + | NoValidUsers + | NotAnEnterprise + | RestrictedAction + | SubteamLimitExceeded + | UnableToParseCsv + | SlackOpError; +/** Add members to an existing organizational usergroup in bulk via CSV upload. This method is only available to Enterprise Grid organizations. Required scopes -- user: `admin.usergroups:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `feature_not_enabled` -- The Admin APIs feature is not enabled for this workspace. - `invalid_auth` -- The workspace specified is not part of this organization. - `restricted_action` -- The calling user cannot modify the specified usergroup, or the usergroup's membership is managed by an identity provider (IdP) and can only be changed through SCIM. - `not_an_enterprise` -- The token passed in does not belong to an Enterprise organization. - `invalid_usergroup` -- A usergroup with the specified ID does not exist. - `no_valid_users` -- There were no valid users provided in the csv. - `unable_to_parse_csv` -- Could not parse the uploaded csv. - `member_count_would_exceed_visible_limit` -- The usergroup is visible and the member count would exceed the limit. - `cannot_modify_role_admin` -- The user does not have permission to modify the roles admin role. - `subteam_limit_exceeded` -- A csv upload can only contain at most 15k users. See https://docs.slack.dev/reference/methods/admin.usergroups.uploadUsers */ export const uploadUsers: API.OperationMethod< UploadUsersRequest, UploadUsersResponse, UploadUsersError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(280, __c35, 0) as any as S.Schema, - output: __S(281, __c35, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(1144, __c143, 0) as any as S.Schema, + output: __S(1145, __c143, 1) as any as S.Schema, + errors: [ + CannotModifyRoleAdmin, + FeatureNotEnabled, + InvalidUsergroup, + MemberCountWouldExceedVisibleLimit, + NoValidUsers, + NotAnEnterprise, + RestrictedAction, + SubteamLimitExceeded, + UnableToParseCsv, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -5035,67 +11890,11 @@ function __c4(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel: S.String.pipe(T.Query()), - oldest_ts: S.optional(S.String.pipe(T.Query())), - latest_ts: S.optional(S.String.pipe(T.Query())), - cursor: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.analytics.messages.metadata", code: 200 })), - ).annotate({ identifier: "AnalyticsMessagesMetadataRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - name: S.String, - count: S.Number, - }), - ).annotate({ identifier: "AnalyticsMessagesMetadataResponseMessagesItemReactionsItem" }); - case 2: - return S.Array(__S(33, __c4, 1)); - case 3: - return S.suspend(() => - S.Struct({ - id: S.String, - created: S.Number, - timestamp: S.Number, - mimetype: S.optional(S.String), - filetype: S.optional(S.String), - subtype: S.optional(S.String), - pretty_type: S.optional(S.String), - is_external: S.optional(S.Boolean), - external_type: S.optional(S.String), - is_public: S.optional(S.Boolean), - public_url_shared: S.optional(S.Boolean), - display_as_bot: S.optional(S.Boolean), - duration_ms: S.optional(S.Number), - media_display_type: S.optional(S.String), - }), - ).annotate({ identifier: "AnalyticsMessagesMetadataResponseMessagesItemFilesItem" }); - case 4: - return S.Array(__S(35, __c4, 3)); - case 5: - return S.suspend(() => - S.Struct({ - user_id: S.optional(S.String), - type: S.String, - subtype: S.optional(S.String), - ts: S.String, - thread_ts: S.optional(S.String), - display_as_bot: S.optional(S.Boolean), - client_msg_id: S.optional(S.String), - text_character_count: S.optional(S.Number), - reactions: S.optional(__S(34, __c4, 2)), - files: S.optional(__S(36, __c4, 4)), - }), - ).annotate({ identifier: "AnalyticsMessagesMetadataResponseMessagesItem" }); - case 6: - return S.Array(__S(37, __c4, 5)); - case 7: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - response_metadata: S.optional(__S(1064, __c133, 0)), - messages: __S(38, __c4, 6), - }), - ).annotate({ identifier: "AnalyticsMessagesMetadataResponse" }); + role_id: S.String, + entity_ids: __S(24, __c3, 0), + user_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.roles.addAssignments", code: 200 })), + ).annotate({ identifier: "AddAssignmentsRequest" }); } } function __c5(j: number): any { @@ -5103,10 +11902,10 @@ function __c5(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String, - user_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.users.setAdmin", code: 200 })), - ).annotate({ identifier: "SetAdminRequest" }); + ok: S.Boolean, + error: S.optional(S.String), + }), + ).annotate({ identifier: "AddAssignmentsResponse" }); } } function __c6(j: number): any { @@ -5114,19 +11913,11 @@ function __c6(j: number): any { case 0: return S.suspend(() => S.Struct({ - urls: S.optional(__S(24, __c3, 0)), - emails: S.optional(__S(24, __c3, 0)), - }), - ).annotate({ identifier: "SetAppsConfigRequestDomainRestrictions" }); - case 1: - return S.suspend(() => - S.Struct({ - app_id: S.String, - workflow_auth_strategy: S.optional(S.String), - rich_link_preview_type: S.optional(S.String), - domain_restrictions: S.optional(__S(48, __c6, 0)), - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.config.set", code: 200 })), - ).annotate({ identifier: "SetAppsConfigRequest" }); + usergroup_id: S.String, + team_id: S.optional(S.String), + channel_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.addChannels", code: 200 })), + ).annotate({ identifier: "AddChannelsRequest" }); } } function __c7(j: number): any { @@ -5134,15 +11925,11 @@ function __c7(j: number): any { case 0: return S.suspend(() => S.Struct({ - app_id: S.String, - server_id: S.String, - permission_type: S.String, - user_ids: S.optional(__S(24, __c3, 0)), - usergroup_ids: S.optional(__S(24, __c3, 0)), - }).pipe( - T.Http({ method: "POST", uri: "/admin.apps.mcp.servers.permissions.set", code: 200 }), - ), - ).annotate({ identifier: "SetAppsMcpServersPermissionsRequest" }); + ok: S.Boolean, + error: S.optional(S.String), + invalid_channels: S.optional(__S(24, __c3, 0)), + }), + ).annotate({ identifier: "AddChannelsResponse" }); } } function __c8(j: number): any { @@ -5150,14 +11937,10 @@ function __c8(j: number): any { case 0: return S.suspend(() => S.Struct({ - app_id: S.String, - permission_type: S.String, - user_ids: S.optional(__S(24, __c3, 0)), - usergroup_ids: S.optional(__S(24, __c3, 0)), - channel_restriction_mode: S.optional(S.String), - channel_ids: S.optional(__S(24, __c3, 0)), - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.permissions.set", code: 200 })), - ).annotate({ identifier: "SetAppsPermissionsRequest" }); + name: S.String.pipe(T.Query()), + url: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.emoji.add", code: 200 })), + ).annotate({ identifier: "AddEmojiRequest" }); } } function __c9(j: number): any { @@ -5165,22 +11948,13 @@ function __c9(j: number): any { case 0: return S.suspend(() => S.Struct({ - skill_id: S.String, - permission_type: S.String, - usergroup_ids: S.optional(__S(24, __c3, 0)), + team_id: S.optional(S.String.pipe(T.Query())), + group_id: S.String.pipe(T.Query()), + channel_id: S.String.pipe(T.Query()), }).pipe( - T.Http({ method: "POST", uri: "/admin.slackbot.skills.setAutoEnabled", code: 200 }), + T.Http({ method: "GET", uri: "/admin.conversations.restrictAccess.addGroup", code: 200 }), ), - ).annotate({ identifier: "SetAutoEnabledRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - skill_id: S.String, - permission_type: S.String, - usergroup_ids: __S(24, __c3, 0), - }), - ).annotate({ identifier: "SetAutoEnabledResponse" }); + ).annotate({ identifier: "AddGroupRequest" }); } } function __c10(j: number): any { @@ -5188,12 +11962,11 @@ function __c10(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - prefs: S.String, - }).pipe( - T.Http({ method: "POST", uri: "/admin.conversations.setConversationPrefs", code: 200 }), - ), - ).annotate({ identifier: "SetConversationPrefsRequest" }); + usergroup_id: S.String, + team_ids: __S(24, __c3, 0), + auto_provision: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.addTeams", code: 200 })), + ).annotate({ identifier: "AddTeamsRequest" }); } } function __c11(j: number): any { @@ -5201,12 +11974,18 @@ function __c11(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - duration_days: S.Number, - }).pipe( - T.Http({ method: "POST", uri: "/admin.conversations.setCustomRetention", code: 200 }), - ), - ).annotate({ identifier: "SetCustomRetentionRequest" }); + id: S.String, + users: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.addUsers", code: 200 })), + ).annotate({ identifier: "AddUsersRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + error: S.optional(S.String), + invalid_users: S.optional(__S(97, __c12, 1)), + }), + ).annotate({ identifier: "AddUsersResponse" }); } } function __c12(j: number): any { @@ -5214,12 +11993,12 @@ function __c12(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String.pipe(T.Query()), - channel_ids: __S(24, __c3, 0).pipe(T.Query()), - }).pipe( - T.Http({ method: "GET", uri: "/admin.teams.settings.setDefaultChannels", code: 200 }), - ), - ).annotate({ identifier: "SetDefaultChannelsRequest" }); + user_id: S.String, + reason: S.String, + }), + ).annotate({ identifier: "AddUsersResponseInvalidUsersItem" }); + case 1: + return S.Array(__S(96, __c12, 0)); } } function __c13(j: number): any { @@ -5227,10 +12006,10 @@ function __c13(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String, - description: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.teams.settings.setDescription", code: 200 })), - ).annotate({ identifier: "SetDescriptionRequest" }); + workflow_ids: __S(24, __c3, 0), + collaborator_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.workflows.collaborators.add", code: 200 })), + ).annotate({ identifier: "AddWorkflowsCollaboratorRequest" }); } } function __c14(j: number): any { @@ -5238,12 +12017,21 @@ function __c14(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String, - discoverability: S.String, - }).pipe( - T.Http({ method: "POST", uri: "/admin.teams.settings.setDiscoverability", code: 200 }), - ), - ).annotate({ identifier: "SetDiscoverabilityRequest" }); + channel: S.String.pipe(T.Query()), + oldest_ts: S.optional(S.String.pipe(T.Query())), + latest_ts: S.optional(S.String.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + limit: S.optional(S.Number.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.analytics.messages.activity", code: 200 })), + ).annotate({ identifier: "AnalyticsMessagesActivityRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + response_metadata: S.optional(__S(120, __c15, 0)), + message_activities: S.Unknown, + }), + ).annotate({ identifier: "AnalyticsMessagesActivityResponse" }); } } function __c15(j: number): any { @@ -5251,15 +12039,9 @@ function __c15(j: number): any { case 0: return S.suspend(() => S.Struct({ - allow_child_auto_install: S.optional(S.Boolean), - app_id: S.optional(S.String), - request_id: S.optional(S.String), - team_id: S.optional(S.String), - enterprise_id: S.optional(S.String), - user_scopes: S.optional(S.String), - bot_scopes: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.approve", code: 200 })), - ).annotate({ identifier: "ApproveAppRequest" }); + next_cursor: S.optional(S.String), + }), + ).annotate({ identifier: "AnalyticsMessagesActivityResponseResponseMetadata" }); } } function __c16(j: number): any { @@ -5267,11 +12049,67 @@ function __c16(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.optional(S.String), - user_id: S.String, - expiration_ts: S.Number, - }).pipe(T.Http({ method: "POST", uri: "/admin.users.setExpiration", code: 200 })), - ).annotate({ identifier: "SetExpirationRequest" }); + channel: S.String.pipe(T.Query()), + oldest_ts: S.optional(S.String.pipe(T.Query())), + latest_ts: S.optional(S.String.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.analytics.messages.metadata", code: 200 })), + ).annotate({ identifier: "AnalyticsMessagesMetadataRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + name: S.String, + count: S.Number, + }), + ).annotate({ identifier: "AnalyticsMessagesMetadataResponseMessagesItemReactionsItem" }); + case 2: + return S.Array(__S(129, __c16, 1)); + case 3: + return S.suspend(() => + S.Struct({ + id: S.String, + created: S.Number, + timestamp: S.Number, + mimetype: S.optional(S.String), + filetype: S.optional(S.String), + subtype: S.optional(S.String), + pretty_type: S.optional(S.String), + is_external: S.optional(S.Boolean), + external_type: S.optional(S.String), + is_public: S.optional(S.Boolean), + public_url_shared: S.optional(S.Boolean), + display_as_bot: S.optional(S.Boolean), + duration_ms: S.optional(S.Number), + media_display_type: S.optional(S.String), + }), + ).annotate({ identifier: "AnalyticsMessagesMetadataResponseMessagesItemFilesItem" }); + case 4: + return S.Array(__S(131, __c16, 3)); + case 5: + return S.suspend(() => + S.Struct({ + user_id: S.optional(S.String), + type: S.String, + subtype: S.optional(S.String), + ts: S.String, + thread_ts: S.optional(S.String), + display_as_bot: S.optional(S.Boolean), + client_msg_id: S.optional(S.String), + text_character_count: S.optional(S.Number), + reactions: S.optional(__S(130, __c16, 2)), + files: S.optional(__S(132, __c16, 4)), + }), + ).annotate({ identifier: "AnalyticsMessagesMetadataResponseMessagesItem" }); + case 6: + return S.Array(__S(133, __c16, 5)); + case 7: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + response_metadata: S.optional(__S(120, __c15, 0)), + messages: __S(134, __c16, 6), + }), + ).annotate({ identifier: "AnalyticsMessagesMetadataResponse" }); } } function __c17(j: number): any { @@ -5279,22 +12117,15 @@ function __c17(j: number): any { case 0: return S.suspend(() => S.Struct({ - visibility: S.String, - permission_type: S.String, - user_ids: S.optional(__S(24, __c3, 0)), - }), - ).annotate({ identifier: "SetFunctionsPermissionsRequestPermissionsItem" }); - case 1: - return S.Array(__S(136, __c17, 0)); - case 2: - return S.suspend(() => - S.Struct({ - function_id: S.String, - visibility: S.optional(S.String), - user_ids: S.optional(__S(24, __c3, 0)), - permissions: S.optional(__S(137, __c17, 1)), - }).pipe(T.Http({ method: "POST", uri: "/admin.functions.permissions.set", code: 200 })), - ).annotate({ identifier: "SetFunctionsPermissionsRequest" }); + allow_child_auto_install: S.optional(S.Boolean), + app_id: S.optional(S.String), + request_id: S.optional(S.String), + team_id: S.optional(S.String), + enterprise_id: S.optional(S.String), + user_scopes: S.optional(S.String), + bot_scopes: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.approve", code: 200 })), + ).annotate({ identifier: "ApproveAppRequest" }); } } function __c18(j: number): any { @@ -5302,10 +12133,10 @@ function __c18(j: number): any { case 0: return S.suspend(() => S.Struct({ - image_url: S.String.pipe(T.Query()), - team_id: S.String.pipe(T.Query()), - }).pipe(T.Http({ method: "GET", uri: "/admin.teams.settings.setIcon", code: 200 })), - ).annotate({ identifier: "SetIconRequest" }); + team_id: S.optional(S.String), + invite_request_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.inviteRequests.approve", code: 200 })), + ).annotate({ identifier: "ApproveInviteRequestRequest" }); } } function __c19(j: number): any { @@ -5313,10 +12144,12 @@ function __c19(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String, - name: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.teams.settings.setName", code: 200 })), - ).annotate({ identifier: "SetNameRequest" }); + app_id: S.optional(S.String), + request_id: S.optional(S.String), + team_id: S.optional(S.String), + enterprise_id: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.restrict", code: 200 })), + ).annotate({ identifier: "AppsRestrictRequest" }); } } function __c20(j: number): any { @@ -5324,10 +12157,9 @@ function __c20(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String, - user_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.users.setOwner", code: 200 })), - ).annotate({ identifier: "SetOwnerRequest" }); + channel_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.archive", code: 200 })), + ).annotate({ identifier: "ArchiveConversationRequest" }); } } function __c21(j: number): any { @@ -5335,10 +12167,11 @@ function __c21(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String, - user_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.users.setRegular", code: 200 })), - ).annotate({ identifier: "SetRegularRequest" }); + policy_name: S.String, + entity_type: S.Unknown, + entity_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.auth.policy.assignEntities", code: 200 })), + ).annotate({ identifier: "AssignEntitiesRequest" }); } } function __c22(j: number): any { @@ -5346,11 +12179,10 @@ function __c22(j: number): any { case 0: return S.suspend(() => S.Struct({ - user_ids: __S(24, __c3, 0), - duration: S.optional(S.Number), - desktop_app_browser_quit: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.setSettings", code: 200 })), - ).annotate({ identifier: "SetSettingsRequest" }); + ok: S.Boolean, + entity_total_count: S.Number, + }), + ).annotate({ identifier: "AssignEntitiesResponse" }); } } function __c23(j: number): any { @@ -5358,19 +12190,13 @@ function __c23(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - team_id: S.optional(S.String), - target_team_ids: S.optional(__S(24, __c3, 0)), - org_channel: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.setTeams", code: 200 })), - ).annotate({ identifier: "SetTeamsRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - channel: S.String, - }), - ).annotate({ identifier: "SetTeamsResponse" }); + team_id: S.String, + user_id: S.String, + is_restricted: S.optional(S.Boolean), + is_ultra_restricted: S.optional(S.Boolean), + channel_ids: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.users.assign", code: 200 })), + ).annotate({ identifier: "AssignUserRequest" }); } } function __c24(j: number): any { @@ -5378,54 +12204,28 @@ function __c24(j: number): any { case 0: return S.suspend(() => S.Struct({ - permissions: S.optional(__S(800, __c100, 0)), - }), - ).annotate({ identifier: "SetWorkflowsTriggersTypesPermissionsRequestPermissions" }); - case 1: - return S.suspend(() => - S.Struct({ - id: S.String, - visibility: S.optional(S.String), - user_ids: S.optional(__S(24, __c3, 0)), - permissions: S.optional(__S(192, __c24, 0)), + channel_ids: __S(24, __c3, 0), }).pipe( T.Http({ method: "POST", - uri: "/admin.workflows.triggers.types.permissions.set", + uri: "/admin.conversations.bulkArchive", code: 200, + contentType: "form-urlencoded", }), ), - ).annotate({ identifier: "SetWorkflowsTriggersTypesPermissionsRequest" }); + ).annotate({ identifier: "BulkArchiveRequest" }); } } function __c25(j: number): any { switch (j) { case 0: - return S.suspend(() => - S.Struct({ - team_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.teams.settings.info", code: 200 })), - ).annotate({ identifier: "TeamsSettingsInfoRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - id: S.optional(S.String), - name: S.optional(S.String), - domain: S.optional(S.String), - email_domain: S.optional(S.String), - icon: S.optional(S.Unknown), - enterprise_id: S.optional(S.String), - enterprise_name: S.optional(S.String), - default_channels: S.optional(__S(704, __c88, 0)), - }), - ).annotate({ identifier: "TeamsSettingsInfoResponseTeam" }); - case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, - team: __S(201, __c25, 1), + bulk_action_id: S.String, + not_added: __S(209, __c26, 1), }), - ).annotate({ identifier: "TeamsSettingsInfoResponse" }); + ).annotate({ identifier: "BulkArchiveResponse" }); } } function __c26(j: number): any { @@ -5433,10 +12233,12 @@ function __c26(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.optional(S.String), - invite_request_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.inviteRequests.approve", code: 200 })), - ).annotate({ identifier: "ApproveInviteRequestRequest" }); + channel_id: S.String, + errors: __S(24, __c3, 0), + }), + ).annotate({ identifier: "BulkArchiveResponseNotAddedItem" }); + case 1: + return S.Array(__S(208, __c26, 0)); } } function __c27(j: number): any { @@ -5444,9 +12246,16 @@ function __c27(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.unarchive", code: 200 })), - ).annotate({ identifier: "UnarchiveConversationRequest" }); + channel_ids: __S(24, __c3, 0), + }).pipe( + T.Http({ + method: "POST", + uri: "/admin.conversations.bulkDelete", + code: 200, + contentType: "form-urlencoded", + }), + ), + ).annotate({ identifier: "BulkDeleteRequest" }); } } function __c28(j: number): any { @@ -5454,11 +12263,17 @@ function __c28(j: number): any { case 0: return S.suspend(() => S.Struct({ - app_id: S.String, - team_ids: S.optional(S.String), - enterprise_id: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.uninstall", code: 200 })), - ).annotate({ identifier: "UninstallAppRequest" }); + target_team_id: S.String, + channel_ids: __S(24, __c3, 0), + }).pipe( + T.Http({ + method: "POST", + uri: "/admin.conversations.bulkMove", + code: 200, + contentType: "form-urlencoded", + }), + ), + ).annotate({ identifier: "BulkMoveRequest" }); } } function __c29(j: number): any { @@ -5466,10 +12281,16 @@ function __c29(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel: S.String, - new_name: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.unlinkObjects", code: 200 })), - ).annotate({ identifier: "UnlinkObjectsRequest" }); + channel_ids: __S(24, __c3, 0).pipe(T.Query()), + exclude: S.Boolean.pipe(T.Query()), + }).pipe( + T.Http({ + method: "GET", + uri: "/admin.conversations.bulkSetExcludeFromSlackAi", + code: 200, + }), + ), + ).annotate({ identifier: "BulkSetExcludeFromSlackAiRequest" }); } } function __c30(j: number): any { @@ -5477,9 +12298,25 @@ function __c30(j: number): any { case 0: return S.suspend(() => S.Struct({ - skill_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.slackbot.skills.unpublish", code: 200 })), - ).annotate({ identifier: "UnpublishSlackbotSkillRequest" }); + channel_ids: __S(24, __c3, 0), + property: S.String, + }).pipe( + T.Http({ + method: "POST", + uri: "/admin.conversations.bulkSetProperties", + code: 200, + contentType: "form-urlencoded", + }), + ), + ).annotate({ identifier: "BulkSetPropertiesRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + bulk_action_id: S.String, + not_updated: __S(209, __c26, 1), + }), + ).annotate({ identifier: "BulkSetPropertiesResponse" }); } } function __c31(j: number): any { @@ -5487,9 +12324,11 @@ function __c31(j: number): any { case 0: return S.suspend(() => S.Struct({ - workflow_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.workflows.unpublish", code: 200 })), - ).annotate({ identifier: "UnpublishWorkflowRequest" }); + request_id: S.String, + team_id: S.optional(S.String), + enterprise_id: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.requests.cancel", code: 200 })), + ).annotate({ identifier: "CancelAppsRequestRequest" }); } } function __c32(j: number): any { @@ -5497,19 +12336,11 @@ function __c32(j: number): any { case 0: return S.suspend(() => S.Struct({ - barrier_id: S.String, - primary_usergroup_id: S.String, - barriered_from_usergroup_ids: __S(24, __c3, 0), - restricted_subjects: __S(464, __c58, 0), - }).pipe( - T.Http({ - method: "POST", - uri: "/admin.barriers.update", - code: 200, - contentType: "form-urlencoded", - }), - ), - ).annotate({ identifier: "UpdateBarrierRequest" }); + app_id: S.String, + team_id: S.optional(S.String), + enterprise_id: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.clearResolution", code: 200 })), + ).annotate({ identifier: "ClearResolutionRequest" }); } } function __c33(j: number): any { @@ -5517,12 +12348,9 @@ function __c33(j: number): any { case 0: return S.suspend(() => S.Struct({ - trusted_cidr: S.optional(__S(24, __c3, 0)), - trusted_asns: S.optional(__S(624, __c78, 0)), - }).pipe( - T.Http({ method: "POST", uri: "/admin.audit.anomaly.allow.updateItem", code: 200 }), - ), - ).annotate({ identifier: "UpdateItemRequest" }); + user_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.clearSettings", code: 200 })), + ).annotate({ identifier: "ClearSettingsRequest" }); } } function __c34(j: number): any { @@ -5530,21 +12358,27 @@ function __c34(j: number): any { case 0: return S.suspend(() => S.Struct({ - id: S.String, - name: S.optional(S.String), - handle: S.optional(S.String), - description: S.optional(S.String), - is_visible: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.update", code: 200 })), - ).annotate({ identifier: "UpdateUsergroupRequest" }); + channel_id: S.String, + user_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.kick", code: 200 })), + ).annotate({ identifier: "ConversationsKickRequest" }); case 1: + return S.suspend(() => + S.Struct({ + user_id: S.String, + error: S.String, + }), + ).annotate({ identifier: "ConversationsKickResponseFailedUserIdsItem" }); + case 2: + return S.Array(__S(273, __c34, 1)); + case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, - subteam: S.optional(S.Unknown), - channel_limit_user_ids: S.optional(__S(24, __c3, 0)), + removed_user_ids: __S(24, __c3, 0), + failed_user_ids: __S(274, __c34, 2), }), - ).annotate({ identifier: "UpdateUsergroupResponse" }); + ).annotate({ identifier: "ConversationsKickResponse" }); } } function __c35(j: number): any { @@ -5552,18 +12386,12 @@ function __c35(j: number): any { case 0: return S.suspend(() => S.Struct({ - id: S.String, - file: S.optional(S.Unknown), - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.uploadUsers", code: 200 })), - ).annotate({ identifier: "UploadUsersRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - successful_user_count: S.Number, - invalid_users: S.optional(__S(873, __c109, 1)), - }), - ).annotate({ identifier: "UploadUsersResponse" }); + channel_id: S.String, + name: S.optional(S.String), + }).pipe( + T.Http({ method: "POST", uri: "/admin.conversations.convertToPrivate", code: 200 }), + ), + ).annotate({ identifier: "ConvertToPrivateRequest" }); } } function __c36(j: number): any { @@ -5571,12 +12399,9 @@ function __c36(j: number): any { case 0: return S.suspend(() => S.Struct({ - app_id: S.optional(S.String), - request_id: S.optional(S.String), - team_id: S.optional(S.String), - enterprise_id: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.restrict", code: 200 })), - ).annotate({ identifier: "AppsRestrictRequest" }); + channel_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.convertToPublic", code: 200 })), + ).annotate({ identifier: "ConvertToPublicRequest" }); } } function __c37(j: number): any { @@ -5584,21 +12409,24 @@ function __c37(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.archive", code: 200 })), - ).annotate({ identifier: "ArchiveConversationRequest" }); + primary_usergroup_id: S.String, + barriered_from_usergroup_ids: __S(24, __c3, 0), + restricted_subjects: __S(304, __c38, 0), + }).pipe( + T.Http({ + method: "POST", + uri: "/admin.barriers.create", + code: 200, + contentType: "form-urlencoded", + }), + ), + ).annotate({ identifier: "CreateBarrierRequest" }); } } function __c38(j: number): any { switch (j) { case 0: - return S.suspend(() => - S.Struct({ - policy_name: S.String, - entity_type: S.Unknown, - entity_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.auth.policy.assignEntities", code: 200 })), - ).annotate({ identifier: "AssignEntitiesRequest" }); + return S.Array(S.String); } } function __c39(j: number): any { @@ -5607,9 +12435,9 @@ function __c39(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - entity_total_count: S.Number, + barrier: S.Unknown, }), - ).annotate({ identifier: "AssignEntitiesResponse" }); + ).annotate({ identifier: "CreateBarrierResponse" }); } } function __c40(j: number): any { @@ -5617,13 +12445,20 @@ function __c40(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String, - user_id: S.String, - is_restricted: S.optional(S.Boolean), - is_ultra_restricted: S.optional(S.Boolean), - channel_ids: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.assign", code: 200 })), - ).annotate({ identifier: "AssignUserRequest" }); + name: S.String, + description: S.optional(S.String), + is_private: S.Boolean, + org_wide: S.optional(S.Boolean), + team_id: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.create", code: 200 })), + ).annotate({ identifier: "CreateConversationRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + channel_id: S.optional(S.String), + }), + ).annotate({ identifier: "CreateConversationResponse" }); } } function __c41(j: number): any { @@ -5631,28 +12466,40 @@ function __c41(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_ids: __S(24, __c3, 0), + object_id: S.String, + salesforce_org_id: S.String, + invite_object_team: S.optional(S.Boolean), }).pipe( - T.Http({ - method: "POST", - uri: "/admin.conversations.bulkArchive", - code: 200, - contentType: "form-urlencoded", - }), + T.Http({ method: "POST", uri: "/admin.conversations.createForObjects", code: 200 }), ), - ).annotate({ identifier: "BulkArchiveRequest" }); + ).annotate({ identifier: "CreateForObjectsRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + channel_id: S.String, + }), + ).annotate({ identifier: "CreateForObjectsResponse" }); } } function __c42(j: number): any { switch (j) { case 0: + return S.suspend(() => + S.Struct({ + team_domain: S.String, + team_name: S.String, + team_description: S.optional(S.String), + team_discoverability: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.teams.create", code: 200 })), + ).annotate({ identifier: "CreateTeamRequest" }); + case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - bulk_action_id: S.String, - not_added: __S(345, __c43, 1), + team: S.String, }), - ).annotate({ identifier: "BulkArchiveResponse" }); + ).annotate({ identifier: "CreateTeamResponse" }); } } function __c43(j: number): any { @@ -5660,12 +12507,20 @@ function __c43(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - errors: __S(24, __c3, 0), - }), - ).annotate({ identifier: "BulkArchiveResponseNotAddedItem" }); + name: S.String, + handle: S.optional(S.String), + purpose: S.optional(S.String), + is_visible: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.create", code: 200 })), + ).annotate({ identifier: "CreateUsergroupRequest" }); case 1: - return S.Array(__S(344, __c43, 0)); + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + error: S.optional(S.String), + subteam: S.optional(S.Unknown), + }), + ).annotate({ identifier: "CreateUsergroupResponse" }); } } function __c44(j: number): any { @@ -5673,16 +12528,9 @@ function __c44(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_ids: __S(24, __c3, 0), - }).pipe( - T.Http({ - method: "POST", - uri: "/admin.conversations.bulkDelete", - code: 200, - contentType: "form-urlencoded", - }), - ), - ).annotate({ identifier: "BulkDeleteRequest" }); + user_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.users.deactivate", code: 200 })), + ).annotate({ identifier: "DeactivateUserRequest" }); } } function __c45(j: number): any { @@ -5690,17 +12538,16 @@ function __c45(j: number): any { case 0: return S.suspend(() => S.Struct({ - target_team_id: S.String, - channel_ids: __S(24, __c3, 0), + barrier_id: S.String, }).pipe( T.Http({ method: "POST", - uri: "/admin.conversations.bulkMove", + uri: "/admin.barriers.delete", code: 200, contentType: "form-urlencoded", }), ), - ).annotate({ identifier: "BulkMoveRequest" }); + ).annotate({ identifier: "DeleteBarrierRequest" }); } } function __c46(j: number): any { @@ -5708,11 +12555,9 @@ function __c46(j: number): any { case 0: return S.suspend(() => S.Struct({ - role_id: S.String, - entity_ids: __S(24, __c3, 0), - user_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.roles.addAssignments", code: 200 })), - ).annotate({ identifier: "AddAssignmentsRequest" }); + channel_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.delete", code: 200 })), + ).annotate({ identifier: "DeleteConversationRequest" }); } } function __c47(j: number): any { @@ -5720,10 +12565,12 @@ function __c47(j: number): any { case 0: return S.suspend(() => S.Struct({ - ok: S.Boolean, - error: S.optional(S.String), - }), - ).annotate({ identifier: "AddAssignmentsResponse" }); + channel_id: S.String, + leaving_team_ids: S.optional(__S(24, __c3, 0)), + }).pipe( + T.Http({ method: "POST", uri: "/admin.conversations.disconnectShared", code: 200 }), + ), + ).annotate({ identifier: "DisconnectSharedRequest" }); } } function __c48(j: number): any { @@ -5731,16 +12578,17 @@ function __c48(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_ids: __S(24, __c3, 0).pipe(T.Query()), - exclude: S.Boolean.pipe(T.Query()), + date_sessions_started: S.optional(S.Number), + date_end_of_support: S.optional(S.Number), }).pipe( T.Http({ - method: "GET", - uri: "/admin.conversations.bulkSetExcludeFromSlackAi", + method: "POST", + uri: "/admin.users.unsupportedVersions.export", code: 200, + contentType: "form-urlencoded", }), ), - ).annotate({ identifier: "BulkSetExcludeFromSlackAiRequest" }); + ).annotate({ identifier: "ExportUsersUnsupportedVersionRequest" }); } } function __c49(j: number): any { @@ -5748,25 +12596,16 @@ function __c49(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_ids: __S(24, __c3, 0), - property: S.String, - }).pipe( - T.Http({ - method: "POST", - uri: "/admin.conversations.bulkSetProperties", - code: 200, - contentType: "form-urlencoded", - }), - ), - ).annotate({ identifier: "BulkSetPropertiesRequest" }); + id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.fetch", code: 200 })), + ).annotate({ identifier: "FetchUsergroupRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - bulk_action_id: S.String, - not_updated: __S(345, __c43, 1), + subteam: S.Unknown, }), - ).annotate({ identifier: "BulkSetPropertiesResponse" }); + ).annotate({ identifier: "FetchUsergroupResponse" }); } } function __c50(j: number): any { @@ -5774,11 +12613,48 @@ function __c50(j: number): any { case 0: return S.suspend(() => S.Struct({ - request_id: S.String, - team_id: S.optional(S.String), - enterprise_id: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.requests.cancel", code: 200 })), - ).annotate({ identifier: "CancelAppsRequestRequest" }); + channel_id: S.String, + }).pipe( + T.Http({ method: "POST", uri: "/admin.conversations.getConversationPrefs", code: 200 }), + ), + ).annotate({ identifier: "GetConversationPrefsRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + type: S.optional(__S(24, __c3, 0)), + user: S.optional(__S(24, __c3, 0)), + }), + ).annotate({ identifier: "GetConversationPrefsResponsePrefsWhoCanPost" }); + case 2: + return S.suspend(() => + S.Struct({ + value: S.optional(S.Number), + }), + ).annotate({ identifier: "GetConversationPrefsResponsePrefsMembershipLimit" }); + case 3: + return S.suspend(() => + S.Struct({ + enabled: S.optional(S.Boolean), + }), + ).annotate({ identifier: "GetConversationPrefsResponsePrefsCanHuddle" }); + case 4: + return S.suspend(() => + S.Struct({ + who_can_post: S.optional(__S(401, __c50, 1)), + can_thread: S.optional(__S(401, __c50, 1)), + membership_limit: S.optional(__S(402, __c50, 2)), + can_huddle: S.optional(__S(403, __c50, 3)), + enable_at_channel: S.optional(__S(403, __c50, 3)), + enable_at_here: S.optional(__S(403, __c50, 3)), + }), + ).annotate({ identifier: "GetConversationPrefsResponsePrefs" }); + case 5: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + prefs: S.optional(__S(404, __c50, 4)), + }), + ).annotate({ identifier: "GetConversationPrefsResponse" }); } } function __c51(j: number): any { @@ -5786,481 +12662,545 @@ function __c51(j: number): any { case 0: return S.suspend(() => S.Struct({ - app_id: S.String, - team_id: S.optional(S.String), - enterprise_id: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.clearResolution", code: 200 })), - ).annotate({ identifier: "ClearResolutionRequest" }); - } -} -function __c52(j: number): any { - switch (j) { - case 0: + channel_id: S.String, + }).pipe( + T.Http({ method: "POST", uri: "/admin.conversations.getCustomRetention", code: 200 }), + ), + ).annotate({ identifier: "GetCustomRetentionRequest" }); + case 1: return S.suspend(() => S.Struct({ - user_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.clearSettings", code: 200 })), - ).annotate({ identifier: "ClearSettingsRequest" }); + ok: S.Boolean, + is_policy_enabled: S.Boolean, + duration_days: S.Number, + }), + ).annotate({ identifier: "GetCustomRetentionResponse" }); } } -function __c53(j: number): any { +function __c52(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - user_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.kick", code: 200 })), - ).annotate({ identifier: "ConversationsKickRequest" }); + policy_name: S.String, + entity_type: S.optional(S.Unknown), + limit: S.optional(S.Number), + cursor: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.auth.policy.getEntities", code: 200 })), + ).annotate({ identifier: "GetEntitiesRequest" }); case 1: return S.suspend(() => S.Struct({ - user_id: S.String, - error: S.String, + entity_type: S.String, + entity_id: S.String, + date_added: S.Number, }), - ).annotate({ identifier: "ConversationsKickResponseFailedUserIdsItem" }); + ).annotate({ identifier: "GetEntitiesResponseEntitiesItem" }); case 2: - return S.Array(__S(425, __c53, 1)); + return S.Array(__S(417, __c52, 1)); case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, - removed_user_ids: __S(24, __c3, 0), - failed_user_ids: __S(426, __c53, 2), + response_metadata: S.optional(__S(120, __c15, 0)), + entities: __S(418, __c52, 2), + entity_total_count: S.Number, }), - ).annotate({ identifier: "ConversationsKickResponse" }); + ).annotate({ identifier: "GetEntitiesResponse" }); } } -function __c54(j: number): any { +function __c53(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - name: S.optional(S.String), - }).pipe( - T.Http({ method: "POST", uri: "/admin.conversations.convertToPrivate", code: 200 }), - ), - ).annotate({ identifier: "ConvertToPrivateRequest" }); + user_id: S.String.pipe(T.Query()), + target_team: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.users.getExpiration", code: 200 })), + ).annotate({ identifier: "GetExpirationRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + id: S.String, + username: S.optional(S.String), + email: S.String, + is_restricted: S.Boolean, + is_ultra_restricted: S.Boolean, + expiration_ts: S.optional(S.Number), + }), + ).annotate({ identifier: "GetExpirationResponseUser" }); + case 2: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + user: S.optional(__S(425, __c53, 1)), + }), + ).annotate({ identifier: "GetExpirationResponse" }); } } -function __c55(j: number): any { +function __c54(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.convertToPublic", code: 200 })), - ).annotate({ identifier: "ConvertToPublicRequest" }); + date: S.optional(S.String.pipe(T.Query())), + type: S.String.pipe(T.Query()), + metadata_only: S.optional(S.Boolean.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.analytics.getFile", code: 200 })), + ).annotate({ identifier: "GetFileRequest" }); + case 1: + return S.suspend(() => S.Unknown.pipe(T.RawResponseRoot())).annotate({ + identifier: "GetFileResponse", + }); } } -function __c56(j: number): any { +function __c55(j: number): any { switch (j) { case 0: return S.suspend(() => - S.Struct({ - primary_usergroup_id: S.String, - barriered_from_usergroup_ids: __S(24, __c3, 0), - restricted_subjects: __S(464, __c58, 0), - }).pipe( - T.Http({ - method: "POST", - uri: "/admin.barriers.create", - code: 200, - contentType: "form-urlencoded", - }), + S.Struct({}).pipe( + T.Http({ method: "POST", uri: "/admin.audit.anomaly.allow.getItem", code: 200 }), ), - ).annotate({ identifier: "CreateBarrierRequest" }); - } -} -function __c57(j: number): any { - switch (j) { - case 0: + ).annotate({ identifier: "GetItemRequest" }); + case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - barrier: S.Unknown, + trusted_cidr: S.optional(__S(24, __c3, 0)), + trusted_asns: S.optional(__S(448, __c56, 0)), }), - ).annotate({ identifier: "CreateBarrierResponse" }); + ).annotate({ identifier: "GetItemResponse" }); } } -function __c58(j: number): any { +function __c56(j: number): any { switch (j) { case 0: - return S.Array(S.String); + return S.Array(S.Number); } } -function __c59(j: number): any { +function __c57(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - name: S.String, - description: S.optional(S.String), - is_private: S.Boolean, - org_wide: S.optional(S.Boolean), - team_id: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.create", code: 200 })), - ).annotate({ identifier: "CreateConversationRequest" }); + user_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.getSettings", code: 200 })), + ).annotate({ identifier: "GetSettingsRequest" }); case 1: return S.suspend(() => S.Struct({ - ok: S.Boolean, - channel_id: S.optional(S.String), + user_id: S.String, + desktop_app_browser_quit: S.Unknown, + duration: S.Unknown, }), - ).annotate({ identifier: "CreateConversationResponse" }); - } -} -function __c60(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - usergroup_id: S.String, - team_id: S.optional(S.String), - channel_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.addChannels", code: 200 })), - ).annotate({ identifier: "AddChannelsRequest" }); - } -} -function __c61(j: number): any { - switch (j) { - case 0: + ).annotate({ identifier: "GetSettingsResponseSessionSettingsItem" }); + case 2: + return S.Array(__S(457, __c57, 1)); + case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, - error: S.optional(S.String), - invalid_channels: S.optional(__S(24, __c3, 0)), + session_settings: S.optional(__S(458, __c57, 2)), + no_settings_applied: S.optional(__S(24, __c3, 0)), }), - ).annotate({ identifier: "AddChannelsResponse" }); + ).annotate({ identifier: "GetSettingsResponse" }); } } -function __c62(j: number): any { +function __c58(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - object_id: S.String, - salesforce_org_id: S.String, - invite_object_team: S.optional(S.Boolean), - }).pipe( - T.Http({ method: "POST", uri: "/admin.conversations.createForObjects", code: 200 }), - ), - ).annotate({ identifier: "CreateForObjectsRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, channel_id: S.String, - }), - ).annotate({ identifier: "CreateForObjectsResponse" }); - } -} -function __c63(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - team_domain: S.String, - team_name: S.String, - team_description: S.optional(S.String), - team_discoverability: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.teams.create", code: 200 })), - ).annotate({ identifier: "CreateTeamRequest" }); + cursor: S.optional(S.String), + limit: S.optional(S.Number), + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.getTeams", code: 200 })), + ).annotate({ identifier: "GetTeamsRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - team: S.String, + response_metadata: S.optional(__S(120, __c15, 0)), }), - ).annotate({ identifier: "CreateTeamResponse" }); + ).annotate({ identifier: "GetTeamsResponse" }); } } -function __c64(j: number): any { +function __c59(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - name: S.String, - handle: S.optional(S.String), - purpose: S.optional(S.String), - is_visible: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.create", code: 200 })), - ).annotate({ identifier: "CreateUsergroupRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - error: S.optional(S.String), - subteam: S.optional(S.Unknown), - }), - ).annotate({ identifier: "CreateUsergroupResponse" }); + user_id: S.String, + session_id: S.Number, + }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.invalidate", code: 200 })), + ).annotate({ identifier: "InvalidateUsersSessionRequest" }); } } -function __c65(j: number): any { +function __c60(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - user_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.users.deactivate", code: 200 })), - ).annotate({ identifier: "DeactivateUserRequest" }); + user_ids: __S(24, __c3, 0), + channel_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.invite", code: 200 })), + ).annotate({ identifier: "InviteConversationRequest" }); } } -function __c66(j: number): any { +function __c61(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - barrier_id: S.String, - }).pipe( - T.Http({ - method: "POST", - uri: "/admin.barriers.delete", - code: 200, - contentType: "form-urlencoded", - }), - ), - ).annotate({ identifier: "DeleteBarrierRequest" }); + team_id: S.optional(S.String), + invite_request_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.inviteRequests.deny", code: 200 })), + ).annotate({ identifier: "InviteRequestsDenyRequest" }); } } -function __c67(j: number): any { +function __c62(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.delete", code: 200 })), - ).annotate({ identifier: "DeleteConversationRequest" }); + team_id: S.String, + email: S.String, + channel_ids: S.String, + custom_message: S.optional(S.String), + real_name: S.optional(S.String), + resend: S.optional(S.Boolean), + is_restricted: S.optional(S.Boolean), + is_ultra_restricted: S.optional(S.Boolean), + guest_expiration_ts: S.optional(S.String), + email_password_policy_enabled: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/admin.users.invite", code: 200 })), + ).annotate({ identifier: "InviteUserRequest" }); } } -function __c68(j: number): any { +function __c63(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - leaving_team_ids: S.optional(__S(24, __c3, 0)), - }).pipe( - T.Http({ method: "POST", uri: "/admin.conversations.disconnectShared", code: 200 }), - ), - ).annotate({ identifier: "DisconnectSharedRequest" }); + channel: S.String, + record_id: S.String, + salesforce_org_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.linkObjects", code: 200 })), + ).annotate({ identifier: "LinkObjectsRequest" }); } } -function __c69(j: number): any { +function __c64(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - date_sessions_started: S.optional(S.Number), - date_end_of_support: S.optional(S.Number), + app_id: S.optional(S.String), + team_id: S.optional(S.String), + cursor: S.optional(S.String), + limit: S.optional(S.Number), + min_log_level: S.optional(S.String), + log_event_type: S.optional(S.String), + source: S.optional(S.String), + component_type: S.optional(S.String), + component_id: S.optional(S.String), + trace_id: S.optional(S.String), + min_date_created: S.optional(S.Number), + max_date_created: S.optional(S.Number), + sort_direction: S.optional(S.String), }).pipe( T.Http({ method: "POST", - uri: "/admin.users.unsupportedVersions.export", + uri: "/admin.apps.activities.list", code: 200, contentType: "form-urlencoded", }), ), - ).annotate({ identifier: "ExportUsersUnsupportedVersionRequest" }); + ).annotate({ identifier: "ListAppsActivitiesRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + activities: __S(520, __c65, 0), + response_metadata: S.optional(__S(120, __c15, 0)), + }), + ).annotate({ identifier: "ListAppsActivitiesResponse" }); } } -function __c70(j: number): any { +function __c65(j: number): any { + switch (j) { + case 0: + return S.Array(S.Unknown); + } +} +function __c66(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.fetch", code: 200 })), - ).annotate({ identifier: "FetchUsergroupRequest" }); + limit: S.optional(S.Number.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + team_id: S.optional(S.String.pipe(T.Query())), + enterprise_id: S.optional(S.String.pipe(T.Query())), + certified: S.optional(S.Boolean.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.apps.approved.list", code: 200 })), + ).annotate({ identifier: "ListAppsApprovedRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - subteam: S.Unknown, + approved_apps: __S(520, __c65, 0), + response_metadata: S.optional(__S(120, __c15, 0)), }), - ).annotate({ identifier: "FetchUsergroupResponse" }); + ).annotate({ identifier: "ListAppsApprovedResponse" }); } } -function __c71(j: number): any { +function __c67(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - }).pipe( - T.Http({ method: "POST", uri: "/admin.conversations.getConversationPrefs", code: 200 }), - ), - ).annotate({ identifier: "GetConversationPrefsRequest" }); + limit: S.optional(S.Number), + cursor: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.mcp.servers.list", code: 200 })), + ).annotate({ identifier: "ListAppsMcpServersRequest" }); case 1: return S.suspend(() => S.Struct({ - type: S.optional(__S(24, __c3, 0)), - user: S.optional(__S(24, __c3, 0)), - }), - ).annotate({ identifier: "GetConversationPrefsResponsePrefsWhoCanPost" }); - case 2: - return S.suspend(() => - S.Struct({ - value: S.optional(S.Number), + server_id: S.String, + server_name: S.String, + url: S.String, + auth_type: S.Unknown, + app_id: S.String, + app_name: S.String, }), - ).annotate({ identifier: "GetConversationPrefsResponsePrefsMembershipLimit" }); + ).annotate({ identifier: "ListAppsMcpServersResponseServersItem" }); + case 2: + return S.Array(__S(537, __c67, 1)); case 3: return S.suspend(() => S.Struct({ - enabled: S.optional(S.Boolean), + ok: S.Boolean, + servers: __S(538, __c67, 2), + response_metadata: S.optional(__S(120, __c15, 0)), }), - ).annotate({ identifier: "GetConversationPrefsResponsePrefsCanHuddle" }); - case 4: + ).annotate({ identifier: "ListAppsMcpServersResponse" }); + } +} +function __c68(j: number): any { + switch (j) { + case 0: return S.suspend(() => S.Struct({ - who_can_post: S.optional(__S(569, __c71, 1)), - can_thread: S.optional(__S(569, __c71, 1)), - membership_limit: S.optional(__S(570, __c71, 2)), - can_huddle: S.optional(__S(571, __c71, 3)), - enable_at_channel: S.optional(__S(571, __c71, 3)), - enable_at_here: S.optional(__S(571, __c71, 3)), - }), - ).annotate({ identifier: "GetConversationPrefsResponsePrefs" }); - case 5: + app_id: S.String, + }).pipe( + T.Http({ method: "POST", uri: "/admin.apps.mcp.servers.permissions.list", code: 200 }), + ), + ).annotate({ identifier: "ListAppsMcpServersPermissionsRequest" }); + case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - prefs: S.optional(__S(572, __c71, 4)), + servers: __S(520, __c65, 0), }), - ).annotate({ identifier: "GetConversationPrefsResponse" }); + ).annotate({ identifier: "ListAppsMcpServersPermissionsResponse" }); } } -function __c72(j: number): any { +function __c69(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - name: S.String.pipe(T.Query()), - url: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.emoji.add", code: 200 })), - ).annotate({ identifier: "AddEmojiRequest" }); + app_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.permissions.list", code: 200 })), + ).annotate({ identifier: "ListAppsPermissionsRequest" }); } } -function __c73(j: number): any { +function __c70(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - }).pipe( - T.Http({ method: "POST", uri: "/admin.conversations.getCustomRetention", code: 200 }), - ), - ).annotate({ identifier: "GetCustomRetentionRequest" }); + limit: S.optional(S.Number.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + team_id: S.optional(S.String.pipe(T.Query())), + enterprise_id: S.optional(S.String.pipe(T.Query())), + certified: S.optional(S.Boolean.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.apps.requests.list", code: 200 })), + ).annotate({ identifier: "ListAppsRequestsRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - is_policy_enabled: S.Boolean, - duration_days: S.Number, + app_requests: __S(520, __c65, 0), + response_metadata: S.optional(__S(120, __c15, 0)), }), - ).annotate({ identifier: "GetCustomRetentionResponse" }); + ).annotate({ identifier: "ListAppsRequestsResponse" }); } } -function __c74(j: number): any { +function __c71(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - policy_name: S.String, - entity_type: S.optional(S.Unknown), - limit: S.optional(S.Number), - cursor: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.auth.policy.getEntities", code: 200 })), - ).annotate({ identifier: "GetEntitiesRequest" }); + limit: S.optional(S.Number.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + team_id: S.optional(S.String.pipe(T.Query())), + enterprise_id: S.optional(S.String.pipe(T.Query())), + certified: S.optional(S.Boolean.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.apps.restricted.list", code: 200 })), + ).annotate({ identifier: "ListAppsRestrictedRequest" }); case 1: return S.suspend(() => S.Struct({ - entity_type: S.String, + ok: S.Boolean, + restricted_apps: __S(520, __c65, 0), + response_metadata: S.optional(__S(120, __c15, 0)), + }), + ).annotate({ identifier: "ListAppsRestrictedResponse" }); + } +} +function __c72(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + cursor: S.optional(S.String.pipe(T.Query())), + limit: S.optional(S.Number.pipe(T.Query())), + role_ids: S.optional(__S(24, __c3, 0).pipe(T.Query())), + entity_ids: S.optional(__S(24, __c3, 0).pipe(T.Query())), + sort_dir: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.roles.listAssignments", code: 200 })), + ).annotate({ identifier: "ListAssignmentsRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + role_id: S.String, entity_id: S.String, - date_added: S.Number, + user_id: S.String, + date_create: S.Number, }), - ).annotate({ identifier: "GetEntitiesResponseEntitiesItem" }); + ).annotate({ identifier: "ListAssignmentsResponseRoleAssignmentsItem" }); case 2: - return S.Array(__S(593, __c74, 1)); + return S.Array(__S(577, __c72, 1)); case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, - response_metadata: S.optional(__S(1064, __c133, 0)), - entities: __S(594, __c74, 2), - entity_total_count: S.Number, + error: S.optional(S.String), + role_assignments: __S(578, __c72, 2), + response_metadata: S.optional(__S(120, __c15, 0)), }), - ).annotate({ identifier: "GetEntitiesResponse" }); + ).annotate({ identifier: "ListAssignmentsResponse" }); } } -function __c75(j: number): any { +function __c73(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - user_id: S.String.pipe(T.Query()), - target_team: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.users.getExpiration", code: 200 })), - ).annotate({ identifier: "GetExpirationRequest" }); + limit: S.optional(S.Number.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.barriers.list", code: 200 })), + ).annotate({ identifier: "ListBarriersRequest" }); case 1: return S.suspend(() => S.Struct({ - id: S.String, - username: S.optional(S.String), - email: S.String, - is_restricted: S.Boolean, - is_ultra_restricted: S.Boolean, - expiration_ts: S.optional(S.Number), + ok: S.Boolean, + barriers: __S(520, __c65, 0), + response_metadata: S.optional(__S(120, __c15, 0)), }), - ).annotate({ identifier: "GetExpirationResponseUser" }); - case 2: + ).annotate({ identifier: "ListBarriersResponse" }); + } +} +function __c74(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + usergroup_id: S.String, + team_id: S.optional(S.String), + include_num_members: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.listChannels", code: 200 })), + ).annotate({ identifier: "ListChannelsRequest" }); + case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - user: S.optional(__S(601, __c75, 1)), + channels: __S(24, __c3, 0), + error: S.optional(S.String), }), - ).annotate({ identifier: "GetExpirationResponse" }); + ).annotate({ identifier: "ListChannelsResponse" }); } } -function __c76(j: number): any { +function __c75(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - date: S.optional(S.String.pipe(T.Query())), - type: S.String.pipe(T.Query()), - metadata_only: S.optional(S.Boolean.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.analytics.getFile", code: 200 })), - ).annotate({ identifier: "GetFileRequest" }); + cursor: S.optional(S.String.pipe(T.Query())), + limit: S.optional(S.Number.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.emoji.list", code: 200 })), + ).annotate({ identifier: "ListEmojiRequest" }); case 1: - return S.suspend(() => S.Unknown.pipe(T.RawResponseRoot())).annotate({ - identifier: "GetFileResponse", - }); + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + emoji: __S(608, __c76, 0), + response_metadata: S.optional(__S(120, __c15, 0)), + }), + ).annotate({ identifier: "ListEmojiResponse" }); + } +} +function __c76(j: number): any { + switch (j) { + case 0: + return S.Record(S.String, S.Unknown); } } function __c77(j: number): any { switch (j) { case 0: return S.suspend(() => - S.Struct({}).pipe( - T.Http({ method: "POST", uri: "/admin.audit.anomaly.allow.getItem", code: 200 }), - ), - ).annotate({ identifier: "GetItemRequest" }); + S.Struct({ + team_id: S.optional(S.String), + app_ids: __S(24, __c3, 0), + include_non_distributed_functions: S.optional(S.Boolean), + cursor: S.optional(S.String), + limit: S.optional(S.Number), + }).pipe(T.Http({ method: "POST", uri: "/admin.functions.list", code: 200 })), + ).annotate({ identifier: "ListFunctionsRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - trusted_cidr: S.optional(__S(24, __c3, 0)), - trusted_asns: S.optional(__S(624, __c78, 0)), + functions: __S(520, __c65, 0), + response_metadata: S.optional(__S(120, __c15, 0)), }), - ).annotate({ identifier: "GetItemResponse" }); + ).annotate({ identifier: "ListFunctionsResponse" }); } } function __c78(j: number): any { switch (j) { case 0: - return S.Array(S.Number); + return S.suspend(() => + S.Struct({ + channel_id: S.String.pipe(T.Query()), + team_id: S.optional(S.String.pipe(T.Query())), + }).pipe( + T.Http({ + method: "GET", + uri: "/admin.conversations.restrictAccess.listGroups", + code: 200, + }), + ), + ).annotate({ identifier: "ListGroupsRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + group_ids: __S(24, __c3, 0), + }), + ).annotate({ identifier: "ListGroupsResponse" }); } } function __c79(j: number): any { @@ -6268,27 +13208,19 @@ function __c79(j: number): any { case 0: return S.suspend(() => S.Struct({ - user_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.getSettings", code: 200 })), - ).annotate({ identifier: "GetSettingsRequest" }); + team_id: S.optional(S.String), + cursor: S.optional(S.String), + limit: S.optional(S.Number), + }).pipe(T.Http({ method: "POST", uri: "/admin.inviteRequests.list", code: 200 })), + ).annotate({ identifier: "ListInviteRequestsRequest" }); case 1: - return S.suspend(() => - S.Struct({ - user_id: S.String, - desktop_app_browser_quit: S.Unknown, - duration: S.Unknown, - }), - ).annotate({ identifier: "GetSettingsResponseSessionSettingsItem" }); - case 2: - return S.Array(__S(633, __c79, 1)); - case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, - session_settings: S.optional(__S(634, __c79, 2)), - no_settings_applied: S.optional(__S(24, __c3, 0)), + response_metadata: S.optional(__S(120, __c15, 0)), + invite_requests: __S(520, __c65, 0), }), - ).annotate({ identifier: "GetSettingsResponse" }); + ).annotate({ identifier: "ListInviteRequestsResponse" }); } } function __c80(j: number): any { @@ -6296,18 +13228,19 @@ function __c80(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, + team_id: S.optional(S.String), cursor: S.optional(S.String), limit: S.optional(S.Number), - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.getTeams", code: 200 })), - ).annotate({ identifier: "GetTeamsRequest" }); + }).pipe(T.Http({ method: "POST", uri: "/admin.inviteRequests.approved.list", code: 200 })), + ).annotate({ identifier: "ListInviteRequestsApprovedRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - response_metadata: S.optional(__S(1064, __c133, 0)), + response_metadata: S.optional(__S(120, __c15, 0)), + approved_requests: __S(520, __c65, 0), }), - ).annotate({ identifier: "GetTeamsResponse" }); + ).annotate({ identifier: "ListInviteRequestsApprovedResponse" }); } } function __c81(j: number): any { @@ -6315,10 +13248,19 @@ function __c81(j: number): any { case 0: return S.suspend(() => S.Struct({ - user_id: S.String, - session_id: S.Number, - }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.invalidate", code: 200 })), - ).annotate({ identifier: "InvalidateUsersSessionRequest" }); + team_id: S.optional(S.String), + cursor: S.optional(S.String), + limit: S.optional(S.Number), + }).pipe(T.Http({ method: "POST", uri: "/admin.inviteRequests.denied.list", code: 200 })), + ).annotate({ identifier: "ListInviteRequestsDeniedRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + response_metadata: S.optional(__S(120, __c15, 0)), + denied_requests: __S(520, __c65, 0), + }), + ).annotate({ identifier: "ListInviteRequestsDeniedResponse" }); } } function __c82(j: number): any { @@ -6326,21 +13268,89 @@ function __c82(j: number): any { case 0: return S.suspend(() => S.Struct({ - user_ids: __S(24, __c3, 0), - channel_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.invite", code: 200 })), - ).annotate({ identifier: "InviteConversationRequest" }); - } -} -function __c83(j: number): any { - switch (j) { + channel_ids: S.optional(S.String), + team_ids: S.optional(S.String), + limit: S.optional(S.Number), + cursor: S.optional(S.String), + }).pipe( + T.Http({ + method: "POST", + uri: "/admin.conversations.ekm.listOriginalConnectedChannelInfo", + code: 200, + contentType: "form-urlencoded", + }), + ), + ).annotate({ identifier: "ListOriginalConnectedChannelInfoRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + id: S.String, + internal_team_ids: __S(24, __c3, 0), + original_connected_host_id: S.String, + original_connected_channel_id: S.String, + }), + ).annotate({ identifier: "ListOriginalConnectedChannelInfoResponseChannelsItem" }); + case 2: + return S.Array(__S(657, __c82, 1)); + case 3: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + response_metadata: S.optional(__S(120, __c15, 0)), + channels: __S(658, __c82, 2), + }), + ).annotate({ identifier: "ListOriginalConnectedChannelInfoResponse" }); + } +} +function __c83(j: number): any { + switch (j) { case 0: return S.suspend(() => S.Struct({ - team_id: S.optional(S.String), - invite_request_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.inviteRequests.deny", code: 200 })), - ).annotate({ identifier: "InviteRequestsDenyRequest" }); + category: S.optional(S.String), + cursor: S.optional(S.String), + limit: S.optional(S.Number), + creator_ids: S.optional(__S(24, __c3, 0)), + publish_status: S.optional(S.String), + auto_enabled_status: S.optional(S.String), + sort: S.optional(S.String), + sort_dir: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.slackbot.skills.list", code: 200 })), + ).annotate({ identifier: "ListSlackbotSkillsRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + permission_type: S.String, + usergroup_ids: __S(24, __c3, 0), + }), + ).annotate({ identifier: "ListSlackbotSkillsResponseSkillsItemAutoEnabled" }); + case 2: + return S.suspend(() => + S.Struct({ + id: S.String, + display_name: S.String, + description: S.Unknown, + category: S.NullOr(S.String), + creator_id: S.Unknown, + date_created: S.Unknown, + date_updated: S.Unknown, + visibility: S.NullOr(S.String), + is_official: S.Boolean, + usage_count: S.Unknown, + library_count: S.Unknown, + auto_enabled: __S(665, __c83, 1), + }), + ).annotate({ identifier: "ListSlackbotSkillsResponseSkillsItem" }); + case 3: + return S.Array(__S(666, __c83, 2)); + case 4: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + skills: __S(667, __c83, 3), + response_metadata: S.optional(__S(120, __c15, 0)), + }), + ).annotate({ identifier: "ListSlackbotSkillsResponse" }); } } function __c84(j: number): any { @@ -6348,13 +13358,37 @@ function __c84(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.optional(S.String.pipe(T.Query())), - group_id: S.String.pipe(T.Query()), - channel_id: S.String.pipe(T.Query()), - }).pipe( - T.Http({ method: "GET", uri: "/admin.conversations.restrictAccess.addGroup", code: 200 }), - ), - ).annotate({ identifier: "AddGroupRequest" }); + limit: S.optional(S.Number), + cursor: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.teams.list", code: 200 })), + ).annotate({ identifier: "ListTeamsRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + user_id: S.String, + email: S.String, + }), + ).annotate({ identifier: "ListTeamsResponseTeamsItemPrimaryOwner" }); + case 2: + return S.suspend(() => + S.Struct({ + id: S.optional(S.String), + name: S.String, + discoverability: S.String, + primary_owner: __S(673, __c84, 1), + team_url: S.String, + }), + ).annotate({ identifier: "ListTeamsResponseTeamsItem" }); + case 3: + return S.Array(__S(674, __c84, 2)); + case 4: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + teams: __S(675, __c84, 3), + response_metadata: S.optional(__S(120, __c15, 0)), + }), + ).annotate({ identifier: "ListTeamsResponse" }); } } function __c85(j: number): any { @@ -6362,18 +13396,19 @@ function __c85(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String, - email: S.String, - channel_ids: S.String, - custom_message: S.optional(S.String), - real_name: S.optional(S.String), - resend: S.optional(S.Boolean), - is_restricted: S.optional(S.Boolean), - is_ultra_restricted: S.optional(S.Boolean), - guest_expiration_ts: S.optional(S.String), - email_password_policy_enabled: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.invite", code: 200 })), - ).annotate({ identifier: "InviteUserRequest" }); + limit: S.optional(S.Number.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + team_id: S.String.pipe(T.Query()), + }).pipe(T.Http({ method: "GET", uri: "/admin.teams.admins.list", code: 200 })), + ).annotate({ identifier: "ListTeamsAdminsRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + admin_ids: __S(24, __c3, 0), + response_metadata: S.optional(__S(120, __c15, 0)), + }), + ).annotate({ identifier: "ListTeamsAdminsResponse" }); } } function __c86(j: number): any { @@ -6381,11 +13416,19 @@ function __c86(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel: S.String, - record_id: S.String, - salesforce_org_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.linkObjects", code: 200 })), - ).annotate({ identifier: "LinkObjectsRequest" }); + team_id: S.String.pipe(T.Query()), + limit: S.optional(S.Number.pipe(T.Query())), + cursor: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/admin.teams.owners.list", code: 200 })), + ).annotate({ identifier: "ListTeamsOwnersRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + owner_ids: __S(24, __c3, 0), + response_metadata: S.optional(__S(120, __c15, 0)), + }), + ).annotate({ identifier: "ListTeamsOwnersResponse" }); } } function __c87(j: number): any { @@ -6393,279 +13436,292 @@ function __c87(j: number): any { case 0: return S.suspend(() => S.Struct({ - app_id: S.optional(S.String), team_id: S.optional(S.String), cursor: S.optional(S.String), + is_active: S.optional(S.Boolean), + include_deactivated_user_workspaces: S.optional(S.Boolean), + only_guests: S.optional(S.Boolean), + include_admins: S.optional(S.Boolean), + include_owners: S.optional(S.Boolean), limit: S.optional(S.Number), - min_log_level: S.optional(S.String), - log_event_type: S.optional(S.String), - source: S.optional(S.String), - component_type: S.optional(S.String), - component_id: S.optional(S.String), - trace_id: S.optional(S.String), - min_date_created: S.optional(S.Number), - max_date_created: S.optional(S.Number), - sort_direction: S.optional(S.String), - }).pipe( - T.Http({ - method: "POST", - uri: "/admin.apps.activities.list", - code: 200, - contentType: "form-urlencoded", - }), - ), - ).annotate({ identifier: "ListAppsActivitiesRequest" }); + }).pipe(T.Http({ method: "POST", uri: "/admin.users.list", code: 200 })), + ).annotate({ identifier: "ListUsersRequest" }); case 1: + return S.suspend(() => + S.Struct({ + id: S.String, + username: S.optional(S.String), + full_name: S.optional(S.String), + has_2fa: S.optional(S.Boolean), + has_sso: S.optional(S.Boolean), + email: S.String, + is_admin: S.Boolean, + is_owner: S.Boolean, + is_primary_owner: S.Boolean, + is_restricted: S.Boolean, + is_ultra_restricted: S.Boolean, + is_bot: S.Boolean, + expiration_ts: S.optional(S.Number), + roles: S.optional(__S(24, __c3, 0)), + last_active_ts: S.optional(S.Number), + workspaces: S.optional(__S(24, __c3, 0)), + is_active: S.optional(S.Boolean), + date_created: S.optional(S.Number), + deactivated_ts: S.optional(S.Number), + }), + ).annotate({ identifier: "ListUsersResponseUsersItem" }); + case 2: + return S.Array(__S(697, __c87, 1)); + case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, - activities: __S(704, __c88, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), + users: __S(698, __c87, 2), + response_metadata: S.optional(__S(120, __c15, 0)), }), - ).annotate({ identifier: "ListAppsActivitiesResponse" }); + ).annotate({ identifier: "ListUsersResponse" }); } } function __c88(j: number): any { - switch (j) { - case 0: - return S.Array(S.Unknown); - } -} -function __c89(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - limit: S.optional(S.Number.pipe(T.Query())), - cursor: S.optional(S.String.pipe(T.Query())), - team_id: S.optional(S.String.pipe(T.Query())), - enterprise_id: S.optional(S.String.pipe(T.Query())), - certified: S.optional(S.Boolean.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.apps.approved.list", code: 200 })), - ).annotate({ identifier: "ListAppsApprovedRequest" }); + team_id: S.optional(S.String), + user_id: S.optional(S.String), + limit: S.optional(S.Number), + cursor: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.list", code: 200 })), + ).annotate({ identifier: "ListUsersSessionRequest" }); case 1: + return S.suspend(() => + S.Struct({ + device_hardware: S.optional(S.String), + os: S.optional(S.String), + os_version: S.optional(S.String), + slack_client_version: S.optional(S.String), + ip: S.optional(S.String), + }), + ).annotate({ identifier: "ListUsersSessionResponseActiveSessionsItemRecent" }); + case 2: + return S.suspend(() => + S.Struct({ + user_id: S.String, + team_id: S.String, + session_id: S.Number, + recent: S.optional(__S(705, __c88, 1)), + created: __S(705, __c88, 1), + }), + ).annotate({ identifier: "ListUsersSessionResponseActiveSessionsItem" }); + case 3: + return S.Array(__S(706, __c88, 2)); + case 4: return S.suspend(() => S.Struct({ ok: S.Boolean, - approved_apps: __S(704, __c88, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), + response_metadata: S.optional(__S(120, __c15, 0)), + active_sessions: __S(707, __c88, 3), }), - ).annotate({ identifier: "ListAppsApprovedResponse" }); + ).annotate({ identifier: "ListUsersSessionResponse" }); } } -function __c90(j: number): any { +function __c89(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - limit: S.optional(S.Number), - cursor: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.mcp.servers.list", code: 200 })), - ).annotate({ identifier: "ListAppsMcpServersRequest" }); + app_ids: S.optional(__S(24, __c3, 0)), + rich_link_preview_types: S.optional(__S(304, __c38, 0)), + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.config.lookup", code: 200 })), + ).annotate({ identifier: "LookupAppsConfigRequest" }); case 1: return S.suspend(() => S.Struct({ - server_id: S.String, - server_name: S.String, - url: S.String, - auth_type: S.Unknown, app_id: S.String, - app_name: S.String, + workflow_auth_strategy: S.String, + domain_restrictions: S.Unknown, + rich_link_preview_type: S.optional(S.String), }), - ).annotate({ identifier: "ListAppsMcpServersResponseServersItem" }); + ).annotate({ identifier: "LookupAppsConfigResponseConfigsItem" }); case 2: - return S.Array(__S(721, __c90, 1)); + return S.Array(__S(713, __c89, 1)); case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, - servers: __S(722, __c90, 2), - response_metadata: S.optional(__S(1064, __c133, 0)), + configs: __S(714, __c89, 2), }), - ).annotate({ identifier: "ListAppsMcpServersResponse" }); + ).annotate({ identifier: "LookupAppsConfigResponse" }); } } -function __c91(j: number): any { +function __c90(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - app_id: S.String, + team_ids: __S(24, __c3, 0), + max_member_count: S.optional(S.Number), + last_message_activity_before: S.Number, + cursor: S.optional(S.String), + limit: S.optional(S.Number), }).pipe( - T.Http({ method: "POST", uri: "/admin.apps.mcp.servers.permissions.list", code: 200 }), + T.Http({ + method: "POST", + uri: "/admin.conversations.lookup", + code: 200, + contentType: "form-urlencoded", + }), ), - ).annotate({ identifier: "ListAppsMcpServersPermissionsRequest" }); + ).annotate({ identifier: "LookupConversationRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - servers: __S(704, __c88, 0), + channel_ids: __S(24, __c3, 0), + response_metadata: S.optional(__S(120, __c15, 0)), }), - ).annotate({ identifier: "ListAppsMcpServersPermissionsResponse" }); - } -} -function __c92(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - app_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.permissions.list", code: 200 })), - ).annotate({ identifier: "ListAppsPermissionsRequest" }); + ).annotate({ identifier: "LookupConversationResponse" }); } } -function __c93(j: number): any { +function __c91(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - limit: S.optional(S.Number.pipe(T.Query())), - cursor: S.optional(S.String.pipe(T.Query())), - team_id: S.optional(S.String.pipe(T.Query())), - enterprise_id: S.optional(S.String.pipe(T.Query())), - certified: S.optional(S.Boolean.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.apps.requests.list", code: 200 })), - ).annotate({ identifier: "ListAppsRequestsRequest" }); + function_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.functions.permissions.lookup", code: 200 })), + ).annotate({ identifier: "LookupFunctionsPermissionsRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - app_requests: __S(704, __c88, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), + permissions: __S(608, __c76, 0), + metadata: __S(608, __c76, 0), + errors: __S(608, __c76, 0), }), - ).annotate({ identifier: "ListAppsRequestsResponse" }); + ).annotate({ identifier: "LookupFunctionsPermissionsResponse" }); } } -function __c94(j: number): any { +function __c92(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - limit: S.optional(S.Number.pipe(T.Query())), - cursor: S.optional(S.String.pipe(T.Query())), - team_id: S.optional(S.String.pipe(T.Query())), - enterprise_id: S.optional(S.String.pipe(T.Query())), - certified: S.optional(S.Boolean.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.apps.restricted.list", code: 200 })), - ).annotate({ identifier: "ListAppsRestrictedRequest" }); + workflow_ids: __S(24, __c3, 0), + max_workflow_triggers: S.optional(S.Number), + }).pipe(T.Http({ method: "POST", uri: "/admin.workflows.permissions.lookup", code: 200 })), + ).annotate({ identifier: "LookupWorkflowsPermissionsRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - restricted_apps: __S(704, __c88, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), + permissions: __S(608, __c76, 0), }), - ).annotate({ identifier: "ListAppsRestrictedResponse" }); + ).annotate({ identifier: "LookupWorkflowsPermissionsResponse" }); } } -function __c95(j: number): any { +function __c93(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - cursor: S.optional(S.String.pipe(T.Query())), - limit: S.optional(S.Number.pipe(T.Query())), - role_ids: S.optional(__S(24, __c3, 0).pipe(T.Query())), - entity_ids: S.optional(__S(24, __c3, 0).pipe(T.Query())), - sort_dir: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.roles.listAssignments", code: 200 })), - ).annotate({ identifier: "ListAssignmentsRequest" }); + trigger_type_ids: __S(24, __c3, 0), + }).pipe( + T.Http({ + method: "POST", + uri: "/admin.workflows.triggers.types.permissions.lookup", + code: 200, + }), + ), + ).annotate({ identifier: "LookupWorkflowsTriggersTypesPermissionsRequest" }); case 1: - return S.suspend(() => - S.Struct({ - role_id: S.String, - entity_id: S.String, - user_id: S.String, - date_create: S.Number, - }), - ).annotate({ identifier: "ListAssignmentsResponseRoleAssignmentsItem" }); - case 2: - return S.Array(__S(761, __c95, 1)); - case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, - error: S.optional(S.String), - role_assignments: __S(762, __c95, 2), - response_metadata: S.optional(__S(1064, __c133, 0)), + permissions: __S(608, __c76, 0), + metadata: __S(608, __c76, 0), }), - ).annotate({ identifier: "ListAssignmentsResponse" }); + ).annotate({ identifier: "LookupWorkflowsTriggersTypesPermissionsResponse" }); } } -function __c96(j: number): any { +function __c94(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - usergroup_id: S.String, - team_ids: __S(24, __c3, 0), - auto_provision: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.addTeams", code: 200 })), - ).annotate({ identifier: "AddTeamsRequest" }); + user_ids: __S(24, __c3, 0), + reason: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.users.access.pause", code: 200 })), + ).annotate({ identifier: "PauseUsersAccessRequest" }); } } -function __c97(j: number): any { +function __c95(j: number): any { switch (j) { case 0: - return S.suspend(() => - S.Struct({ - limit: S.optional(S.Number.pipe(T.Query())), - cursor: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.barriers.list", code: 200 })), - ).annotate({ identifier: "ListBarriersRequest" }); - case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - barriers: __S(704, __c88, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), + invalid_users: __S(97, __c12, 1), }), - ).annotate({ identifier: "ListBarriersResponse" }); + ).annotate({ identifier: "PauseUsersAccessResponse" }); } } -function __c98(j: number): any { +function __c96(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - usergroup_id: S.String, - team_id: S.optional(S.String), - include_num_members: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.listChannels", code: 200 })), - ).annotate({ identifier: "ListChannelsRequest" }); - case 1: + skill_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.slackbot.skills.publish", code: 200 })), + ).annotate({ identifier: "PublishSlackbotSkillRequest" }); + } +} +function __c97(j: number): any { + switch (j) { + case 0: return S.suspend(() => S.Struct({ - ok: S.Boolean, - channels: __S(24, __c3, 0), - error: S.optional(S.String), - }), - ).annotate({ identifier: "ListChannelsResponse" }); + app_id: S.String, + user_ids: S.optional(__S(24, __c3, 0)), + usergroup_ids: S.optional(__S(24, __c3, 0)), + channel_ids: S.optional(__S(24, __c3, 0)), + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.permissions.remove", code: 200 })), + ).annotate({ identifier: "RemoveAppsPermissionsRequest" }); } } -function __c99(j: number): any { +function __c98(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - cursor: S.optional(S.String.pipe(T.Query())), - limit: S.optional(S.Number.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.emoji.list", code: 200 })), - ).annotate({ identifier: "ListEmojiRequest" }); - case 1: + role_id: S.String, + entity_ids: __S(24, __c3, 0), + user_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.roles.removeAssignments", code: 200 })), + ).annotate({ identifier: "RemoveAssignmentsRequest" }); + } +} +function __c99(j: number): any { + switch (j) { + case 0: return S.suspend(() => S.Struct({ - ok: S.Boolean, - emoji: __S(800, __c100, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), - }), - ).annotate({ identifier: "ListEmojiResponse" }); + usergroup_id: S.String, + channel_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.removeChannels", code: 200 })), + ).annotate({ identifier: "RemoveChannelsRequest" }); } } function __c100(j: number): any { switch (j) { case 0: - return S.Record(S.String, S.Unknown); + return S.suspend(() => + S.Struct({ + channel_id: S.String, + }).pipe( + T.Http({ method: "POST", uri: "/admin.conversations.removeCustomRetention", code: 200 }), + ), + ).annotate({ identifier: "RemoveCustomRetentionRequest" }); } } function __c101(j: number): any { @@ -6673,65 +13729,39 @@ function __c101(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.optional(S.String), - app_ids: __S(24, __c3, 0), - include_non_distributed_functions: S.optional(S.Boolean), - cursor: S.optional(S.String), - limit: S.optional(S.Number), - }).pipe(T.Http({ method: "POST", uri: "/admin.functions.list", code: 200 })), - ).annotate({ identifier: "ListFunctionsRequest" }); - case 1: + name: S.String.pipe(T.Query()), + }).pipe(T.Http({ method: "GET", uri: "/admin.emoji.remove", code: 200 })), + ).annotate({ identifier: "RemoveEmojiRequest" }); + } +} +function __c102(j: number): any { + switch (j) { + case 0: return S.suspend(() => S.Struct({ - ok: S.Boolean, - functions: __S(704, __c88, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), - }), - ).annotate({ identifier: "ListFunctionsResponse" }); + policy_name: S.String, + entity_type: S.Unknown, + entity_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.auth.policy.removeEntities", code: 200 })), + ).annotate({ identifier: "RemoveEntitiesRequest" }); } } -function __c102(j: number): any { +function __c103(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ + team_id: S.String.pipe(T.Query()), + group_id: S.String.pipe(T.Query()), channel_id: S.String.pipe(T.Query()), - team_id: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", - uri: "/admin.conversations.restrictAccess.listGroups", + uri: "/admin.conversations.restrictAccess.removeGroup", code: 200, }), ), - ).annotate({ identifier: "ListGroupsRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - group_ids: __S(24, __c3, 0), - }), - ).annotate({ identifier: "ListGroupsResponse" }); - } -} -function __c103(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - team_id: S.optional(S.String), - cursor: S.optional(S.String), - limit: S.optional(S.Number), - }).pipe(T.Http({ method: "POST", uri: "/admin.inviteRequests.list", code: 200 })), - ).annotate({ identifier: "ListInviteRequestsRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - response_metadata: S.optional(__S(1064, __c133, 0)), - invite_requests: __S(704, __c88, 0), - }), - ).annotate({ identifier: "ListInviteRequestsResponse" }); + ).annotate({ identifier: "RemoveGroupRequest" }); } } function __c104(j: number): any { @@ -6739,19 +13769,10 @@ function __c104(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.optional(S.String), - cursor: S.optional(S.String), - limit: S.optional(S.Number), - }).pipe(T.Http({ method: "POST", uri: "/admin.inviteRequests.approved.list", code: 200 })), - ).annotate({ identifier: "ListInviteRequestsApprovedRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - response_metadata: S.optional(__S(1064, __c133, 0)), - approved_requests: __S(704, __c88, 0), - }), - ).annotate({ identifier: "ListInviteRequestsApprovedResponse" }); + usergroup_id: S.String, + team_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.removeTeams", code: 200 })), + ).annotate({ identifier: "RemoveTeamsRequest" }); } } function __c105(j: number): any { @@ -6759,58 +13780,21 @@ function __c105(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.optional(S.String), - cursor: S.optional(S.String), - limit: S.optional(S.Number), - }).pipe(T.Http({ method: "POST", uri: "/admin.inviteRequests.denied.list", code: 200 })), - ).annotate({ identifier: "ListInviteRequestsDeniedRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - response_metadata: S.optional(__S(1064, __c133, 0)), - denied_requests: __S(704, __c88, 0), - }), - ).annotate({ identifier: "ListInviteRequestsDeniedResponse" }); + team_id: S.String, + user_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.users.remove", code: 200 })), + ).annotate({ identifier: "RemoveUserRequest" }); } } function __c106(j: number): any { switch (j) { case 0: - return S.suspend(() => - S.Struct({ - channel_ids: S.optional(S.String), - team_ids: S.optional(S.String), - limit: S.optional(S.Number), - cursor: S.optional(S.String), - }).pipe( - T.Http({ - method: "POST", - uri: "/admin.conversations.ekm.listOriginalConnectedChannelInfo", - code: 200, - contentType: "form-urlencoded", - }), - ), - ).annotate({ identifier: "ListOriginalConnectedChannelInfoRequest" }); - case 1: return S.suspend(() => S.Struct({ id: S.String, - internal_team_ids: __S(24, __c3, 0), - original_connected_host_id: S.String, - original_connected_channel_id: S.String, - }), - ).annotate({ identifier: "ListOriginalConnectedChannelInfoResponseChannelsItem" }); - case 2: - return S.Array(__S(849, __c106, 1)); - case 3: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - response_metadata: S.optional(__S(1064, __c133, 0)), - channels: __S(850, __c106, 2), - }), - ).annotate({ identifier: "ListOriginalConnectedChannelInfoResponse" }); + users: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.removeUsers", code: 200 })), + ).annotate({ identifier: "RemoveUsersRequest" }); } } function __c107(j: number): any { @@ -6818,50 +13802,12 @@ function __c107(j: number): any { case 0: return S.suspend(() => S.Struct({ - category: S.optional(S.String), - cursor: S.optional(S.String), - limit: S.optional(S.Number), - creator_ids: S.optional(__S(24, __c3, 0)), - publish_status: S.optional(S.String), - auto_enabled_status: S.optional(S.String), - sort: S.optional(S.String), - sort_dir: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.slackbot.skills.list", code: 200 })), - ).annotate({ identifier: "ListSlackbotSkillsRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - permission_type: S.String, - usergroup_ids: __S(24, __c3, 0), - }), - ).annotate({ identifier: "ListSlackbotSkillsResponseSkillsItemAutoEnabled" }); - case 2: - return S.suspend(() => - S.Struct({ - id: S.String, - display_name: S.String, - description: S.Unknown, - category: S.NullOr(S.String), - creator_id: S.Unknown, - date_created: S.Unknown, - date_updated: S.Unknown, - visibility: S.NullOr(S.String), - is_official: S.Boolean, - usage_count: S.Unknown, - library_count: S.Unknown, - auto_enabled: __S(857, __c107, 1), - }), - ).annotate({ identifier: "ListSlackbotSkillsResponseSkillsItem" }); - case 3: - return S.Array(__S(858, __c107, 2)); - case 4: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - skills: __S(859, __c107, 3), - response_metadata: S.optional(__S(1064, __c133, 0)), - }), - ).annotate({ identifier: "ListSlackbotSkillsResponse" }); + workflow_ids: __S(24, __c3, 0), + collaborator_ids: __S(24, __c3, 0), + }).pipe( + T.Http({ method: "POST", uri: "/admin.workflows.collaborators.remove", code: 200 }), + ), + ).annotate({ identifier: "RemoveWorkflowsCollaboratorRequest" }); } } function __c108(j: number): any { @@ -6869,18 +13815,10 @@ function __c108(j: number): any { case 0: return S.suspend(() => S.Struct({ - id: S.String, - users: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.addUsers", code: 200 })), - ).annotate({ identifier: "AddUsersRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - error: S.optional(S.String), - invalid_users: S.optional(__S(873, __c109, 1)), - }), - ).annotate({ identifier: "AddUsersResponse" }); + channel_id: S.String, + name: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.rename", code: 200 })), + ).annotate({ identifier: "RenameConversationRequest" }); } } function __c109(j: number): any { @@ -6888,12 +13826,10 @@ function __c109(j: number): any { case 0: return S.suspend(() => S.Struct({ - user_id: S.String, - reason: S.String, - }), - ).annotate({ identifier: "AddUsersResponseInvalidUsersItem" }); - case 1: - return S.Array(__S(872, __c109, 0)); + name: S.String.pipe(T.Query()), + new_name: S.String.pipe(T.Query()), + }).pipe(T.Http({ method: "GET", uri: "/admin.emoji.rename", code: 200 })), + ).annotate({ identifier: "RenameEmojiRequest" }); } } function __c110(j: number): any { @@ -6901,37 +13837,11 @@ function __c110(j: number): any { case 0: return S.suspend(() => S.Struct({ - limit: S.optional(S.Number), - cursor: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.teams.list", code: 200 })), - ).annotate({ identifier: "ListTeamsRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - user_id: S.String, - email: S.String, - }), - ).annotate({ identifier: "ListTeamsResponseTeamsItemPrimaryOwner" }); - case 2: - return S.suspend(() => - S.Struct({ - id: S.optional(S.String), - name: S.String, - discoverability: S.String, - primary_owner: __S(881, __c110, 1), - team_url: S.String, - }), - ).annotate({ identifier: "ListTeamsResponseTeamsItem" }); - case 3: - return S.Array(__S(882, __c110, 2)); - case 4: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - teams: __S(883, __c110, 3), - response_metadata: S.optional(__S(1064, __c133, 0)), - }), - ).annotate({ identifier: "ListTeamsResponse" }); + user_ids: __S(24, __c3, 0), + mobile_only: S.optional(S.Boolean), + web_only: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.resetBulk", code: 200 })), + ).annotate({ identifier: "ResetBulkRequest" }); } } function __c111(j: number): any { @@ -6939,19 +13849,11 @@ function __c111(j: number): any { case 0: return S.suspend(() => S.Struct({ - limit: S.optional(S.Number.pipe(T.Query())), - cursor: S.optional(S.String.pipe(T.Query())), - team_id: S.String.pipe(T.Query()), - }).pipe(T.Http({ method: "GET", uri: "/admin.teams.admins.list", code: 200 })), - ).annotate({ identifier: "ListTeamsAdminsRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - admin_ids: __S(24, __c3, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), - }), - ).annotate({ identifier: "ListTeamsAdminsResponse" }); + user_id: S.String, + mobile_only: S.optional(S.Boolean), + web_only: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.reset", code: 200 })), + ).annotate({ identifier: "ResetUsersSessionRequest" }); } } function __c112(j: number): any { @@ -6959,19 +13861,10 @@ function __c112(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String.pipe(T.Query()), - limit: S.optional(S.Number.pipe(T.Query())), - cursor: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.teams.owners.list", code: 200 })), - ).annotate({ identifier: "ListTeamsOwnersRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - owner_ids: __S(24, __c3, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), - }), - ).annotate({ identifier: "ListTeamsOwnersResponse" }); + user_ids: __S(24, __c3, 0), + reason: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.users.access.resume", code: 200 })), + ).annotate({ identifier: "ResumeUsersAccessRequest" }); } } function __c113(j: number): any { @@ -6979,50 +13872,28 @@ function __c113(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.optional(S.String), - cursor: S.optional(S.String), - is_active: S.optional(S.Boolean), - include_deactivated_user_workspaces: S.optional(S.Boolean), - only_guests: S.optional(S.Boolean), - include_admins: S.optional(S.Boolean), - include_owners: S.optional(S.Boolean), + team_ids: S.optional(__S(24, __c3, 0)), + connected_team_ids: S.optional(__S(24, __c3, 0)), + query: S.optional(S.String), limit: S.optional(S.Number), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.list", code: 200 })), - ).annotate({ identifier: "ListUsersRequest" }); + cursor: S.optional(S.String), + search_channel_types: S.optional(__S(24, __c3, 0)), + sort: S.optional(S.String), + sort_dir: S.optional(S.String), + total_count_only: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.search", code: 200 })), + ).annotate({ identifier: "SearchConversationRequest" }); case 1: - return S.suspend(() => - S.Struct({ - id: S.String, - username: S.optional(S.String), - full_name: S.optional(S.String), - has_2fa: S.optional(S.Boolean), - has_sso: S.optional(S.Boolean), - email: S.String, - is_admin: S.Boolean, - is_owner: S.Boolean, - is_primary_owner: S.Boolean, - is_restricted: S.Boolean, - is_ultra_restricted: S.Boolean, - is_bot: S.Boolean, - expiration_ts: S.optional(S.Number), - roles: S.optional(__S(24, __c3, 0)), - last_active_ts: S.optional(S.Number), - workspaces: S.optional(__S(24, __c3, 0)), - is_active: S.optional(S.Boolean), - date_created: S.optional(S.Number), - deactivated_ts: S.optional(S.Number), - }), - ).annotate({ identifier: "ListUsersResponseUsersItem" }); - case 2: - return S.Array(__S(905, __c113, 1)); - case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, - users: __S(906, __c113, 2), - response_metadata: S.optional(__S(1064, __c133, 0)), + conversations: __S(24, __c3, 0), + next_cursor: S.String, + total_count: S.Number, + error: S.optional(S.String), + response_metadata: S.optional(__S(120, __c15, 0)), }), - ).annotate({ identifier: "ListUsersResponse" }); + ).annotate({ identifier: "SearchConversationResponse" }); } } function __c114(j: number): any { @@ -7030,42 +13901,31 @@ function __c114(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.optional(S.String), - user_id: S.optional(S.String), - limit: S.optional(S.Number), + query: S.optional(S.String), + app_id: S.optional(S.String), cursor: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.list", code: 200 })), - ).annotate({ identifier: "ListUsersSessionRequest" }); + limit: S.optional(S.Number), + no_collaborators: S.optional(S.Boolean), + collaborator_ids: S.optional(__S(24, __c3, 0)), + num_trigger_ids: S.optional(S.Number), + is_sales_elevate: S.optional(S.Boolean), + source: S.optional(S.String), + sort: S.optional(S.String), + sort_dir: S.optional(S.String), + trigger_type_id: S.optional(S.String), + publish_status: S.optional(S.String), + step_function_ids: S.optional(__S(24, __c3, 0)), + }).pipe(T.Http({ method: "POST", uri: "/admin.workflows.search", code: 200 })), + ).annotate({ identifier: "SearchWorkflowRequest" }); case 1: - return S.suspend(() => - S.Struct({ - device_hardware: S.optional(S.String), - os: S.optional(S.String), - os_version: S.optional(S.String), - slack_client_version: S.optional(S.String), - ip: S.optional(S.String), - }), - ).annotate({ identifier: "ListUsersSessionResponseActiveSessionsItemRecent" }); - case 2: - return S.suspend(() => - S.Struct({ - user_id: S.String, - team_id: S.String, - session_id: S.Number, - recent: S.optional(__S(913, __c114, 1)), - created: __S(913, __c114, 1), - }), - ).annotate({ identifier: "ListUsersSessionResponseActiveSessionsItem" }); - case 3: - return S.Array(__S(914, __c114, 2)); - case 4: return S.suspend(() => S.Struct({ ok: S.Boolean, - response_metadata: S.optional(__S(1064, __c133, 0)), - active_sessions: __S(915, __c114, 3), + workflows: __S(520, __c65, 0), + response_metadata: S.optional(__S(120, __c15, 0)), + total_found: S.Number, }), - ).annotate({ identifier: "ListUsersSessionResponse" }); + ).annotate({ identifier: "SearchWorkflowResponse" }); } } function __c115(j: number): any { @@ -7073,28 +13933,10 @@ function __c115(j: number): any { case 0: return S.suspend(() => S.Struct({ - app_ids: S.optional(__S(24, __c3, 0)), - rich_link_preview_types: S.optional(__S(464, __c58, 0)), - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.config.lookup", code: 200 })), - ).annotate({ identifier: "LookupAppsConfigRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - app_id: S.String, - workflow_auth_strategy: S.String, - domain_restrictions: S.Unknown, - rich_link_preview_type: S.optional(S.String), - }), - ).annotate({ identifier: "LookupAppsConfigResponseConfigsItem" }); - case 2: - return S.Array(__S(921, __c115, 1)); - case 3: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - configs: __S(922, __c115, 2), - }), - ).annotate({ identifier: "LookupAppsConfigResponse" }); + team_id: S.String, + user_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.users.setAdmin", code: 200 })), + ).annotate({ identifier: "SetAdminRequest" }); } } function __c116(j: number): any { @@ -7102,28 +13944,19 @@ function __c116(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_ids: __S(24, __c3, 0), - max_member_count: S.optional(S.Number), - last_message_activity_before: S.Number, - cursor: S.optional(S.String), - limit: S.optional(S.Number), - }).pipe( - T.Http({ - method: "POST", - uri: "/admin.conversations.lookup", - code: 200, - contentType: "form-urlencoded", - }), - ), - ).annotate({ identifier: "LookupConversationRequest" }); + urls: S.optional(__S(24, __c3, 0)), + emails: S.optional(__S(24, __c3, 0)), + }), + ).annotate({ identifier: "SetAppsConfigRequestDomainRestrictions" }); case 1: return S.suspend(() => S.Struct({ - ok: S.Boolean, - channel_ids: __S(24, __c3, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), - }), - ).annotate({ identifier: "LookupConversationResponse" }); + app_id: S.String, + workflow_auth_strategy: S.optional(S.String), + rich_link_preview_type: S.optional(S.String), + domain_restrictions: S.optional(__S(928, __c116, 0)), + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.config.set", code: 200 })), + ).annotate({ identifier: "SetAppsConfigRequest" }); } } function __c117(j: number): any { @@ -7131,18 +13964,15 @@ function __c117(j: number): any { case 0: return S.suspend(() => S.Struct({ - function_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.functions.permissions.lookup", code: 200 })), - ).annotate({ identifier: "LookupFunctionsPermissionsRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - permissions: __S(800, __c100, 0), - metadata: __S(800, __c100, 0), - errors: __S(800, __c100, 0), - }), - ).annotate({ identifier: "LookupFunctionsPermissionsResponse" }); + app_id: S.String, + server_id: S.String, + permission_type: S.String, + user_ids: S.optional(__S(24, __c3, 0)), + usergroup_ids: S.optional(__S(24, __c3, 0)), + }).pipe( + T.Http({ method: "POST", uri: "/admin.apps.mcp.servers.permissions.set", code: 200 }), + ), + ).annotate({ identifier: "SetAppsMcpServersPermissionsRequest" }); } } function __c118(j: number): any { @@ -7150,17 +13980,14 @@ function __c118(j: number): any { case 0: return S.suspend(() => S.Struct({ - workflow_ids: __S(24, __c3, 0), - max_workflow_triggers: S.optional(S.Number), - }).pipe(T.Http({ method: "POST", uri: "/admin.workflows.permissions.lookup", code: 200 })), - ).annotate({ identifier: "LookupWorkflowsPermissionsRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - permissions: __S(800, __c100, 0), - }), - ).annotate({ identifier: "LookupWorkflowsPermissionsResponse" }); + app_id: S.String, + permission_type: S.String, + user_ids: S.optional(__S(24, __c3, 0)), + usergroup_ids: S.optional(__S(24, __c3, 0)), + channel_restriction_mode: S.optional(S.String), + channel_ids: S.optional(__S(24, __c3, 0)), + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.permissions.set", code: 200 })), + ).annotate({ identifier: "SetAppsPermissionsRequest" }); } } function __c119(j: number): any { @@ -7168,23 +13995,22 @@ function __c119(j: number): any { case 0: return S.suspend(() => S.Struct({ - trigger_type_ids: __S(24, __c3, 0), + skill_id: S.String, + permission_type: S.String, + usergroup_ids: S.optional(__S(24, __c3, 0)), }).pipe( - T.Http({ - method: "POST", - uri: "/admin.workflows.triggers.types.permissions.lookup", - code: 200, - }), + T.Http({ method: "POST", uri: "/admin.slackbot.skills.setAutoEnabled", code: 200 }), ), - ).annotate({ identifier: "LookupWorkflowsTriggersTypesPermissionsRequest" }); + ).annotate({ identifier: "SetAutoEnabledRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - permissions: __S(800, __c100, 0), - metadata: __S(800, __c100, 0), + skill_id: S.String, + permission_type: S.String, + usergroup_ids: __S(24, __c3, 0), }), - ).annotate({ identifier: "LookupWorkflowsTriggersTypesPermissionsResponse" }); + ).annotate({ identifier: "SetAutoEnabledResponse" }); } } function __c120(j: number): any { @@ -7192,10 +14018,12 @@ function __c120(j: number): any { case 0: return S.suspend(() => S.Struct({ - workflow_ids: __S(24, __c3, 0), - collaborator_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.workflows.collaborators.add", code: 200 })), - ).annotate({ identifier: "AddWorkflowsCollaboratorRequest" }); + channel_id: S.String, + prefs: S.String, + }).pipe( + T.Http({ method: "POST", uri: "/admin.conversations.setConversationPrefs", code: 200 }), + ), + ).annotate({ identifier: "SetConversationPrefsRequest" }); } } function __c121(j: number): any { @@ -7203,10 +14031,12 @@ function __c121(j: number): any { case 0: return S.suspend(() => S.Struct({ - user_ids: __S(24, __c3, 0), - reason: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.access.pause", code: 200 })), - ).annotate({ identifier: "PauseUsersAccessRequest" }); + channel_id: S.String, + duration_days: S.Number, + }).pipe( + T.Http({ method: "POST", uri: "/admin.conversations.setCustomRetention", code: 200 }), + ), + ).annotate({ identifier: "SetCustomRetentionRequest" }); } } function __c122(j: number): any { @@ -7214,10 +14044,12 @@ function __c122(j: number): any { case 0: return S.suspend(() => S.Struct({ - ok: S.Boolean, - invalid_users: __S(873, __c109, 1), - }), - ).annotate({ identifier: "PauseUsersAccessResponse" }); + team_id: S.String.pipe(T.Query()), + channel_ids: __S(24, __c3, 0).pipe(T.Query()), + }).pipe( + T.Http({ method: "GET", uri: "/admin.teams.settings.setDefaultChannels", code: 200 }), + ), + ).annotate({ identifier: "SetDefaultChannelsRequest" }); } } function __c123(j: number): any { @@ -7225,9 +14057,10 @@ function __c123(j: number): any { case 0: return S.suspend(() => S.Struct({ - skill_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.slackbot.skills.publish", code: 200 })), - ).annotate({ identifier: "PublishSlackbotSkillRequest" }); + team_id: S.String, + description: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.teams.settings.setDescription", code: 200 })), + ).annotate({ identifier: "SetDescriptionRequest" }); } } function __c124(j: number): any { @@ -7235,12 +14068,12 @@ function __c124(j: number): any { case 0: return S.suspend(() => S.Struct({ - app_id: S.String, - user_ids: S.optional(__S(24, __c3, 0)), - usergroup_ids: S.optional(__S(24, __c3, 0)), - channel_ids: S.optional(__S(24, __c3, 0)), - }).pipe(T.Http({ method: "POST", uri: "/admin.apps.permissions.remove", code: 200 })), - ).annotate({ identifier: "RemoveAppsPermissionsRequest" }); + team_id: S.String, + discoverability: S.String, + }).pipe( + T.Http({ method: "POST", uri: "/admin.teams.settings.setDiscoverability", code: 200 }), + ), + ).annotate({ identifier: "SetDiscoverabilityRequest" }); } } function __c125(j: number): any { @@ -7248,11 +14081,11 @@ function __c125(j: number): any { case 0: return S.suspend(() => S.Struct({ - role_id: S.String, - entity_ids: __S(24, __c3, 0), - user_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.roles.removeAssignments", code: 200 })), - ).annotate({ identifier: "RemoveAssignmentsRequest" }); + team_id: S.optional(S.String), + user_id: S.String, + expiration_ts: S.Number, + }).pipe(T.Http({ method: "POST", uri: "/admin.users.setExpiration", code: 200 })), + ).annotate({ identifier: "SetExpirationRequest" }); } } function __c126(j: number): any { @@ -7260,10 +14093,22 @@ function __c126(j: number): any { case 0: return S.suspend(() => S.Struct({ - usergroup_id: S.String, - channel_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.removeChannels", code: 200 })), - ).annotate({ identifier: "RemoveChannelsRequest" }); + visibility: S.String, + permission_type: S.String, + user_ids: S.optional(__S(24, __c3, 0)), + }), + ).annotate({ identifier: "SetFunctionsPermissionsRequestPermissionsItem" }); + case 1: + return S.Array(__S(1008, __c126, 0)); + case 2: + return S.suspend(() => + S.Struct({ + function_id: S.String, + visibility: S.optional(S.String), + user_ids: S.optional(__S(24, __c3, 0)), + permissions: S.optional(__S(1009, __c126, 1)), + }).pipe(T.Http({ method: "POST", uri: "/admin.functions.permissions.set", code: 200 })), + ).annotate({ identifier: "SetFunctionsPermissionsRequest" }); } } function __c127(j: number): any { @@ -7271,11 +14116,10 @@ function __c127(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - }).pipe( - T.Http({ method: "POST", uri: "/admin.conversations.removeCustomRetention", code: 200 }), - ), - ).annotate({ identifier: "RemoveCustomRetentionRequest" }); + image_url: S.String.pipe(T.Query()), + team_id: S.String.pipe(T.Query()), + }).pipe(T.Http({ method: "GET", uri: "/admin.teams.settings.setIcon", code: 200 })), + ).annotate({ identifier: "SetIconRequest" }); } } function __c128(j: number): any { @@ -7283,9 +14127,10 @@ function __c128(j: number): any { case 0: return S.suspend(() => S.Struct({ - name: S.String.pipe(T.Query()), - }).pipe(T.Http({ method: "GET", uri: "/admin.emoji.remove", code: 200 })), - ).annotate({ identifier: "RemoveEmojiRequest" }); + team_id: S.String, + name: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.teams.settings.setName", code: 200 })), + ).annotate({ identifier: "SetNameRequest" }); } } function __c129(j: number): any { @@ -7293,11 +14138,10 @@ function __c129(j: number): any { case 0: return S.suspend(() => S.Struct({ - policy_name: S.String, - entity_type: S.Unknown, - entity_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.auth.policy.removeEntities", code: 200 })), - ).annotate({ identifier: "RemoveEntitiesRequest" }); + team_id: S.String, + user_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.users.setOwner", code: 200 })), + ).annotate({ identifier: "SetOwnerRequest" }); } } function __c130(j: number): any { @@ -7305,17 +14149,10 @@ function __c130(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_id: S.String.pipe(T.Query()), - group_id: S.String.pipe(T.Query()), - channel_id: S.String.pipe(T.Query()), - }).pipe( - T.Http({ - method: "GET", - uri: "/admin.conversations.restrictAccess.removeGroup", - code: 200, - }), - ), - ).annotate({ identifier: "RemoveGroupRequest" }); + team_id: S.String, + user_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.users.setRegular", code: 200 })), + ).annotate({ identifier: "SetRegularRequest" }); } } function __c131(j: number): any { @@ -7323,10 +14160,11 @@ function __c131(j: number): any { case 0: return S.suspend(() => S.Struct({ - usergroup_id: S.String, - team_ids: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.removeTeams", code: 200 })), - ).annotate({ identifier: "RemoveTeamsRequest" }); + user_ids: __S(24, __c3, 0), + duration: S.optional(S.Number), + desktop_app_browser_quit: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.setSettings", code: 200 })), + ).annotate({ identifier: "SetSettingsRequest" }); } } function __c132(j: number): any { @@ -7334,21 +14172,19 @@ function __c132(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel: S.String.pipe(T.Query()), - oldest_ts: S.optional(S.String.pipe(T.Query())), - latest_ts: S.optional(S.String.pipe(T.Query())), - cursor: S.optional(S.String.pipe(T.Query())), - limit: S.optional(S.Number.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/admin.analytics.messages.activity", code: 200 })), - ).annotate({ identifier: "AnalyticsMessagesActivityRequest" }); + channel_id: S.String, + team_id: S.optional(S.String), + target_team_ids: S.optional(__S(24, __c3, 0)), + org_channel: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.setTeams", code: 200 })), + ).annotate({ identifier: "SetTeamsRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - response_metadata: S.optional(__S(1064, __c133, 0)), - message_activities: S.Unknown, + channel: S.String, }), - ).annotate({ identifier: "AnalyticsMessagesActivityResponse" }); + ).annotate({ identifier: "SetTeamsResponse" }); } } function __c133(j: number): any { @@ -7356,9 +14192,24 @@ function __c133(j: number): any { case 0: return S.suspend(() => S.Struct({ - next_cursor: S.optional(S.String), + permissions: S.optional(__S(608, __c76, 0)), }), - ).annotate({ identifier: "AnalyticsMessagesActivityResponseResponseMetadata" }); + ).annotate({ identifier: "SetWorkflowsTriggersTypesPermissionsRequestPermissions" }); + case 1: + return S.suspend(() => + S.Struct({ + id: S.String, + visibility: S.optional(S.String), + user_ids: S.optional(__S(24, __c3, 0)), + permissions: S.optional(__S(1064, __c133, 0)), + }).pipe( + T.Http({ + method: "POST", + uri: "/admin.workflows.triggers.types.permissions.set", + code: 200, + }), + ), + ).annotate({ identifier: "SetWorkflowsTriggersTypesPermissionsRequest" }); } } function __c134(j: number): any { @@ -7367,9 +14218,28 @@ function __c134(j: number): any { return S.suspend(() => S.Struct({ team_id: S.String, - user_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.users.remove", code: 200 })), - ).annotate({ identifier: "RemoveUserRequest" }); + }).pipe(T.Http({ method: "POST", uri: "/admin.teams.settings.info", code: 200 })), + ).annotate({ identifier: "TeamsSettingsInfoRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + id: S.optional(S.String), + name: S.optional(S.String), + domain: S.optional(S.String), + email_domain: S.optional(S.String), + icon: S.optional(S.Unknown), + enterprise_id: S.optional(S.String), + enterprise_name: S.optional(S.String), + default_channels: S.optional(__S(520, __c65, 0)), + }), + ).annotate({ identifier: "TeamsSettingsInfoResponseTeam" }); + case 2: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + team: __S(1073, __c134, 1), + }), + ).annotate({ identifier: "TeamsSettingsInfoResponse" }); } } function __c135(j: number): any { @@ -7377,10 +14247,9 @@ function __c135(j: number): any { case 0: return S.suspend(() => S.Struct({ - id: S.String, - users: __S(24, __c3, 0), - }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.removeUsers", code: 200 })), - ).annotate({ identifier: "RemoveUsersRequest" }); + channel_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.unarchive", code: 200 })), + ).annotate({ identifier: "UnarchiveConversationRequest" }); } } function __c136(j: number): any { @@ -7388,12 +14257,11 @@ function __c136(j: number): any { case 0: return S.suspend(() => S.Struct({ - workflow_ids: __S(24, __c3, 0), - collaborator_ids: __S(24, __c3, 0), - }).pipe( - T.Http({ method: "POST", uri: "/admin.workflows.collaborators.remove", code: 200 }), - ), - ).annotate({ identifier: "RemoveWorkflowsCollaboratorRequest" }); + app_id: S.String, + team_ids: S.optional(S.String), + enterprise_id: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/admin.apps.uninstall", code: 200 })), + ).annotate({ identifier: "UninstallAppRequest" }); } } function __c137(j: number): any { @@ -7401,10 +14269,10 @@ function __c137(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel_id: S.String, - name: S.String, - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.rename", code: 200 })), - ).annotate({ identifier: "RenameConversationRequest" }); + channel: S.String, + new_name: S.String, + }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.unlinkObjects", code: 200 })), + ).annotate({ identifier: "UnlinkObjectsRequest" }); } } function __c138(j: number): any { @@ -7412,10 +14280,9 @@ function __c138(j: number): any { case 0: return S.suspend(() => S.Struct({ - name: S.String.pipe(T.Query()), - new_name: S.String.pipe(T.Query()), - }).pipe(T.Http({ method: "GET", uri: "/admin.emoji.rename", code: 200 })), - ).annotate({ identifier: "RenameEmojiRequest" }); + skill_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.slackbot.skills.unpublish", code: 200 })), + ).annotate({ identifier: "UnpublishSlackbotSkillRequest" }); } } function __c139(j: number): any { @@ -7423,11 +14290,9 @@ function __c139(j: number): any { case 0: return S.suspend(() => S.Struct({ - user_ids: __S(24, __c3, 0), - mobile_only: S.optional(S.Boolean), - web_only: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.resetBulk", code: 200 })), - ).annotate({ identifier: "ResetBulkRequest" }); + workflow_ids: __S(24, __c3, 0), + }).pipe(T.Http({ method: "POST", uri: "/admin.workflows.unpublish", code: 200 })), + ).annotate({ identifier: "UnpublishWorkflowRequest" }); } } function __c140(j: number): any { @@ -7435,11 +14300,19 @@ function __c140(j: number): any { case 0: return S.suspend(() => S.Struct({ - user_id: S.String, - mobile_only: S.optional(S.Boolean), - web_only: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.session.reset", code: 200 })), - ).annotate({ identifier: "ResetUsersSessionRequest" }); + barrier_id: S.String, + primary_usergroup_id: S.String, + barriered_from_usergroup_ids: __S(24, __c3, 0), + restricted_subjects: __S(304, __c38, 0), + }).pipe( + T.Http({ + method: "POST", + uri: "/admin.barriers.update", + code: 200, + contentType: "form-urlencoded", + }), + ), + ).annotate({ identifier: "UpdateBarrierRequest" }); } } function __c141(j: number): any { @@ -7447,10 +14320,12 @@ function __c141(j: number): any { case 0: return S.suspend(() => S.Struct({ - user_ids: __S(24, __c3, 0), - reason: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/admin.users.access.resume", code: 200 })), - ).annotate({ identifier: "ResumeUsersAccessRequest" }); + trusted_cidr: S.optional(__S(24, __c3, 0)), + trusted_asns: S.optional(__S(448, __c56, 0)), + }).pipe( + T.Http({ method: "POST", uri: "/admin.audit.anomaly.allow.updateItem", code: 200 }), + ), + ).annotate({ identifier: "UpdateItemRequest" }); } } function __c142(j: number): any { @@ -7458,28 +14333,21 @@ function __c142(j: number): any { case 0: return S.suspend(() => S.Struct({ - team_ids: S.optional(__S(24, __c3, 0)), - connected_team_ids: S.optional(__S(24, __c3, 0)), - query: S.optional(S.String), - limit: S.optional(S.Number), - cursor: S.optional(S.String), - search_channel_types: S.optional(__S(24, __c3, 0)), - sort: S.optional(S.String), - sort_dir: S.optional(S.String), - total_count_only: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/admin.conversations.search", code: 200 })), - ).annotate({ identifier: "SearchConversationRequest" }); + id: S.String, + name: S.optional(S.String), + handle: S.optional(S.String), + description: S.optional(S.String), + is_visible: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.update", code: 200 })), + ).annotate({ identifier: "UpdateUsergroupRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - conversations: __S(24, __c3, 0), - next_cursor: S.String, - total_count: S.Number, - error: S.optional(S.String), - response_metadata: S.optional(__S(1064, __c133, 0)), + subteam: S.optional(S.Unknown), + channel_limit_user_ids: S.optional(__S(24, __c3, 0)), }), - ).annotate({ identifier: "SearchConversationResponse" }); + ).annotate({ identifier: "UpdateUsergroupResponse" }); } } function __c143(j: number): any { @@ -7487,31 +14355,18 @@ function __c143(j: number): any { case 0: return S.suspend(() => S.Struct({ - query: S.optional(S.String), - app_id: S.optional(S.String), - cursor: S.optional(S.String), - limit: S.optional(S.Number), - no_collaborators: S.optional(S.Boolean), - collaborator_ids: S.optional(__S(24, __c3, 0)), - num_trigger_ids: S.optional(S.Number), - is_sales_elevate: S.optional(S.Boolean), - source: S.optional(S.String), - sort: S.optional(S.String), - sort_dir: S.optional(S.String), - trigger_type_id: S.optional(S.String), - publish_status: S.optional(S.String), - step_function_ids: S.optional(__S(24, __c3, 0)), - }).pipe(T.Http({ method: "POST", uri: "/admin.workflows.search", code: 200 })), - ).annotate({ identifier: "SearchWorkflowRequest" }); + id: S.String, + file: S.optional(S.Unknown), + }).pipe(T.Http({ method: "POST", uri: "/admin.usergroups.uploadUsers", code: 200 })), + ).annotate({ identifier: "UploadUsersRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - workflows: __S(704, __c88, 0), - response_metadata: S.optional(__S(1064, __c133, 0)), - total_found: S.Number, + successful_user_count: S.Number, + invalid_users: S.optional(__S(97, __c12, 1)), }), - ).annotate({ identifier: "SearchWorkflowResponse" }); + ).annotate({ identifier: "UploadUsersResponse" }); } } // Schema table: entry i is schema j of builder f, made on first reach. diff --git a/packages/slack/src/services/agents.ts b/packages/slack/src/services/agents.ts index 1ca0800d8a..58b3d911c0 100644 --- a/packages/slack/src/services/agents.ts +++ b/packages/slack/src/services/agents.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,721 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `agent_required` -- The caller is not a bot, so no agent could be determined for the command set. */ +export class AgentRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AgentRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "agent_required" } }], + ) {} + +/** `already_archived` -- The channel has already been archived. */ +export class AlreadyArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_archived" } }], + ) {} + +/** `canvas_content_fetch_failed` -- The canvas content could not be fetched or rendered. */ +export class CanvasContentFetchFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasContentFetchFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_content_fetch_failed" } }], + ) {} + +/** `canvas_content_update_failed` -- The canvas content could not be updated. */ +export class CanvasContentUpdateFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasContentUpdateFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_content_update_failed" } }], + ) {} + +/** `canvas_not_found` -- The specified `canvas_id` does not correspond to a canvas you can access. */ +export class CanvasNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "canvas_not_found" } }], + ) {} + +/** `channel_creation_failed` -- The code channel could not be created. */ +export class ChannelCreationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelCreationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_creation_failed" } }], + ) {} + +/** `channel_not_found` -- The specified channel_id does not correspond to a valid channel. */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `channel_not_viewable` -- A channel exists for this session but the caller does not have permission to view it. */ +export class ChannelNotViewable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotViewable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_not_viewable" } }], + ) {} + +/** `colliding_with_builtin` -- One or more command names collide with a builtin Slack slash command. */ +export class CollidingWithBuiltin + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CollidingWithBuiltin", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "colliding_with_builtin" } }], + ) {} + +/** `comments_fetch_failed` -- The canvas comment threads could not be fetched. */ +export class CommentsFetchFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CommentsFetchFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "comments_fetch_failed" } }], + ) {} + +/** `content_too_large` -- The provided content exceeds the maximum canvas size. */ +export class ContentTooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ContentTooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "content_too_large" } }], + ) {} + +/** `duplicate_command` -- Two or more commands in the set share the same name. */ +export class DuplicateCommand + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DuplicateCommand", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "duplicate_command" } }], + ) {} + +/** `feature_disabled` -- The caller is not authorized to create code channels. The app must be a recognized agent session app, or the user must have the feature enabled. */ +export class FeatureDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FeatureDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "feature_disabled" } }], + ) {} + +/** `invalid_agent` -- The agent bot user associated with the calling app is not a valid bot. */ +export class InvalidAgent + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAgent", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_agent" } }], + ) {} + +/** `invalid_arguments` -- Exactly one of view_key or view_id must be provided. */ +export class InvalidArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_arguments" } }], + ) {} + +/** `invalid_blocks` -- The supplied `blocks` failed Block Kit validation. */ +export class InvalidBlocks + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidBlocks", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_blocks" } }], + ) {} + +/** `invalid_commands` -- One or more commands are malformed (invalid name, missing description, or a field exceeds its length limit). */ +export class InvalidCommands + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCommands", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_commands" } }], + ) {} + +/** `invalid_csp_domain` -- One or more declared CSP domains failed validation (must be `https://` origins, no private, reserved, or internal hosts). */ +export class InvalidCspDomain + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCspDomain", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_csp_domain" } }], + ) {} + +/** `invalid_name` -- The `title` value is not valid for a channel name. */ +export class InvalidName + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidName", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_name" } }], + ) {} + +/** `invalid_origin_link` -- The origin link is invalid. Either origin_channel_id and origin_message_ts were not provided together, the channel does not exist or is not accessible to the caller, or the message was not found at the given timestamp. */ +export class InvalidOriginLink + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidOriginLink", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_origin_link" } }], + ) {} + +/** `invalid_status` -- Value passed for `status` was not a valid agent session status. */ +export class InvalidStatus + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidStatus", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_status" } }], + ) {} + +/** `invalid_title` -- Value passed for `title` was invalid. */ +export class InvalidTitle + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTitle", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_title" } }], + ) {} + +/** `invalid_view_type` -- The supplied `type` is not a recognized view type. */ +export class InvalidViewType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidViewType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_view_type" } }], + ) {} + +/** `invite_failed` -- The channel was created but the agent bot could not be invited. */ +export class InviteFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviteFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invite_failed" } }], + ) {} + +/** `is_archived` -- Cannot rename an archived channel. */ +export class IsArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("IsArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "is_archived" } }], + ) {} + +/** `missing_required_arg` -- A required argument for the supplied view type is missing (`content` for `html` or `diff`, `blocks` for `block_kit`, `canvas_id` for `canvas`). */ +export class MissingRequiredArg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingRequiredArg", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_required_arg" } }], + ) {} + +/** `name_or_origin_required` -- A name must be provided unless an origin link (origin_channel_id and origin_message_ts) is given to derive the channel name from. */ +export class NameOrOriginRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NameOrOriginRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "name_or_origin_required" } }], + ) {} + +/** `name_taken` -- The new channel name is already taken. */ +export class NameTaken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NameTaken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "name_taken" } }], + ) {} + +/** `no_actions_url` -- The calling agent app has no configured request URL (slash command or interactivity), so it could not receive command invocations. */ +export class NoActionsUrl + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoActionsUrl", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_actions_url" } }], + ) {} + +/** `no_origin_link` -- summary_message_ts was provided but the code channel has no origin_link set. */ +export class NoOriginLink + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoOriginLink", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_origin_link" } }], + ) {} + +/** `no_properties_provided` -- At least one property field must be provided. */ +export class NoPropertiesProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoPropertiesProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_properties_provided" } }], + ) {} + +/** `no_shared_workspace` -- No workspace could be found where both the app and the requesting user are present. The org app must have a workspace grant for at least one workspace the user belongs to. */ +export class NoSharedWorkspace + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoSharedWorkspace", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_shared_workspace" } }], + ) {} + +/** `not_agent_channel` -- The specified channel is not a code channel. */ +export class NotAgentChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAgentChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_agent_channel" } }], + ) {} + +/** `not_authorized` -- The caller is not an authorized agent bot for this channel. */ +export class NotAuthorized + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAuthorized", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_authorized" } }], + ) {} + +/** `not_view_owner` -- The view was created by a different agent bot; only its owner may remove it. */ +export class NotViewOwner + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotViewOwner", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_view_owner" } }], + ) {} + +/** `open_failed` -- The channel was created but could not be opened in the sidebar. */ +export class OpenFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OpenFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "open_failed" } }], + ) {} + +/** `origin_channel_externally_shared` -- The origin message is in an externally shared (Slack Connect) channel, DM, or group DM. Code channels cannot be created from a Slack Connect conversation. */ +export class OriginChannelExternallyShared + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OriginChannelExternallyShared", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "origin_channel_externally_shared" } }], + ) {} + +/** `origin_channel_is_file_channel` -- The origin message is a comment on a file or canvas. Code channels cannot be created from a file channel -- when the canvas belongs to a code channel, continue that session instead. */ +export class OriginChannelIsFileChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OriginChannelIsFileChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "origin_channel_is_file_channel" } }], + ) {} + +/** `origin_channel_not_found` -- The origin channel referenced by the code channel is no longer accessible. */ +export class OriginChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OriginChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "origin_channel_not_found" } }], + ) {} + +/** `origin_message_not_found` -- The origin message referenced by the code channel's origin_link could not be found. */ +export class OriginMessageNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OriginMessageNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "origin_message_not_found" } }], + ) {} + +/** `properties_update_failed` -- The command set could not be persisted to the channel properties. */ +export class PropertiesUpdateFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PropertiesUpdateFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "properties_update_failed" } }], + ) {} + +/** `restricted_action` -- The workspace does not allow the bot to archive channels. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `session_not_found` -- No agent session exists for the specified channel and thread. */ +export class SessionNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SessionNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "session_not_found" } }], + ) {} + +/** `summary_message_not_found` -- The specified summary_message_ts does not correspond to a message in the code channel. */ +export class SummaryMessageNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SummaryMessageNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "summary_message_not_found" } }], + ) {} + +/** `thread_ts_not_allowed` -- `thread_ts` must not be provided for session channels. */ +export class ThreadTsNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ThreadTsNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "thread_ts_not_allowed" } }], + ) {} + +/** `thread_ts_required` -- `thread_ts` is required for thread-based sessions in regular channels and DMs. */ +export class ThreadTsRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ThreadTsRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "thread_ts_required" } }], + ) {} + +/** `too_many_agents` -- Registering a new agent would exceed the maximum number of agents with commands in this channel. */ +export class TooManyAgents + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyAgents", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_agents" } }], + ) {} + +/** `too_many_commands` -- Registering this set would exceed the maximum of 10 commands across all agents in the channel. */ +export class TooManyCommands + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyCommands", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_commands" } }], + ) {} + +/** `too_many_sections` -- The provided content or the existing canvas has too many sections to diff. Reduce the number of distinct blocks (paragraphs, headings, code fences) in the document. */ +export class TooManySections + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManySections", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_sections" } }], + ) {} + +/** `too_many_views` -- The channel already has the maximum number of views (5), or already has a `diff` view (at most 1 is allowed). */ +export class TooManyViews + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyViews", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_views" } }], + ) {} + +/** `user_not_enabled` -- The author of the origin message does not have the code channels feature enabled. */ +export class UserNotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_not_enabled" } }], + ) {} + +/** `user_not_found` -- The specified `initiator_user_id` does not exist or is not accessible. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + +/** `view_creation_failed` -- The view could not be created as a channel tab. */ +export class ViewCreationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ViewCreationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "view_creation_failed" } }], + ) {} + +/** `view_not_found` -- No agent view matches the supplied view_key or view_id in this channel. */ +export class ViewNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ViewNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "view_not_found" } }], + ) {} + +/** `view_remove_failed` -- The view's tab or channel properties could not be updated. Safe to retry. */ +export class ViewRemoveFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ViewRemoveFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "view_remove_failed" } }], + ) {} + export interface ArchiveConversationRequest { /** ID of the code channel to archive. */ channel_id: string; @@ -361,8 +1077,18 @@ export interface SetViewResponse { /** For `canvas` views, the encoded ID of the attached canvas. Absent for other view types. */ canvas_id?: string | undefined; } -export type ArchiveConversationError = SlackOpError; -/** Archive a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel_id does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `already_archived` -- The channel has already been archived. - `restricted_action` -- The workspace does not allow the bot to archive channels. - `summary_message_not_found` -- The specified summary_message_ts does not correspond to a message in the code channel. - `no_origin_link` -- summary_message_ts was provided but the code channel has no origin_link set. - `origin_channel_not_found` -- The origin channel referenced by the code channel is no longer accessible. - `origin_message_not_found` -- The origin message referenced by the code channel's origin_link could not be found. See https://docs.slack.dev/reference/methods/agents.conversations.archive */ +export type ArchiveConversationError = + | AlreadyArchived + | ChannelNotFound + | NoOriginLink + | NotAgentChannel + | NotAuthorized + | OriginChannelNotFound + | OriginMessageNotFound + | RestrictedAction + | SummaryMessageNotFound + | SlackOpError; +/** Archive a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The specified channel_id does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `already_archived` -- The channel has already been archived. - `restricted_action` -- The workspace does not allow the bot to archive channels. - `summary_message_not_found` -- The specified summary_message_ts does not correspond to a message in the code channel. - `no_origin_link` -- summary_message_ts was provided but the code channel has no origin_link set. - `origin_channel_not_found` -- The origin channel referenced by the code channel is no longer accessible. - `origin_message_not_found` -- The origin message referenced by the code channel's origin_link could not be found. See https://docs.slack.dev/reference/methods/agents.conversations.archive */ export const archiveConversation: API.OperationMethod< ArchiveConversationRequest, ArchiveConversationResponse, @@ -371,15 +1097,41 @@ export const archiveConversation: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AlreadyArchived, + ChannelNotFound, + NoOriginLink, + NotAgentChannel, + NotAuthorized, + OriginChannelNotFound, + OriginMessageNotFound, + RestrictedAction, + SummaryMessageNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ArchiveConversation", })); -export type CreateConversationError = SlackOpError; -/** Create a dedicated code channel for an agent session. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `feature_disabled` -- The caller is not authorized to create code channels. The app must be a recognized agent session app, or the user must have the feature enabled. - `user_not_enabled` -- The author of the origin message does not have the code channels feature enabled. - `invalid_agent` -- The agent bot user associated with the calling app is not a valid bot. - `channel_not_viewable` -- A channel exists for this session but the caller does not have permission to view it. - `origin_channel_externally_shared` -- The origin message is in an externally shared (Slack Connect) channel, DM, or group DM. Code channels cannot be created from a Slack Connect conversation. - `origin_channel_is_file_channel` -- The origin message is a comment on a file or canvas. Code channels cannot be created from a file channel -- when the canvas belongs to a code channel, continue that session instead. - `invalid_origin_link` -- The origin link is invalid. Either origin_channel_id and origin_message_ts were not provided together, the channel does not exist or is not accessible to the caller, or the message was not found at the given timestamp. - `name_or_origin_required` -- A name must be provided unless an origin link (origin_channel_id and origin_message_ts) is given to derive the channel name from. - `no_shared_workspace` -- No workspace could be found where both the app and the requesting user are present. The org app must have a workspace grant for at least one workspace the user belongs to. - `restricted_action` -- The calling user is not permitted to create channels of the requested type in this workspace. - `channel_creation_failed` -- The code channel could not be created. - `open_failed` -- The channel was created but could not be opened in the sidebar. - `invite_failed` -- The channel was created but the agent bot could not be invited. See https://docs.slack.dev/reference/methods/agents.conversations.create */ +export type CreateConversationError = + | ChannelCreationFailed + | ChannelNotViewable + | FeatureDisabled + | InvalidAgent + | InvalidOriginLink + | InviteFailed + | NameOrOriginRequired + | NoSharedWorkspace + | OpenFailed + | OriginChannelExternallyShared + | OriginChannelIsFileChannel + | RestrictedAction + | UserNotEnabled + | SlackOpError; +/** Create a dedicated code channel for an agent session. Required scopes -- bot: `code_channels:manage` Method-specific errors (each a typed error named after its slug): - `feature_disabled` -- The caller is not authorized to create code channels. The app must be a recognized agent session app, or the user must have the feature enabled. - `user_not_enabled` -- The author of the origin message does not have the code channels feature enabled. - `invalid_agent` -- The agent bot user associated with the calling app is not a valid bot. - `channel_not_viewable` -- A channel exists for this session but the caller does not have permission to view it. - `origin_channel_externally_shared` -- The origin message is in an externally shared (Slack Connect) channel, DM, or group DM. Code channels cannot be created from a Slack Connect conversation. - `origin_channel_is_file_channel` -- The origin message is a comment on a file or canvas. Code channels cannot be created from a file channel -- when the canvas belongs to a code channel, continue that session instead. - `invalid_origin_link` -- The origin link is invalid. Either origin_channel_id and origin_message_ts were not provided together, the channel does not exist or is not accessible to the caller, or the message was not found at the given timestamp. - `name_or_origin_required` -- A name must be provided unless an origin link (origin_channel_id and origin_message_ts) is given to derive the channel name from. - `no_shared_workspace` -- No workspace could be found where both the app and the requesting user are present. The org app must have a workspace grant for at least one workspace the user belongs to. - `restricted_action` -- The calling user is not permitted to create channels of the requested type in this workspace. - `channel_creation_failed` -- The code channel could not be created. - `open_failed` -- The channel was created but could not be opened in the sidebar. - `invite_failed` -- The channel was created but the agent bot could not be invited. See https://docs.slack.dev/reference/methods/agents.conversations.create */ export const createConversation: API.OperationMethod< CreateConversationRequest, CreateConversationResponse, @@ -388,160 +1140,340 @@ export const createConversation: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c1, 0) as any as S.Schema, output: __S(16, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelCreationFailed, + ChannelNotViewable, + FeatureDisabled, + InvalidAgent, + InvalidOriginLink, + InviteFailed, + NameOrOriginRequired, + NoSharedWorkspace, + OpenFailed, + OriginChannelExternallyShared, + OriginChannelIsFileChannel, + RestrictedAction, + UserNotEnabled, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateConversation", })); -export type GetCanvasError = SlackOpError; -/** Fetch a canvas attached to a code channel. Required scopes -- bot: `code_channels:manage` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not an agent session channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `canvas_not_found` -- The specified `canvas_id` does not correspond to a canvas you can access. - `canvas_content_fetch_failed` -- The canvas content could not be fetched or rendered. - `comments_fetch_failed` -- The canvas comment threads could not be fetched. See https://docs.slack.dev/reference/methods/agents.conversations.getCanvas */ +export type GetCanvasError = + | CanvasContentFetchFailed + | CanvasNotFound + | ChannelNotFound + | CommentsFetchFailed + | NotAgentChannel + | NotAuthorized + | SlackOpError; +/** Fetch a canvas attached to a code channel. Required scopes -- bot: `code_channels:manage` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not an agent session channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `canvas_not_found` -- The specified `canvas_id` does not correspond to a canvas you can access. - `canvas_content_fetch_failed` -- The canvas content could not be fetched or rendered. - `comments_fetch_failed` -- The canvas comment threads could not be fetched. See https://docs.slack.dev/reference/methods/agents.conversations.getCanvas */ export const getCanvas: API.OperationMethod< GetCanvasRequest, GetCanvasResponse, GetCanvasError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(32, __c4, 0) as any as S.Schema, - output: __S(37, __c4, 5) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(24, __c3, 0) as any as S.Schema, + output: __S(29, __c3, 5) as any as S.Schema, + errors: [ + CanvasContentFetchFailed, + CanvasNotFound, + ChannelNotFound, + CommentsFetchFailed, + NotAgentChannel, + NotAuthorized, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetCanvas", })); -export type ListViewsError = SlackOpError; -/** List the views currently attached to a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot or member for this channel. See https://docs.slack.dev/reference/methods/agents.conversations.listViews */ +export type ListViewsError = ChannelNotFound | NotAgentChannel | NotAuthorized | SlackOpError; +/** List the views currently attached to a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot or member for this channel. See https://docs.slack.dev/reference/methods/agents.conversations.listViews */ export const listViews: API.OperationMethod< ListViewsRequest, ListViewsResponse, ListViewsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(40, __c5, 0) as any as S.Schema, - output: __S(43, __c5, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(32, __c4, 0) as any as S.Schema, + output: __S(35, __c4, 3) as any as S.Schema, + errors: [ChannelNotFound, NotAgentChannel, NotAuthorized, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListViews", })); -export type RemoveViewError = SlackOpError; -/** Remove a view from a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot or member for this channel. - `view_not_found` -- No agent view matches the supplied view_key or view_id in this channel. - `not_view_owner` -- The view was created by a different agent bot; only its owner may remove it. - `invalid_arguments` -- Exactly one of view_key or view_id must be provided. - `view_remove_failed` -- The view's tab or channel properties could not be updated. Safe to retry. See https://docs.slack.dev/reference/methods/agents.conversations.removeView */ +export type RemoveViewError = + | ChannelNotFound + | InvalidArguments + | NotAgentChannel + | NotAuthorized + | NotViewOwner + | ViewNotFound + | ViewRemoveFailed + | SlackOpError; +/** Remove a view from a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot or member for this channel. - `view_not_found` -- No agent view matches the supplied view_key or view_id in this channel. - `not_view_owner` -- The view was created by a different agent bot; only its owner may remove it. - `invalid_arguments` -- Exactly one of view_key or view_id must be provided. - `view_remove_failed` -- The view's tab or channel properties could not be updated. Safe to retry. See https://docs.slack.dev/reference/methods/agents.conversations.removeView */ export const removeView: API.OperationMethod< RemoveViewRequest, RemoveViewResponse, RemoveViewError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(48, __c6, 0) as any as S.Schema, - output: __S(49, __c6, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(40, __c5, 0) as any as S.Schema, + output: __S(41, __c5, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + InvalidArguments, + NotAgentChannel, + NotAuthorized, + NotViewOwner, + ViewNotFound, + ViewRemoveFailed, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveView", })); -export type RenameSessionError = SlackOpError; -/** Rename an agent session. Required scopes -- bot: `chat:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `feature_disabled` -- The agent tasks feature is not enabled for this workspace. - `channel_not_found` -- The specified channel does not exist or is not accessible. - `not_authorized` -- The calling app is not an authorized agent for this session. - `session_not_found` -- No agent session exists for the specified channel and thread. - `thread_ts_required` -- `thread_ts` is required for thread-based sessions in regular channels and DMs. - `thread_ts_not_allowed` -- `thread_ts` must not be provided for session channels. - `invalid_name` -- The `title` value is not valid for a channel name. - `name_taken` -- The new channel name is already taken. - `is_archived` -- Cannot rename an archived channel. - `internal_error` -- An internal error occurred while renaming the session. See https://docs.slack.dev/reference/methods/agents.sessions.rename */ +export type RenameSessionError = + | ChannelNotFound + | FeatureDisabled + | InvalidName + | IsArchived + | NameTaken + | NotAuthorized + | SessionNotFound + | ThreadTsNotAllowed + | ThreadTsRequired + | SlackOpError; +/** Rename an agent session. Required scopes -- bot: `chat:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `feature_disabled` -- The agent tasks feature is not enabled for this workspace. - `channel_not_found` -- The specified channel does not exist or is not accessible. - `not_authorized` -- The calling app is not an authorized agent for this session. - `session_not_found` -- No agent session exists for the specified channel and thread. - `thread_ts_required` -- `thread_ts` is required for thread-based sessions in regular channels and DMs. - `thread_ts_not_allowed` -- `thread_ts` must not be provided for session channels. - `invalid_name` -- The `title` value is not valid for a channel name. - `name_taken` -- The new channel name is already taken. - `is_archived` -- Cannot rename an archived channel. - `internal_error` -- An internal error occurred while renaming the session. See https://docs.slack.dev/reference/methods/agents.sessions.rename */ export const renameSession: API.OperationMethod< RenameSessionRequest, RenameSessionResponse, RenameSessionError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(56, __c7, 0) as any as S.Schema, - output: __S(57, __c7, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(48, __c6, 0) as any as S.Schema, + output: __S(49, __c6, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + FeatureDisabled, + InvalidName, + IsArchived, + NameTaken, + NotAuthorized, + SessionNotFound, + ThreadTsNotAllowed, + ThreadTsRequired, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RenameSession", })); -export type SetCanvasContentError = SlackOpError; -/** Replace the full markdown content of a plan canvas attached to a code channel. Required scopes -- bot: `code_channels:manage` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not an agent session channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `canvas_not_found` -- The specified canvas_id does not correspond to a canvas you can access. - `content_too_large` -- The provided content exceeds the maximum canvas size. - `too_many_sections` -- The provided content or the existing canvas has too many sections to diff. Reduce the number of distinct blocks (paragraphs, headings, code fences) in the document. - `canvas_content_fetch_failed` -- The canvas's current content could not be read to compute the diff. - `canvas_content_update_failed` -- The canvas content could not be updated. See https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent */ +export type SetCanvasContentError = + | CanvasContentFetchFailed + | CanvasContentUpdateFailed + | CanvasNotFound + | ChannelNotFound + | ContentTooLarge + | NotAgentChannel + | NotAuthorized + | TooManySections + | SlackOpError; +/** Replace the full markdown content of a plan canvas attached to a code channel. Required scopes -- bot: `code_channels:manage` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not an agent session channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `canvas_not_found` -- The specified canvas_id does not correspond to a canvas you can access. - `content_too_large` -- The provided content exceeds the maximum canvas size. - `too_many_sections` -- The provided content or the existing canvas has too many sections to diff. Reduce the number of distinct blocks (paragraphs, headings, code fences) in the document. - `canvas_content_fetch_failed` -- The canvas's current content could not be read to compute the diff. - `canvas_content_update_failed` -- The canvas content could not be updated. See https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent */ export const setCanvasContent: API.OperationMethod< SetCanvasContentRequest, SetCanvasContentResponse, SetCanvasContentError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(64, __c8, 0) as any as S.Schema, - output: __S(65, __c8, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(56, __c7, 0) as any as S.Schema, + output: __S(57, __c7, 1) as any as S.Schema, + errors: [ + CanvasContentFetchFailed, + CanvasContentUpdateFailed, + CanvasNotFound, + ChannelNotFound, + ContentTooLarge, + NotAgentChannel, + NotAuthorized, + TooManySections, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetCanvasContent", })); -export type SetCommandsError = SlackOpError; -/** Register the set of agent-defined slash commands for the calling agent in a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not exist or is not accessible. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not the channel's agent bot. - `agent_required` -- The caller is not a bot, so no agent could be determined for the command set. - `no_actions_url` -- The calling agent app has no configured request URL (slash command or interactivity), so it could not receive command invocations. - `too_many_agents` -- Registering a new agent would exceed the maximum number of agents with commands in this channel. - `invalid_commands` -- One or more commands are malformed (invalid name, missing description, or a field exceeds its length limit). - `too_many_commands` -- Registering this set would exceed the maximum of 10 commands across all agents in the channel. - `duplicate_command` -- Two or more commands in the set share the same name. - `colliding_with_builtin` -- One or more command names collide with a builtin Slack slash command. - `properties_update_failed` -- The command set could not be persisted to the channel properties. See https://docs.slack.dev/reference/methods/agents.conversations.setCommands */ +export type SetCommandsError = + | AgentRequired + | ChannelNotFound + | CollidingWithBuiltin + | DuplicateCommand + | InvalidCommands + | NoActionsUrl + | NotAgentChannel + | NotAuthorized + | PropertiesUpdateFailed + | TooManyAgents + | TooManyCommands + | SlackOpError; +/** Register the set of agent-defined slash commands for the calling agent in a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The specified channel does not exist or is not accessible. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not the channel's agent bot. - `agent_required` -- The caller is not a bot, so no agent could be determined for the command set. - `no_actions_url` -- The calling agent app has no configured request URL (slash command or interactivity), so it could not receive command invocations. - `too_many_agents` -- Registering a new agent would exceed the maximum number of agents with commands in this channel. - `invalid_commands` -- One or more commands are malformed (invalid name, missing description, or a field exceeds its length limit). - `too_many_commands` -- Registering this set would exceed the maximum of 10 commands across all agents in the channel. - `duplicate_command` -- Two or more commands in the set share the same name. - `colliding_with_builtin` -- One or more command names collide with a builtin Slack slash command. - `properties_update_failed` -- The command set could not be persisted to the channel properties. See https://docs.slack.dev/reference/methods/agents.conversations.setCommands */ export const setCommands: API.OperationMethod< SetCommandsRequest, SetCommandsResponse, SetCommandsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(72, __c9, 0) as any as S.Schema, - output: __S(73, __c9, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(64, __c8, 0) as any as S.Schema, + output: __S(65, __c8, 1) as any as S.Schema, + errors: [ + AgentRequired, + ChannelNotFound, + CollidingWithBuiltin, + DuplicateCommand, + InvalidCommands, + NoActionsUrl, + NotAgentChannel, + NotAuthorized, + PropertiesUpdateFailed, + TooManyAgents, + TooManyCommands, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetCommands", })); -export type SetPropertiesError = SlackOpError; -/** Set properties on a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel_id does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `invalid_status` -- Value passed for `status` was not a valid agent session status. - `invalid_title` -- Value passed for `title` was invalid. - `no_properties_provided` -- At least one property field must be provided. See https://docs.slack.dev/reference/methods/agents.conversations.setProperties */ +export type SetPropertiesError = + | ChannelNotFound + | InvalidStatus + | InvalidTitle + | NoPropertiesProvided + | NotAgentChannel + | NotAuthorized + | SlackOpError; +/** Set properties on a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The specified channel_id does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `invalid_status` -- Value passed for `status` was not a valid agent session status. - `invalid_title` -- Value passed for `title` was invalid. - `no_properties_provided` -- At least one property field must be provided. See https://docs.slack.dev/reference/methods/agents.conversations.setProperties */ export const setProperties: API.OperationMethod< SetPropertiesRequest, SetPropertiesResponse, SetPropertiesError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(91, __c11, 3) as any as S.Schema, + input: __S(83, __c10, 3) as any as S.Schema, output: __S(16, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + InvalidStatus, + InvalidTitle, + NoPropertiesProvided, + NotAgentChannel, + NotAuthorized, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetProperties", })); -export type SetStatusError = SlackOpError; -/** Set an agent session's lifecycle status, creating the session if needed. Required scopes -- bot: `chat:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `feature_disabled` -- The agent tasks feature is not enabled for this workspace. - `channel_not_found` -- The specified channel does not exist or is not accessible. - `user_not_found` -- The specified `initiator_user_id` does not exist or is not accessible. - `not_authorized` -- The caller is not a member of the specified channel. - `invalid_status` -- The `status` value is not a valid agent session status. Must be one of: `active`, `processing`, `suspended`, `closed`. - `thread_ts_required` -- `thread_ts` is required for thread-based sessions in regular channels and DMs. - `thread_ts_not_allowed` -- `thread_ts` must not be provided for session channels. The channel-level session is updated automatically. - `internal_error` -- An internal error occurred while updating the session. See https://docs.slack.dev/reference/methods/agents.sessions.setStatus */ +export type SetStatusError = + | ChannelNotFound + | FeatureDisabled + | InvalidStatus + | NotAuthorized + | ThreadTsNotAllowed + | ThreadTsRequired + | UserNotFound + | SlackOpError; +/** Set an agent session's lifecycle status, creating the session if needed. Required scopes -- bot: `chat:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `feature_disabled` -- The agent tasks feature is not enabled for this workspace. - `channel_not_found` -- The specified channel does not exist or is not accessible. - `user_not_found` -- The specified `initiator_user_id` does not exist or is not accessible. - `not_authorized` -- The caller is not a member of the specified channel. - `invalid_status` -- The `status` value is not a valid agent session status. Must be one of: `active`, `processing`, `suspended`, `closed`. - `thread_ts_required` -- `thread_ts` is required for thread-based sessions in regular channels and DMs. - `thread_ts_not_allowed` -- `thread_ts` must not be provided for session channels. The channel-level session is updated automatically. - `internal_error` -- An internal error occurred while updating the session. See https://docs.slack.dev/reference/methods/agents.sessions.setStatus */ export const setStatus: API.OperationMethod< SetStatusRequest, SetStatusResponse, SetStatusError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(104, __c13, 0) as any as S.Schema, - output: __S(105, __c13, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(96, __c12, 0) as any as S.Schema, + output: __S(97, __c12, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + FeatureDisabled, + InvalidStatus, + NotAuthorized, + ThreadTsNotAllowed, + ThreadTsRequired, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetStatus", })); -export type SetViewError = SlackOpError; -/** Create or update a view in a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot or member for this channel. - `content_too_large` -- The view content exceeds the maximum allowed size (1 MB). - `too_many_views` -- The channel already has the maximum number of views (5), or already has a `diff` view (at most 1 is allowed). - `invalid_csp_domain` -- One or more declared CSP domains failed validation (must be `https://` origins, no private, reserved, or internal hosts). - `invalid_view_type` -- The supplied `type` is not a recognized view type. - `missing_required_arg` -- A required argument for the supplied view type is missing (`content` for `html` or `diff`, `blocks` for `block_kit`, `canvas_id` for `canvas`). - `invalid_blocks` -- The supplied `blocks` failed Block Kit validation. - `canvas_not_found` -- The specified `canvas_id` does not correspond to a canvas you can access. - `not_view_owner` -- The view already exists and was created by a different agent bot; only its owner may update it. - `view_creation_failed` -- The view could not be created as a channel tab. See https://docs.slack.dev/reference/methods/agents.conversations.setView */ +export type SetViewError = + | CanvasNotFound + | ChannelNotFound + | ContentTooLarge + | InvalidBlocks + | InvalidCspDomain + | InvalidViewType + | MissingRequiredArg + | NotAgentChannel + | NotAuthorized + | NotViewOwner + | TooManyViews + | ViewCreationFailed + | SlackOpError; +/** Create or update a view in a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot or member for this channel. - `content_too_large` -- The view content exceeds the maximum allowed size (1 MB). - `too_many_views` -- The channel already has the maximum number of views (5), or already has a `diff` view (at most 1 is allowed). - `invalid_csp_domain` -- One or more declared CSP domains failed validation (must be `https://` origins, no private, reserved, or internal hosts). - `invalid_view_type` -- The supplied `type` is not a recognized view type. - `missing_required_arg` -- A required argument for the supplied view type is missing (`content` for `html` or `diff`, `blocks` for `block_kit`, `canvas_id` for `canvas`). - `invalid_blocks` -- The supplied `blocks` failed Block Kit validation. - `canvas_not_found` -- The specified `canvas_id` does not correspond to a canvas you can access. - `not_view_owner` -- The view already exists and was created by a different agent bot; only its owner may update it. - `view_creation_failed` -- The view could not be created as a channel tab. See https://docs.slack.dev/reference/methods/agents.conversations.setView */ export const setView: API.OperationMethod< SetViewRequest, SetViewResponse, SetViewError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(25, __c3, 1) as any as S.Schema, - output: __S(26, __c3, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(105, __c13, 1) as any as S.Schema, + output: __S(106, __c13, 2) as any as S.Schema, + errors: [ + CanvasNotFound, + ChannelNotFound, + ContentTooLarge, + InvalidBlocks, + InvalidCspDomain, + InvalidViewType, + MissingRequiredArg, + NotAgentChannel, + NotAuthorized, + NotViewOwner, + TooManyViews, + ViewCreationFailed, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -593,46 +1525,6 @@ function __c2(j: number): any { } } function __c3(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - resource_domains: S.optional(__S(96, __c12, 0)), - }), - ).annotate({ identifier: "SetViewRequestCsp" }); - case 1: - return S.suspend(() => - S.Struct({ - channel_id: S.String, - type: S.optional(S.Unknown), - view_key: S.optional(S.String), - content: S.optional(S.String), - blocks: S.optional(S.Unknown), - canvas_id: S.optional(S.String), - access_level: S.optional(S.String), - agent_content_hash: S.optional(S.String), - base_branch: S.optional(S.String), - head_branch: S.optional(S.String), - name: S.optional(S.String), - label: S.optional(S.String), - csp: S.optional(__S(24, __c3, 0)), - }).pipe(T.Http({ method: "POST", uri: "/agents.conversations.setView", code: 200 })), - ).annotate({ identifier: "SetViewRequest" }); - case 2: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - channel_id: S.String, - view_id: S.String, - file_id: S.String, - content_version: S.Number, - type: S.optional(S.Unknown), - canvas_id: S.optional(S.String), - }), - ).annotate({ identifier: "SetViewResponse" }); - } -} -function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -652,7 +1544,7 @@ function __c4(j: number): any { }), ).annotate({ identifier: "GetCanvasResponseCommentsItemRepliesItem" }); case 2: - return S.Array(__S(33, __c4, 1)); + return S.Array(__S(25, __c3, 1)); case 3: return S.suspend(() => S.Struct({ @@ -662,12 +1554,12 @@ function __c4(j: number): any { text: S.String, quoted_text: S.String, is_resolved: S.Boolean, - replies: __S(34, __c4, 2), + replies: __S(26, __c3, 2), has_more_replies: S.Boolean, }), ).annotate({ identifier: "GetCanvasResponseCommentsItem" }); case 4: - return S.Array(__S(35, __c4, 3)); + return S.Array(__S(27, __c3, 3)); case 5: return S.suspend(() => S.Struct({ @@ -675,13 +1567,13 @@ function __c4(j: number): any { canvas_id: S.String, title: S.String, content: S.String, - comments: __S(36, __c4, 4), + comments: __S(28, __c3, 4), has_more_comments: S.Boolean, }), ).annotate({ identifier: "GetCanvasResponse" }); } } -function __c5(j: number): any { +function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -701,17 +1593,17 @@ function __c5(j: number): any { }), ).annotate({ identifier: "ListViewsResponseViewsItem" }); case 2: - return S.Array(__S(41, __c5, 1)); + return S.Array(__S(33, __c4, 1)); case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, - views: __S(42, __c5, 2), + views: __S(34, __c4, 2), }), ).annotate({ identifier: "ListViewsResponse" }); } } -function __c6(j: number): any { +function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -731,7 +1623,7 @@ function __c6(j: number): any { ).annotate({ identifier: "RemoveViewResponse" }); } } -function __c7(j: number): any { +function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -751,7 +1643,7 @@ function __c7(j: number): any { ).annotate({ identifier: "RenameSessionResponse" }); } } -function __c8(j: number): any { +function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -773,13 +1665,13 @@ function __c8(j: number): any { ).annotate({ identifier: "SetCanvasContentResponse" }); } } -function __c9(j: number): any { +function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ channel_id: S.String, - commands: __S(80, __c10, 0), + commands: __S(72, __c9, 0), }).pipe(T.Http({ method: "POST", uri: "/agents.conversations.setCommands", code: 200 })), ).annotate({ identifier: "SetCommandsRequest" }); case 1: @@ -792,13 +1684,13 @@ function __c9(j: number): any { ).annotate({ identifier: "SetCommandsResponse" }); } } -function __c10(j: number): any { +function __c9(j: number): any { switch (j) { case 0: return S.Array(S.Unknown); } } -function __c11(j: number): any { +function __c10(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -821,12 +1713,12 @@ function __c11(j: number): any { pr_status: S.optional(S.String), ci_url: S.optional(S.String), ci_state: S.optional(S.String), - file_paths: S.optional(__S(96, __c12, 0)), + file_paths: S.optional(__S(88, __c11, 0)), language: S.optional(S.String), upstream_url: S.optional(S.String), branch_url: S.optional(S.String), - context_bar_items: S.optional(__S(80, __c10, 0)), - summary_message: S.optional(__S(88, __c11, 0)), + context_bar_items: S.optional(__S(72, __c9, 0)), + summary_message: S.optional(__S(80, __c10, 0)), }), ).annotate({ identifier: "SetPropertiesRequestCodeChannel" }); case 2: @@ -844,19 +1736,19 @@ function __c11(j: number): any { channel_id: S.String, title: S.optional(S.String), status: S.optional(S.String), - code_channel: S.optional(__S(89, __c11, 1)), - agent_resource: S.optional(__S(90, __c11, 2)), + code_channel: S.optional(__S(81, __c10, 1)), + agent_resource: S.optional(__S(82, __c10, 2)), }).pipe(T.Http({ method: "POST", uri: "/agents.conversations.setProperties", code: 200 })), ).annotate({ identifier: "SetPropertiesRequest" }); } } -function __c12(j: number): any { +function __c11(j: number): any { switch (j) { case 0: return S.Array(S.String); } } -function __c13(j: number): any { +function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -882,6 +1774,46 @@ function __c13(j: number): any { ).annotate({ identifier: "SetStatusResponse" }); } } +function __c13(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + resource_domains: S.optional(__S(88, __c11, 0)), + }), + ).annotate({ identifier: "SetViewRequestCsp" }); + case 1: + return S.suspend(() => + S.Struct({ + channel_id: S.String, + type: S.optional(S.Unknown), + view_key: S.optional(S.String), + content: S.optional(S.String), + blocks: S.optional(S.Unknown), + canvas_id: S.optional(S.String), + access_level: S.optional(S.String), + agent_content_hash: S.optional(S.String), + base_branch: S.optional(S.String), + head_branch: S.optional(S.String), + name: S.optional(S.String), + label: S.optional(S.String), + csp: S.optional(__S(104, __c13, 0)), + }).pipe(T.Http({ method: "POST", uri: "/agents.conversations.setView", code: 200 })), + ).annotate({ identifier: "SetViewRequest" }); + case 2: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + channel_id: S.String, + view_id: S.String, + file_id: S.String, + content_version: S.Number, + type: S.optional(S.Unknown), + canvas_id: S.optional(S.String), + }), + ).annotate({ identifier: "SetViewResponse" }); + } +} // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); diff --git a/packages/slack/src/services/apps.ts b/packages/slack/src/services/apps.ts index 5c4b9c4775..37a17df2bf 100644 --- a/packages/slack/src/services/apps.ts +++ b/packages/slack/src/services/apps.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -26,6 +27,934 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `access_denied` -- Not authorized to access the datastore. */ +export class AccessDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AccessDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "access_denied" } }], + ) {} + +/** `access_token_exchange_failed` -- There was an error while attempting to exchange or refresh token */ +export class AccessTokenExchangeFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AccessTokenExchangeFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "access_token_exchange_failed" } }], + ) {} + +/** `app_edit_disabled` -- The app cannot be edited. */ +export class AppEditDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppEditDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_edit_disabled" } }], + ) {} + +/** `app_not_eligible` -- The specified app is not eligible for this API. */ +export class AppNotEligible + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotEligible", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_not_eligible" } }], + ) {} + +/** `app_not_found` -- The provided `app_id` was not found */ +export class AppNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "app_not_found" } }], + ) {} + +/** `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. */ +export class AppNotHosted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotHosted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_not_hosted" } }], + ) {} + +/** `app_not_managed` -- The specified app is not currently managed by any manager app. */ +export class AppNotManaged + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotManaged", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_not_managed" } }], + ) {} + +/** `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only set icons for apps that it originally created via apps.manifest.create. */ +export class AppNotOwnedByManagerApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotOwnedByManagerApp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_not_owned_by_manager_app" } }], + ) {} + +/** `app_not_subscribed` -- The app is not subscribed to the required events. */ +export class AppNotSubscribed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotSubscribed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_not_subscribed" } }], + ) {} + +/** `app_owner_not_found` -- The app's owner could not be resolved, so app_owner cannot be applied. */ +export class AppOwnerNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppOwnerNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "app_owner_not_found" } }], + ) {} + +/** `auth_mismatch` -- The given authorization token is not associated with the app that sent this event. */ +export class AuthMismatch + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AuthMismatch", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "auth_mismatch" } }], + ) {} + +/** `bad_client_secret` -- Value passed for `client_secret` was invalid. */ +export class BadClientSecret + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadClientSecret", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_client_secret" } }], + ) {} + +/** `client_id_token_mismatch` -- The provided client ID and token do not belong to the same app. */ +export class ClientIdTokenMismatch + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ClientIdTokenMismatch", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "client_id_token_mismatch" } }], + ) {} + +/** `datastore_error` -- Datastore error */ +export class DatastoreError + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DatastoreError", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "datastore_error" } }], + ) {} + +/** `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. */ +export class DatastoreMigrationInProgress + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DatastoreMigrationInProgress", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "datastore_migration_in_progress" } }], + ) {} + +/** `dynamic_client_registration_failed` -- Dynamic client registration failed for an MCP server that requires OAuth authentication. */ +export class DynamicClientRegistrationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "DynamicClientRegistrationFailed", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "dynamic_client_registration_failed" } }], + ) {} + +/** `dynamic_client_registration_invalid_redirect_uri` -- The remote server rejected Slack's redirect URI during Dynamic Client Registration. The server must allowlist https://oauth2.slack.com/external/auth/callback as a valid redirect URI. */ +export class DynamicClientRegistrationInvalidRedirectUri + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "DynamicClientRegistrationInvalidRedirectUri", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "dynamic_client_registration_invalid_redirect_uri" } }], + ) {} + +/** `dynamic_client_registration_invalid_response` -- The MCP server returned an invalid response during Dynamic Client Registration. */ +export class DynamicClientRegistrationInvalidResponse + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "DynamicClientRegistrationInvalidResponse", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "dynamic_client_registration_invalid_response" } }], + ) {} + +/** `dynamic_client_registration_missing_oauth_endpoints` -- The MCP server's OAuth metadata is missing a required authorization or token endpoint. */ +export class DynamicClientRegistrationMissingOauthEndpoints + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "DynamicClientRegistrationMissingOauthEndpoints", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "dynamic_client_registration_missing_oauth_endpoints" } }], + ) {} + +/** `dynamic_client_registration_not_supported` -- The MCP server's OAuth metadata does not include a registration endpoint. The server may not support Dynamic Client Registration. */ +export class DynamicClientRegistrationNotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "DynamicClientRegistrationNotSupported", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "dynamic_client_registration_not_supported" } }], + ) {} + +/** `dynamic_client_registration_rejected` -- The MCP server rejected the Dynamic Client Registration request. */ +export class DynamicClientRegistrationRejected + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "DynamicClientRegistrationRejected", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "dynamic_client_registration_rejected" } }], + ) {} + +/** `enterprise_is_restricted` -- Org-level tokens are not allowed. */ +export class EnterpriseIsRestricted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EnterpriseIsRestricted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "enterprise_is_restricted" } }], + ) {} + +/** `enterprise_only_feature` -- App permissions are only available on Enterprise Grid plans. Upgrade the app's org to configure who can interact with it. */ +export class EnterpriseOnlyFeature + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EnterpriseOnlyFeature", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "enterprise_only_feature" } }], + ) {} + +/** `error_bad_format` -- Icon must be a valid image file. */ +export class ErrorBadFormat + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorBadFormat", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_bad_format" } }], + ) {} + +/** `failed_adding_collaborator` -- Failed writing a collaborator record for this new app */ +export class FailedAddingCollaborator + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedAddingCollaborator", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_adding_collaborator" } }], + ) {} + +/** `failed_creating_app` -- Failed to create the app model */ +export class FailedCreatingApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedCreatingApp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_creating_app" } }], + ) {} + +/** `failed_datastore_operation` -- Failed while managing datastore infrastructure */ +export class FailedDatastoreOperation + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedDatastoreOperation", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_datastore_operation" } }], + ) {} + +/** `failed_export` -- Failed to export manifest for given app ID */ +export class FailedExport + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedExport", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_export" } }], + ) {} + +/** `failed_generating_app_token` -- App level token failed to generate. */ +export class FailedGeneratingAppToken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedGeneratingAppToken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_generating_app_token" } }], + ) {} + +/** `feature_disabled_for_lite_sandbox` -- Lite sandboxes cannot use Slack-hosted infrastructure */ +export class FeatureDisabledForLiteSandbox + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FeatureDisabledForLiteSandbox", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "feature_disabled_for_lite_sandbox" } }], + ) {} + +/** `feature_not_enabled` -- This method is not enabled for the manager app's organization, or bot tokens are not enabled for it. */ +export class FeatureNotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FeatureNotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "feature_not_enabled" } }], + ) {} + +/** `forbidden_team` -- The authenticated team cannot use this API */ +export class ForbiddenTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ForbiddenTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "forbidden_team" } }], + ) {} + +/** `free_team_not_allowed` -- Feature is only available on a paid team. */ +export class FreeTeamNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FreeTeamNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "free_team_not_allowed" } }], + ) {} + +/** `icon_not_accessible` -- The icon URL is not accessible or returned an error (e.g. 404 Not Found). Please verify the URL is publicly reachable and returns a valid image. */ +export class IconNotAccessible + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("IconNotAccessible", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "icon_not_accessible" } }], + ) {} + +/** `insecure_request` -- The method was not called via a `POST` request. */ +export class InsecureRequest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InsecureRequest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "insecure_request" } }], + ) {} + +/** `invalid_app` -- App ID provided is not valid for team and user. */ +export class InvalidApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidApp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_app" } }], + ) {} + +/** `invalid_app_id` -- App ID provided is not valid. */ +export class InvalidAppId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAppId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_app_id" } }], + ) {} + +/** `invalid_args` -- Required arguments either were not provided or contain invalid values. */ +export class InvalidArgs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArgs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_args" } }], + ) {} + +/** `invalid_arguments` -- The request is missing required arguments. */ +export class InvalidArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_arguments" } }], + ) {} + +/** `invalid_client_id` -- Value passed for `client_id` was invalid. */ +export class InvalidClientId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidClientId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_client_id" } }], + ) {} + +/** `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_datastore` -- The provided datastore is invalid. */ +export class InvalidDatastore + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidDatastore", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_datastore" } }], + ) {} + +/** `invalid_event_context` -- The given `event_context` didn't match an event. */ +export class InvalidEventContext + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEventContext", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_event_context" } }], + ) {} + +/** `invalid_icon_size` -- Icon dimensions must be between 512x512px and 2000x2000px. */ +export class InvalidIconSize + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidIconSize", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_icon_size" } }], + ) {} + +/** `invalid_manager_app` -- The calling app is not enrolled as a manager app. Ensure the app has `app_configurations:write` in its configured scopes and its home team has manager app support enabled. */ +export class InvalidManagerApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidManagerApp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_manager_app" } }], + ) {} + +/** `invalid_manifest` -- The provided manifest file does not validate against schema. Consult the additional errors field to locate specific issues. */ +export class InvalidManifest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidManifest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_manifest" } }], + ) {} + +/** `invalid_parameters` -- Only one of `URL` or `file` can be defined. */ +export class InvalidParameters + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidParameters", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_parameters" } }], + ) {} + +/** `invalid_team_id` -- The provided team ID is not valid */ +export class InvalidTeamId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTeamId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_team_id" } }], + ) {} + +/** `managed_app_limit_reached` -- The manager app has reached the maximum number of managed apps it can create. */ +export class ManagedAppLimitReached + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ManagedAppLimitReached", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "managed_app_limit_reached" } }], + ) {} + +/** `manager_app_not_eligible` -- The manager app the token was issued to is not eligible to configure app permissions, for example because it no longer has `app_configurations:write` in its configuration. */ +export class ManagerAppNotEligible + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ManagerAppNotEligible", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "manager_app_not_eligible" } }], + ) {} + +/** `method_not_supported` -- This API method is not supported */ +export class MethodNotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MethodNotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "method_not_supported" } }], + ) {} + +/** `missing_args` -- An [app-level token](/authentication/tokens#app) wasn't provided. */ +export class MissingArgs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_args" } }], + ) {} + +/** `missing_arguments` -- One of `URL` or `file` must be provided. */ +export class MissingArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_arguments" } }], + ) {} + +/** `missing_scope` -- The token provided doesn't have the required scopes. */ +export class MissingScope + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingScope", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_scope" } }], + ) {} + +/** `no_permission` -- User does not have required permissions for app. */ +export class NoPermission + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoPermission", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_permission" } }], + ) {} + +/** `no_refresh_token` -- No refresh token found for the passed external_token_id */ +export class NoRefreshToken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoRefreshToken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_refresh_token" } }], + ) {} + +/** `not_in_team` -- Cannot create an app in a team that user is not a member of */ +export class NotInTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotInTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_in_team" } }], + ) {} + +/** `no_tokens_found` -- No tokens found to delete */ +export class NoTokensFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoTokensFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_tokens_found" } }], + ) {} + +/** `oauth_metadata_not_found` -- Could not discover OAuth metadata for the MCP server. Ensure the server exposes a .well-known/oauth-authorization-server or .well-known/openid-configuration endpoint. */ +export class OauthMetadataNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OauthMetadataNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "oauth_metadata_not_found" } }], + ) {} + +/** `partial_failure` -- some items failed to be deleted */ +export class PartialFailure + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PartialFailure", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "partial_failure" } }], + ) {} + +/** `providers_not_found` -- The provided `provider_key` is invalid */ +export class ProvidersNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ProvidersNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "providers_not_found" } }], + ) {} + +/** `published_app_only` -- This action is only permitted for published app IDs. */ +export class PublishedAppOnly + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PublishedAppOnly", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "published_app_only" } }], + ) {} + +/** `restricted_plan_level` -- Feature is not available on this team */ +export class RestrictedPlanLevel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedPlanLevel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_plan_level" } }], + ) {} + +/** `socket_mode_not_enabled` -- Socket mode is not enabled in manifest. */ +export class SocketModeNotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SocketModeNotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "socket_mode_not_enabled" } }], + ) {} + +/** `team_quota_exceeded` -- Total number of requests exceeded team quota. */ +export class TeamQuotaExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamQuotaExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "team_quota_exceeded" } }], + ) {} + +/** `token_not_found` -- The token pointed to by the external_token_id input is not found */ +export class TokenNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TokenNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "token_not_found" } }], + ) {} + +/** `unable_to_delete` -- There was an error deleting tokens */ +export class UnableToDelete + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnableToDelete", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unable_to_delete" } }], + ) {} + +/** `unable_to_open_file` -- Error with file upload. */ +export class UnableToOpenFile + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnableToOpenFile", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unable_to_open_file" } }], + ) {} + +/** `unknown_method` -- This method does not exist */ +export class UnknownMethod + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownMethod", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_method" } }], + ) {} + +/** `user_not_found` -- Value passed for `user_id` was invalid. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + /** IDs of items to be deleted */ export type BulkDeleteRequestIdsList = Array; export interface BulkDeleteRequest { @@ -102,7 +1031,7 @@ export interface CreateManifestRequest { export interface CreateManifestResponseCredentials { client_id?: string | undefined; client_secret?: string | Redacted.Redacted | undefined; - verification_token?: string | undefined; + verification_token?: string | Redacted.Redacted | undefined; signing_secret?: string | Redacted.Redacted | undefined; } export interface CreateManifestResponse { @@ -432,8 +1361,21 @@ export interface ValidateManifestResponse { /** Non-blocking warnings from app manifest validation. */ warnings?: ValidateManifestResponseWarningsList | undefined; } -export type BulkDeleteError = SlackOpError; -/** Delete items from a datastore in bulk Required scopes -- bot: `datastore:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to create datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore put not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `unknown_method` -- This method does not exist - `partial_failure` -- some items failed to be deleted - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.bulkDelete */ +export type BulkDeleteError = + | AccessDenied + | AppNotHosted + | DatastoreError + | DatastoreMigrationInProgress + | FreeTeamNotAllowed + | InvalidAppId + | InvalidArguments + | InvalidDatastore + | PartialFailure + | RestrictedPlanLevel + | TeamQuotaExceeded + | UnknownMethod + | SlackOpError; +/** Delete items from a datastore in bulk Required scopes -- bot: `datastore:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to create datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore put not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `unknown_method` -- This method does not exist - `partial_failure` -- some items failed to be deleted - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.bulkDelete */ export const bulkDelete: API.OperationMethod< BulkDeleteRequest, BulkDeleteResponse, @@ -442,15 +1384,43 @@ export const bulkDelete: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppNotHosted, + DatastoreError, + DatastoreMigrationInProgress, + FreeTeamNotAllowed, + InvalidAppId, + InvalidArguments, + InvalidDatastore, + PartialFailure, + RestrictedPlanLevel, + TeamQuotaExceeded, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BulkDelete", })); -export type BulkGetError = SlackOpError; -/** Get items from a datastore in bulk Required scopes -- bot: `datastore:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to create datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore put not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `unknown_method` -- This method does not exist - `partial_failure` -- some items failed to be retrieved - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.bulkGet */ +export type BulkGetError = + | AccessDenied + | AppNotHosted + | DatastoreError + | DatastoreMigrationInProgress + | FreeTeamNotAllowed + | InvalidAppId + | InvalidArguments + | InvalidDatastore + | PartialFailure + | RestrictedPlanLevel + | TeamQuotaExceeded + | UnknownMethod + | SlackOpError; +/** Get items from a datastore in bulk Required scopes -- bot: `datastore:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to create datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore put not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `unknown_method` -- This method does not exist - `partial_failure` -- some items failed to be retrieved - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.bulkGet */ export const bulkGet: API.OperationMethod< BulkGetRequest, BulkGetResponse, @@ -459,83 +1429,209 @@ export const bulkGet: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c2, 0) as any as S.Schema, output: __S(9, __c2, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppNotHosted, + DatastoreError, + DatastoreMigrationInProgress, + FreeTeamNotAllowed, + InvalidAppId, + InvalidArguments, + InvalidDatastore, + PartialFailure, + RestrictedPlanLevel, + TeamQuotaExceeded, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BulkGet", })); -export type BulkPutError = SlackOpError; -/** Creates or replaces existing items in bulk Required scopes -- bot: `datastore:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to create datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore put not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `unknown_method` -- This method does not exist - `partial_failure` -- some items failed to be updated - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.bulkPut */ +export type BulkPutError = + | AccessDenied + | AppNotHosted + | DatastoreError + | DatastoreMigrationInProgress + | FreeTeamNotAllowed + | InvalidAppId + | InvalidArguments + | InvalidDatastore + | PartialFailure + | RestrictedPlanLevel + | TeamQuotaExceeded + | UnknownMethod + | SlackOpError; +/** Creates or replaces existing items in bulk Required scopes -- bot: `datastore:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to create datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore put not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `unknown_method` -- This method does not exist - `partial_failure` -- some items failed to be updated - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.bulkPut */ export const bulkPut: API.OperationMethod< BulkPutRequest, BulkPutResponse, BulkPutError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(64, __c16, 0) as any as S.Schema, - output: __S(65, __c16, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(20, __c5, 0) as any as S.Schema, + output: __S(21, __c5, 1) as any as S.Schema, + errors: [ + AccessDenied, + AppNotHosted, + DatastoreError, + DatastoreMigrationInProgress, + FreeTeamNotAllowed, + InvalidAppId, + InvalidArguments, + InvalidDatastore, + PartialFailure, + RestrictedPlanLevel, + TeamQuotaExceeded, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BulkPut", })); -export type ConnectionsOpenError = SlackOpError; -/** Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over. Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `forbidden_team` -- The authenticated team cannot use this API - `insecure_request` -- The method was not called via a `POST` request. - `internal_error` -- An unexpected exception with the service has occurred. - `invalid_auth` -- The provided [app-level token](/authentication/tokens#app) wasn't valid. - `missing_args` -- An [app-level token](/authentication/tokens#app) wasn't provided. See https://docs.slack.dev/reference/methods/apps.connections.open */ +export type ConnectionsOpenError = ForbiddenTeam | InsecureRequest | MissingArgs | SlackOpError; +/** Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over. Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `forbidden_team` -- The authenticated team cannot use this API - `insecure_request` -- The method was not called via a `POST` request. - `internal_error` -- An unexpected exception with the service has occurred. - `invalid_auth` -- The provided [app-level token](/authentication/tokens#app) wasn't valid. - `missing_args` -- An [app-level token](/authentication/tokens#app) wasn't provided. See https://docs.slack.dev/reference/methods/apps.connections.open */ export const connectionsOpen: API.OperationMethod< ConnectionsOpenRequest, ConnectionsOpenResponse, ConnectionsOpenError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(80, __c20, 0) as any as S.Schema, - output: __S(81, __c20, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(24, __c6, 0) as any as S.Schema, + output: __S(25, __c6, 1) as any as S.Schema, + errors: [ForbiddenTeam, InsecureRequest, MissingArgs, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ConnectionsOpen", })); -export type CreateManifestError = SlackOpError; -/** Create an app from an app manifest. Required scopes -- configuration: `app_configurations:write` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `invalid_app` -- An app created from the provided manifest would not be valid. - `invalid_arguments` -- Invalid API arguments provided. - `invalid_manager_app` -- The calling app is not enrolled as a manager app. Ensure the app has `app_configurations:write` in its configured scopes and its home team has manager app support enabled. - `invalid_manifest` -- The provided manifest file does not validate against schema. Consult the additional errors field to locate specific issues. - `invalid_team_id` -- The provided team ID is not valid - `not_in_team` -- Cannot create an app in a team that user is not a member of - `failed_adding_collaborator` -- Failed writing a collaborator record for this new app - `failed_creating_app` -- Failed to create the app model - `failed_datastore_operation` -- Failed while managing datastore infrastructure - `failed_generating_app_token` -- App level token failed to generate. - `feature_not_enabled` -- The required feature is not enabled for this workspace. - `managed_app_limit_reached` -- The manager app has reached the maximum number of managed apps it can create. - `ratelimited` -- Too many calls in succession to create endpoint during a short period of time. - `socket_mode_not_enabled` -- Socket mode is not enabled in manifest. - `enterprise_is_restricted` -- Org-level tokens are not allowed. - `unknown_method` -- Unknown method - `dynamic_client_registration_invalid_redirect_uri` -- The remote server rejected Slack's redirect URI during Dynamic Client Registration. The server must allowlist https://oauth2.slack.com/external/auth/callback as a valid redirect URI. - `dynamic_client_registration_failed` -- Dynamic client registration failed for an MCP server that requires OAuth authentication. - `oauth_metadata_not_found` -- Could not discover OAuth metadata for the MCP server. Ensure the server exposes a .well-known/oauth-authorization-server or .well-known/openid-configuration endpoint. - `dynamic_client_registration_not_supported` -- The MCP server's OAuth metadata does not include a registration endpoint. The server may not support Dynamic Client Registration. - `dynamic_client_registration_missing_oauth_endpoints` -- The MCP server's OAuth metadata is missing a required authorization or token endpoint. - `dynamic_client_registration_rejected` -- The MCP server rejected the Dynamic Client Registration request. - `dynamic_client_registration_invalid_response` -- The MCP server returned an invalid response during Dynamic Client Registration. See https://docs.slack.dev/reference/methods/apps.manifest.create */ +export type CreateManifestError = + | DynamicClientRegistrationFailed + | DynamicClientRegistrationInvalidRedirectUri + | DynamicClientRegistrationInvalidResponse + | DynamicClientRegistrationMissingOauthEndpoints + | DynamicClientRegistrationNotSupported + | DynamicClientRegistrationRejected + | EnterpriseIsRestricted + | FailedAddingCollaborator + | FailedCreatingApp + | FailedDatastoreOperation + | FailedGeneratingAppToken + | FeatureNotEnabled + | InvalidApp + | InvalidArguments + | InvalidManagerApp + | InvalidManifest + | InvalidTeamId + | ManagedAppLimitReached + | NotInTeam + | OauthMetadataNotFound + | SocketModeNotEnabled + | UnknownMethod + | SlackOpError; +/** Create an app from an app manifest. Required scopes -- configuration: `app_configurations:write` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `invalid_app` -- An app created from the provided manifest would not be valid. - `invalid_arguments` -- Invalid API arguments provided. - `invalid_manager_app` -- The calling app is not enrolled as a manager app. Ensure the app has `app_configurations:write` in its configured scopes and its home team has manager app support enabled. - `invalid_manifest` -- The provided manifest file does not validate against schema. Consult the additional errors field to locate specific issues. - `invalid_team_id` -- The provided team ID is not valid - `not_in_team` -- Cannot create an app in a team that user is not a member of - `failed_adding_collaborator` -- Failed writing a collaborator record for this new app - `failed_creating_app` -- Failed to create the app model - `failed_datastore_operation` -- Failed while managing datastore infrastructure - `failed_generating_app_token` -- App level token failed to generate. - `feature_not_enabled` -- The required feature is not enabled for this workspace. - `managed_app_limit_reached` -- The manager app has reached the maximum number of managed apps it can create. - `ratelimited` -- Too many calls in succession to create endpoint during a short period of time. - `socket_mode_not_enabled` -- Socket mode is not enabled in manifest. - `enterprise_is_restricted` -- Org-level tokens are not allowed. - `unknown_method` -- Unknown method - `dynamic_client_registration_invalid_redirect_uri` -- The remote server rejected Slack's redirect URI during Dynamic Client Registration. The server must allowlist https://oauth2.slack.com/external/auth/callback as a valid redirect URI. - `dynamic_client_registration_failed` -- Dynamic client registration failed for an MCP server that requires OAuth authentication. - `oauth_metadata_not_found` -- Could not discover OAuth metadata for the MCP server. Ensure the server exposes a .well-known/oauth-authorization-server or .well-known/openid-configuration endpoint. - `dynamic_client_registration_not_supported` -- The MCP server's OAuth metadata does not include a registration endpoint. The server may not support Dynamic Client Registration. - `dynamic_client_registration_missing_oauth_endpoints` -- The MCP server's OAuth metadata is missing a required authorization or token endpoint. - `dynamic_client_registration_rejected` -- The MCP server rejected the Dynamic Client Registration request. - `dynamic_client_registration_invalid_response` -- The MCP server returned an invalid response during Dynamic Client Registration. See https://docs.slack.dev/reference/methods/apps.manifest.create */ export const createManifest: API.OperationMethod< CreateManifestRequest, CreateManifestResponse, CreateManifestError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(84, __c21, 0) as any as S.Schema, - output: __S(86, __c21, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(28, __c7, 0) as any as S.Schema, + output: __S(30, __c7, 2) as any as S.Schema, + errors: [ + DynamicClientRegistrationFailed, + DynamicClientRegistrationInvalidRedirectUri, + DynamicClientRegistrationInvalidResponse, + DynamicClientRegistrationMissingOauthEndpoints, + DynamicClientRegistrationNotSupported, + DynamicClientRegistrationRejected, + EnterpriseIsRestricted, + FailedAddingCollaborator, + FailedCreatingApp, + FailedDatastoreOperation, + FailedGeneratingAppToken, + FeatureNotEnabled, + InvalidApp, + InvalidArguments, + InvalidManagerApp, + InvalidManifest, + InvalidTeamId, + ManagedAppLimitReached, + NotInTeam, + OauthMetadataNotFound, + SocketModeNotEnabled, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateManifest", })); -export type DatastoreCountError = SlackOpError; -/** Count the number of items in a datastore that match a query Required scopes -- bot: `datastore:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to access datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore query not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.count */ +export type DatastoreCountError = + | AccessDenied + | AppNotHosted + | DatastoreError + | DatastoreMigrationInProgress + | FreeTeamNotAllowed + | InvalidAppId + | InvalidArguments + | InvalidDatastore + | RestrictedPlanLevel + | TeamQuotaExceeded + | SlackOpError; +/** Count the number of items in a datastore that match a query Required scopes -- bot: `datastore:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to access datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore query not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.count */ export const datastoreCount: API.OperationMethod< DatastoreCountRequest, DatastoreCountResponse, DatastoreCountError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(88, __c22, 0) as any as S.Schema, - output: __S(89, __c22, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(32, __c8, 0) as any as S.Schema, + output: __S(33, __c8, 1) as any as S.Schema, + errors: [ + AccessDenied, + AppNotHosted, + DatastoreError, + DatastoreMigrationInProgress, + FreeTeamNotAllowed, + InvalidAppId, + InvalidArguments, + InvalidDatastore, + RestrictedPlanLevel, + TeamQuotaExceeded, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DatastoreCount", })); -export type DatastoreQueryError = SlackOpError; -/** Query a datastore for items Required scopes -- bot: `datastore:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to access datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore query not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.query */ +export type DatastoreQueryError = + | AccessDenied + | AppNotHosted + | DatastoreError + | DatastoreMigrationInProgress + | FreeTeamNotAllowed + | InvalidAppId + | InvalidArguments + | InvalidDatastore + | RestrictedPlanLevel + | TeamQuotaExceeded + | SlackOpError; +/** Query a datastore for items Required scopes -- bot: `datastore:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to access datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore query not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.query */ export const datastoreQuery: API.PaginatedOperationMethod< DatastoreQueryRequest, DatastoreQueryResponse, @@ -544,9 +1640,22 @@ export const datastoreQuery: API.PaginatedOperationMethod< DatastoreQueryResponseItemsItemMap > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(92, __c23, 0) as any as S.Schema, - output: __S(93, __c23, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(36, __c9, 0) as any as S.Schema, + output: __S(37, __c9, 1) as any as S.Schema, + errors: [ + AccessDenied, + AppNotHosted, + DatastoreError, + DatastoreMigrationInProgress, + FreeTeamNotAllowed, + InvalidAppId, + InvalidArguments, + InvalidDatastore, + RestrictedPlanLevel, + TeamQuotaExceeded, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -562,110 +1671,228 @@ export const datastoreQuery: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type DeleteAuthExternalError = SlackOpError; -/** Delete external auth tokens only on the Slack side Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `unable_to_delete` -- There was an error deleting tokens - `providers_not_found` -- The provided `provider_key` is invalid - `no_tokens_found` -- No tokens found to delete - `method_not_supported` -- This API method is not supported - `app_not_found` -- The provided `app_id` was not found - `token_not_found` -- The token pointed to by the external_token_id input is not found - `invalid_auth` -- The token used to invoke this API doesn't have permission to delete the token pointed to by the external_token_id input - `invalid_args` -- The arguments provided to this API are invalid See https://docs.slack.dev/reference/methods/apps.auth.external.delete */ +export type DeleteAuthExternalError = + | AppNotFound + | InvalidArgs + | MethodNotSupported + | NoTokensFound + | ProvidersNotFound + | TokenNotFound + | UnableToDelete + | SlackOpError; +/** Delete external auth tokens only on the Slack side Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `unable_to_delete` -- There was an error deleting tokens - `providers_not_found` -- The provided `provider_key` is invalid - `no_tokens_found` -- No tokens found to delete - `method_not_supported` -- This API method is not supported - `app_not_found` -- The provided `app_id` was not found - `token_not_found` -- The token pointed to by the external_token_id input is not found - `invalid_auth` -- The token used to invoke this API doesn't have permission to delete the token pointed to by the external_token_id input - `invalid_args` -- The arguments provided to this API are invalid See https://docs.slack.dev/reference/methods/apps.auth.external.delete */ export const deleteAuthExternal: API.OperationMethod< DeleteAuthExternalRequest, DeleteAuthExternalResponse, DeleteAuthExternalError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(100, __c25, 0) as any as S.Schema, - output: __S(104, __c26, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(44, __c11, 0) as any as S.Schema, + output: __S(48, __c12, 0) as any as S.Schema, + errors: [ + AppNotFound, + InvalidArgs, + MethodNotSupported, + NoTokensFound, + ProvidersNotFound, + TokenNotFound, + UnableToDelete, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteAuthExternal", })); -export type DeleteDatastoreError = SlackOpError; -/** Delete an item from a datastore Required scopes -- bot: `datastore:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to delete datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore delete not allowed on a free team. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.delete */ +export type DeleteDatastoreError = + | AccessDenied + | AppNotHosted + | DatastoreError + | DatastoreMigrationInProgress + | FreeTeamNotAllowed + | InvalidAppId + | InvalidArguments + | InvalidDatastore + | RestrictedPlanLevel + | SlackOpError; +/** Delete an item from a datastore Required scopes -- bot: `datastore:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to delete datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore delete not allowed on a free team. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.delete */ export const deleteDatastore: API.OperationMethod< DeleteDatastoreRequest, DeleteDatastoreResponse, DeleteDatastoreError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(108, __c27, 0) as any as S.Schema, - output: __S(104, __c26, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(52, __c13, 0) as any as S.Schema, + output: __S(48, __c12, 0) as any as S.Schema, + errors: [ + AccessDenied, + AppNotHosted, + DatastoreError, + DatastoreMigrationInProgress, + FreeTeamNotAllowed, + InvalidAppId, + InvalidArguments, + InvalidDatastore, + RestrictedPlanLevel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteDatastore", })); -export type DeleteManifestError = SlackOpError; -/** Permanently deletes an app created through app manifests. When called with a manager app token, this method can only delete apps that were created by that manager app. Required scopes -- configuration: `app_configurations:write` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `app_not_eligible` -- The specified app is not eligible for this API. - `app_not_found` -- The specified app was not found. - `internal_error` -- Internal error. - `invalid_app_id` -- The app ID passed in was invalid. - `no_permission` -- User described by the used token does not have proper permissions to take this action. - `published_app_only` -- This action is only permitted for published app IDs. - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only delete apps that it originally created via apps.manifest.create. See https://docs.slack.dev/reference/methods/apps.manifest.delete */ +export type DeleteManifestError = + | AppNotEligible + | AppNotFound + | AppNotOwnedByManagerApp + | InvalidAppId + | NoPermission + | PublishedAppOnly + | SlackOpError; +/** Permanently deletes an app created through app manifests. When called with a manager app token, this method can only delete apps that were created by that manager app. Required scopes -- configuration: `app_configurations:write` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `app_not_eligible` -- The specified app is not eligible for this API. - `app_not_found` -- The specified app was not found. - `internal_error` -- Internal error. - `invalid_app_id` -- The app ID passed in was invalid. - `no_permission` -- User described by the used token does not have proper permissions to take this action. - `published_app_only` -- This action is only permitted for published app IDs. - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only delete apps that it originally created via apps.manifest.create. See https://docs.slack.dev/reference/methods/apps.manifest.delete */ export const deleteManifest: API.OperationMethod< DeleteManifestRequest, DeleteManifestResponse, DeleteManifestError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(112, __c28, 0) as any as S.Schema, - output: __S(104, __c26, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(56, __c14, 0) as any as S.Schema, + output: __S(48, __c12, 0) as any as S.Schema, + errors: [ + AppNotEligible, + AppNotFound, + AppNotOwnedByManagerApp, + InvalidAppId, + NoPermission, + PublishedAppOnly, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteManifest", })); -export type ExportManifestError = SlackOpError; -/** Export an app manifest from an existing app. When called with a manager app token, this method can only export apps that were created by that manager app. Required scopes -- configuration: `app_configurations:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `app_not_eligible` -- The specified app is not eligible for this API. - `app_not_found` -- The specified app was not found or has been deleted. - `failed_export` -- Failed to export manifest for given app ID - `internal_error` -- Internal error. - `invalid_app_id` -- The app ID passed is invalid. - `no_permission` -- User does not have proper permissions. - `unknown_method` -- This method does not exist. - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only access apps that it originally created via apps.manifest.create. See https://docs.slack.dev/reference/methods/apps.manifest.export */ +export type ExportManifestError = + | AppNotEligible + | AppNotFound + | AppNotOwnedByManagerApp + | FailedExport + | InvalidAppId + | NoPermission + | UnknownMethod + | SlackOpError; +/** Export an app manifest from an existing app. When called with a manager app token, this method can only export apps that were created by that manager app. Required scopes -- configuration: `app_configurations:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `app_not_eligible` -- The specified app is not eligible for this API. - `app_not_found` -- The specified app was not found or has been deleted. - `failed_export` -- Failed to export manifest for given app ID - `internal_error` -- Internal error. - `invalid_app_id` -- The app ID passed is invalid. - `no_permission` -- User does not have proper permissions. - `unknown_method` -- This method does not exist. - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only access apps that it originally created via apps.manifest.create. See https://docs.slack.dev/reference/methods/apps.manifest.export */ export const exportManifest: API.OperationMethod< ExportManifestRequest, ExportManifestResponse, ExportManifestError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(20, __c5, 0) as any as S.Schema, - output: __S(21, __c5, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(60, __c15, 0) as any as S.Schema, + output: __S(61, __c15, 1) as any as S.Schema, + errors: [ + AppNotEligible, + AppNotFound, + AppNotOwnedByManagerApp, + FailedExport, + InvalidAppId, + NoPermission, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ExportManifest", })); -export type GetAuthExternalError = SlackOpError; -/** Get the access token for the provided token ID Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `token_not_found` -- No token found for the passed external_token_id - `method_not_supported` -- This API method is not supported - `no_refresh_token` -- No refresh token found for the passed external_token_id - `access_token_exchange_failed` -- There was an error while attempting to exchange or refresh token See https://docs.slack.dev/reference/methods/apps.auth.external.get */ +export type GetAuthExternalError = + | AccessTokenExchangeFailed + | MethodNotSupported + | NoRefreshToken + | TokenNotFound + | SlackOpError; +/** Get the access token for the provided token ID Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `token_not_found` -- No token found for the passed external_token_id - `method_not_supported` -- This API method is not supported - `no_refresh_token` -- No refresh token found for the passed external_token_id - `access_token_exchange_failed` -- There was an error while attempting to exchange or refresh token See https://docs.slack.dev/reference/methods/apps.auth.external.get */ export const getAuthExternal: API.OperationMethod< GetAuthExternalRequest, GetAuthExternalResponse, GetAuthExternalError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(24, __c6, 0) as any as S.Schema, - output: __S(25, __c6, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(64, __c16, 0) as any as S.Schema, + output: __S(65, __c16, 1) as any as S.Schema, + errors: [ + AccessTokenExchangeFailed, + MethodNotSupported, + NoRefreshToken, + TokenNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetAuthExternal", })); -export type GetDatastoreError = SlackOpError; -/** Get an item from a datastore Required scopes -- bot: `datastore:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to get datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error. - `access_denied` -- Not authorized to access to the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore get not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.get */ +export type GetDatastoreError = + | AccessDenied + | AppNotHosted + | DatastoreError + | DatastoreMigrationInProgress + | FreeTeamNotAllowed + | InvalidAppId + | InvalidArguments + | InvalidDatastore + | RestrictedPlanLevel + | TeamQuotaExceeded + | SlackOpError; +/** Get an item from a datastore Required scopes -- bot: `datastore:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to get datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error. - `access_denied` -- Not authorized to access to the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore get not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.get */ export const getDatastore: API.OperationMethod< GetDatastoreRequest, GetDatastoreResponse, GetDatastoreError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(28, __c7, 0) as any as S.Schema, - output: __S(32, __c8, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(68, __c17, 0) as any as S.Schema, + output: __S(72, __c18, 0) as any as S.Schema, + errors: [ + AccessDenied, + AppNotHosted, + DatastoreError, + DatastoreMigrationInProgress, + FreeTeamNotAllowed, + InvalidAppId, + InvalidArguments, + InvalidDatastore, + RestrictedPlanLevel, + TeamQuotaExceeded, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetDatastore", })); -export type ListActivitiesError = SlackOpError; -/** Get logs for a specified app Required scopes -- user: `hosting:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Something went wrong on our end, please try again. - `invalid_app_id` -- App ID provided is not valid. - `invalid_app` -- App ID provided is not valid for team and user. - `invalid_args` -- Required arguments either were not provided or contain invalid values. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `free_team_not_allowed` -- Feature is only available on a paid team. - `restricted_plan_level` -- Feature is not available on this team - `feature_disabled_for_lite_sandbox` -- Lite sandboxes cannot use Slack-hosted infrastructure See https://docs.slack.dev/reference/methods/apps.activities.list */ +export type ListActivitiesError = + | FeatureDisabledForLiteSandbox + | FreeTeamNotAllowed + | InvalidApp + | InvalidAppId + | InvalidArgs + | InvalidCursor + | RestrictedPlanLevel + | SlackOpError; +/** Get logs for a specified app Required scopes -- user: `hosting:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `internal_error` -- Something went wrong on our end, please try again. - `invalid_app_id` -- App ID provided is not valid. - `invalid_app` -- App ID provided is not valid for team and user. - `invalid_args` -- Required arguments either were not provided or contain invalid values. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `free_team_not_allowed` -- Feature is only available on a paid team. - `restricted_plan_level` -- Feature is not available on this team - `feature_disabled_for_lite_sandbox` -- Lite sandboxes cannot use Slack-hosted infrastructure See https://docs.slack.dev/reference/methods/apps.activities.list */ export const listActivities: API.PaginatedOperationMethod< ListActivitiesRequest, ListActivitiesResponse, @@ -674,9 +1901,19 @@ export const listActivities: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(36, __c9, 0) as any as S.Schema, - output: __S(38, __c9, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(76, __c19, 0) as any as S.Schema, + output: __S(78, __c19, 2) as any as S.Schema, + errors: [ + FeatureDisabledForLiteSandbox, + FreeTeamNotAllowed, + InvalidApp, + InvalidAppId, + InvalidArgs, + InvalidCursor, + RestrictedPlanLevel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -692,8 +1929,12 @@ export const listActivities: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListEventAuthorizationsError = SlackOpError; -/** Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `auth_mismatch` -- The given authorization token is not associated with the app that sent this event. - `internal_error` -- An unexpected error occurred while finding authorizations for this event. - `invalid_cursor` -- The `cursor` argument was invalid. - `invalid_event_context` -- The given `event_context` didn't match an event. See https://docs.slack.dev/reference/methods/apps.event.authorizations.list */ +export type ListEventAuthorizationsError = + | AuthMismatch + | InvalidCursor + | InvalidEventContext + | SlackOpError; +/** Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to. Rate limit tier: 5 Method-specific errors (each a typed error named after its slug): - `auth_mismatch` -- The given authorization token is not associated with the app that sent this event. - `internal_error` -- An unexpected error occurred while finding authorizations for this event. - `invalid_cursor` -- The `cursor` argument was invalid. - `invalid_event_context` -- The given `event_context` didn't match an event. See https://docs.slack.dev/reference/methods/apps.event.authorizations.list */ export const listEventAuthorizations: API.PaginatedOperationMethod< ListEventAuthorizationsRequest, ListEventAuthorizationsResponse, @@ -702,9 +1943,9 @@ export const listEventAuthorizations: API.PaginatedOperationMethod< ListEventAuthorizationsResponseAuthorizationsItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(40, __c10, 0) as any as S.Schema, - output: __S(43, __c10, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(80, __c20, 0) as any as S.Schema, + output: __S(83, __c20, 3) as any as S.Schema, + errors: [AuthMismatch, InvalidCursor, InvalidEventContext, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -720,136 +1961,313 @@ export const listEventAuthorizations: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type PutDatastoreError = SlackOpError; -/** Creates a new item, or replaces an old item with a new item. Required scopes -- bot: `datastore:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to create datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore put not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.put */ +export type PutDatastoreError = + | AccessDenied + | AppNotHosted + | DatastoreError + | DatastoreMigrationInProgress + | FreeTeamNotAllowed + | InvalidAppId + | InvalidArguments + | InvalidDatastore + | RestrictedPlanLevel + | TeamQuotaExceeded + | SlackOpError; +/** Creates a new item, or replaces an old item with a new item. Required scopes -- bot: `datastore:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to create datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore put not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.put */ export const putDatastore: API.OperationMethod< PutDatastoreRequest, PutDatastoreResponse, PutDatastoreError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(44, __c11, 0) as any as S.Schema, - output: __S(32, __c8, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(84, __c21, 0) as any as S.Schema, + output: __S(72, __c18, 0) as any as S.Schema, + errors: [ + AccessDenied, + AppNotHosted, + DatastoreError, + DatastoreMigrationInProgress, + FreeTeamNotAllowed, + InvalidAppId, + InvalidArguments, + InvalidDatastore, + RestrictedPlanLevel, + TeamQuotaExceeded, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PutDatastore", })); -export type SetIconError = SlackOpError; -/** Sets the app icon Required scopes -- user: `app_configurations:write` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only set icons for apps that it originally created via apps.manifest.create. - `error_bad_format` -- Icon must be a valid image file. - `internal_error` -- Internal error. - `icon_not_accessible` -- The icon URL is not accessible or returned an error (e.g. 404 Not Found). Please verify the URL is publicly reachable and returns a valid image. - `invalid_app` -- App does not exist. - `invalid_app_id` -- App ID is not valid. - `invalid_icon_size` -- Icon dimensions must be between 512x512px and 2000x2000px. - `invalid_parameters` -- Only one of `URL` or `file` can be defined. - `missing_arguments` -- One of `URL` or `file` must be provided. - `no_permission` -- User does not have required permissions for app. - `unable_to_open_file` -- Error with file upload. - `app_edit_disabled` -- The app cannot be edited. See https://docs.slack.dev/reference/methods/apps.icon.set */ +export type SetIconError = + | AppEditDisabled + | AppNotOwnedByManagerApp + | ErrorBadFormat + | IconNotAccessible + | InvalidApp + | InvalidAppId + | InvalidIconSize + | InvalidParameters + | MissingArguments + | NoPermission + | UnableToOpenFile + | SlackOpError; +/** Sets the app icon Required scopes -- user: `app_configurations:write` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only set icons for apps that it originally created via apps.manifest.create. - `error_bad_format` -- Icon must be a valid image file. - `internal_error` -- Internal error. - `icon_not_accessible` -- The icon URL is not accessible or returned an error (e.g. 404 Not Found). Please verify the URL is publicly reachable and returns a valid image. - `invalid_app` -- App does not exist. - `invalid_app_id` -- App ID is not valid. - `invalid_icon_size` -- Icon dimensions must be between 512x512px and 2000x2000px. - `invalid_parameters` -- Only one of `URL` or `file` can be defined. - `missing_arguments` -- One of `URL` or `file` must be provided. - `no_permission` -- User does not have required permissions for app. - `unable_to_open_file` -- Error with file upload. - `app_edit_disabled` -- The app cannot be edited. See https://docs.slack.dev/reference/methods/apps.icon.set */ export const setIcon: API.OperationMethod< SetIconRequest, SetIconResponse, SetIconError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(48, __c12, 0) as any as S.Schema, - output: __S(104, __c26, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(88, __c22, 0) as any as S.Schema, + output: __S(48, __c12, 0) as any as S.Schema, + errors: [ + AppEditDisabled, + AppNotOwnedByManagerApp, + ErrorBadFormat, + IconNotAccessible, + InvalidApp, + InvalidAppId, + InvalidIconSize, + InvalidParameters, + MissingArguments, + NoPermission, + UnableToOpenFile, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetIcon", })); -export type SetManagedPermissionsError = SlackOpError; -/** Set who can interact with a managed app. Lets the builder who created a managed app on a partner platform configure the app's permissions, using a user token or bot token from the manager app. Permissions can only be set before the app is installed: if the app is already installed, this method makes no change and returns the app's current permissions. Required scopes -- configuration: `app_configurations:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_auth` -- Invalid authorization token. - `access_denied` -- The token was not issued to a manager app that is eligible to configure managed apps. - `manager_app_not_eligible` -- The manager app the token was issued to is not eligible to configure app permissions, for example because it no longer has `app_configurations:write` in its configuration. - `feature_not_enabled` -- This method is not enabled for the manager app's organization, or bot tokens are not enabled for it. - `app_not_found` -- This app does not exist. - `app_not_managed` -- The specified app is not currently managed by any manager app. - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only set permissions for apps that it originally created and currently manages. - `app_owner_not_found` -- The app's owner could not be resolved, so app_owner cannot be applied. - `enterprise_only_feature` -- App permissions are only available on Enterprise Grid plans. Upgrade the app's org to configure who can interact with it. - `internal_error` -- The app's current installations could not be determined, so permissions were not changed. Retry the request. See https://docs.slack.dev/reference/methods/apps.managed.permissions.set */ +export type SetManagedPermissionsError = + | AccessDenied + | AppNotFound + | AppNotManaged + | AppNotOwnedByManagerApp + | AppOwnerNotFound + | EnterpriseOnlyFeature + | FeatureNotEnabled + | ManagerAppNotEligible + | SlackOpError; +/** Set who can interact with a managed app. Lets the builder who created a managed app on a partner platform configure the app's permissions, using a user token or bot token from the manager app. Permissions can only be set before the app is installed: if the app is already installed, this method makes no change and returns the app's current permissions. Required scopes -- configuration: `app_configurations:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_auth` -- Invalid authorization token. - `access_denied` -- The token was not issued to a manager app that is eligible to configure managed apps. - `manager_app_not_eligible` -- The manager app the token was issued to is not eligible to configure app permissions, for example because it no longer has `app_configurations:write` in its configuration. - `feature_not_enabled` -- This method is not enabled for the manager app's organization, or bot tokens are not enabled for it. - `app_not_found` -- This app does not exist. - `app_not_managed` -- The specified app is not currently managed by any manager app. - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only set permissions for apps that it originally created and currently manages. - `app_owner_not_found` -- The app's owner could not be resolved, so app_owner cannot be applied. - `enterprise_only_feature` -- App permissions are only available on Enterprise Grid plans. Upgrade the app's org to configure who can interact with it. - `internal_error` -- The app's current installations could not be determined, so permissions were not changed. Retry the request. See https://docs.slack.dev/reference/methods/apps.managed.permissions.set */ export const setManagedPermissions: API.OperationMethod< SetManagedPermissionsRequest, SetManagedPermissionsResponse, SetManagedPermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(52, __c13, 0) as any as S.Schema, - output: __S(104, __c26, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(92, __c23, 0) as any as S.Schema, + output: __S(48, __c12, 0) as any as S.Schema, + errors: [ + AccessDenied, + AppNotFound, + AppNotManaged, + AppNotOwnedByManagerApp, + AppOwnerNotFound, + EnterpriseOnlyFeature, + FeatureNotEnabled, + ManagerAppNotEligible, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetManagedPermissions", })); -export type UninstallAppError = SlackOpError; -/** Uninstalls your app from a workspace. Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `client_id_token_mismatch` -- The provided client ID and token do not belong to the same app. - `internal_error` -- Internal error uninstall - `invalid_client_id` -- Value passed for `client_id` was invalid. - `no_permission` -- Granular bot not allowed to uninstall See https://docs.slack.dev/reference/methods/apps.uninstall */ +export type UninstallAppError = + | BadClientSecret + | ClientIdTokenMismatch + | InvalidClientId + | NoPermission + | SlackOpError; +/** Uninstalls your app from a workspace. Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `client_id_token_mismatch` -- The provided client ID and token do not belong to the same app. - `internal_error` -- Internal error uninstall - `invalid_client_id` -- Value passed for `client_id` was invalid. - `no_permission` -- Granular bot not allowed to uninstall See https://docs.slack.dev/reference/methods/apps.uninstall */ export const uninstallApp: API.OperationMethod< UninstallAppRequest, UninstallAppResponse, UninstallAppError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(56, __c14, 0) as any as S.Schema, - output: __S(57, __c14, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(96, __c24, 0) as any as S.Schema, + output: __S(97, __c24, 1) as any as S.Schema, + errors: [ + BadClientSecret, + ClientIdTokenMismatch, + InvalidClientId, + NoPermission, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UninstallApp", })); -export type UpdateDatastoreError = SlackOpError; -/** Edits an existing item's attributes, or adds a new item if it does not already exist. Required scopes -- bot: `datastore:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to create datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore put not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.update */ +export type UpdateDatastoreError = + | AccessDenied + | AppNotHosted + | DatastoreError + | DatastoreMigrationInProgress + | FreeTeamNotAllowed + | InvalidAppId + | InvalidArguments + | InvalidDatastore + | RestrictedPlanLevel + | TeamQuotaExceeded + | SlackOpError; +/** Edits an existing item's attributes, or adds a new item if it does not already exist. Required scopes -- bot: `datastore:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The request is missing required arguments. - `invalid_datastore` -- The provided datastore is invalid. - `invalid_auth` -- Not authorized to create datastore items. - `app_not_hosted` -- The app developer is not using a Slack-hosted environment. App datastores are exclusively available for Slack-hosted apps. - `datastore_error` -- Datastore error - `access_denied` -- Not authorized to access the datastore. - `invalid_app_id` -- The app_id provided is not valid for team and user. - `free_team_not_allowed` -- Datastore put not allowed on a free team. - `team_quota_exceeded` -- Total number of requests exceeded team quota. - `datastore_migration_in_progress` -- The datastore is currently unavailable due to an in progress Enterprise org migration. - `restricted_plan_level` -- Feature is not available on this team See https://docs.slack.dev/reference/methods/apps.datastore.update */ export const updateDatastore: API.OperationMethod< UpdateDatastoreRequest, UpdateDatastoreResponse, UpdateDatastoreError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(60, __c15, 0) as any as S.Schema, - output: __S(32, __c8, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(100, __c25, 0) as any as S.Schema, + output: __S(72, __c18, 0) as any as S.Schema, + errors: [ + AccessDenied, + AppNotHosted, + DatastoreError, + DatastoreMigrationInProgress, + FreeTeamNotAllowed, + InvalidAppId, + InvalidArguments, + InvalidDatastore, + RestrictedPlanLevel, + TeamQuotaExceeded, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateDatastore", })); -export type UpdateManifestError = SlackOpError; -/** Update an app from an app manifest. When called with a manager app token, this method can only update apps that were created by that manager app. Required scopes -- configuration: `app_configurations:write` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `app_not_eligible` -- The specified app is not eligible for this API. - `app_not_found` -- The specified app was not found or has been deleted. - `failed_adding_collaborator` -- Failed writing a collaborator record for this new app - `failed_creating_app` -- Failed to create the app model - `failed_datastore_operation` -- Failed while managing datastore infrastructure - `internal_error` -- Internal error. - `invalid_app` -- An app created from the provided manifest would not be valid. - `invalid_app_id` -- The app id passed is invalid. - `invalid_manifest` -- The provided manifest file does not validate against schema. - `no_permission` -- User does not have permission to update app - `unknown_method` -- Unknown method - `dynamic_client_registration_invalid_redirect_uri` -- The remote server rejected Slack's redirect URI during Dynamic Client Registration. The server must allowlist https://oauth2.slack.com/external/auth/callback as a valid redirect URI. - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only update apps that it originally created via apps.manifest.create. It cannot modify apps created by other manager apps or apps created manually, even if the same user owns both. - `ratelimited` -- Too many calls in succession to update endpoint during a short period of time. - `dynamic_client_registration_failed` -- Dynamic client registration failed for an MCP server that requires OAuth authentication. - `oauth_metadata_not_found` -- Could not discover OAuth metadata for the MCP server. Ensure the server exposes a .well-known/oauth-authorization-server or .well-known/openid-configuration endpoint. - `dynamic_client_registration_not_supported` -- The MCP server's OAuth metadata does not include a registration endpoint. The server may not support Dynamic Client Registration. - `dynamic_client_registration_missing_oauth_endpoints` -- The MCP server's OAuth metadata is missing a required authorization or token endpoint. - `dynamic_client_registration_rejected` -- The MCP server rejected the Dynamic Client Registration request. - `dynamic_client_registration_invalid_response` -- The MCP server returned an invalid response during Dynamic Client Registration. - `app_edit_disabled` -- The app cannot be edited. See https://docs.slack.dev/reference/methods/apps.manifest.update */ +export type UpdateManifestError = + | AppEditDisabled + | AppNotEligible + | AppNotFound + | AppNotOwnedByManagerApp + | DynamicClientRegistrationFailed + | DynamicClientRegistrationInvalidRedirectUri + | DynamicClientRegistrationInvalidResponse + | DynamicClientRegistrationMissingOauthEndpoints + | DynamicClientRegistrationNotSupported + | DynamicClientRegistrationRejected + | FailedAddingCollaborator + | FailedCreatingApp + | FailedDatastoreOperation + | InvalidApp + | InvalidAppId + | InvalidManifest + | NoPermission + | OauthMetadataNotFound + | UnknownMethod + | SlackOpError; +/** Update an app from an app manifest. When called with a manager app token, this method can only update apps that were created by that manager app. Required scopes -- configuration: `app_configurations:write` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `app_not_eligible` -- The specified app is not eligible for this API. - `app_not_found` -- The specified app was not found or has been deleted. - `failed_adding_collaborator` -- Failed writing a collaborator record for this new app - `failed_creating_app` -- Failed to create the app model - `failed_datastore_operation` -- Failed while managing datastore infrastructure - `internal_error` -- Internal error. - `invalid_app` -- An app created from the provided manifest would not be valid. - `invalid_app_id` -- The app id passed is invalid. - `invalid_manifest` -- The provided manifest file does not validate against schema. - `no_permission` -- User does not have permission to update app - `unknown_method` -- Unknown method - `dynamic_client_registration_invalid_redirect_uri` -- The remote server rejected Slack's redirect URI during Dynamic Client Registration. The server must allowlist https://oauth2.slack.com/external/auth/callback as a valid redirect URI. - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only update apps that it originally created via apps.manifest.create. It cannot modify apps created by other manager apps or apps created manually, even if the same user owns both. - `ratelimited` -- Too many calls in succession to update endpoint during a short period of time. - `dynamic_client_registration_failed` -- Dynamic client registration failed for an MCP server that requires OAuth authentication. - `oauth_metadata_not_found` -- Could not discover OAuth metadata for the MCP server. Ensure the server exposes a .well-known/oauth-authorization-server or .well-known/openid-configuration endpoint. - `dynamic_client_registration_not_supported` -- The MCP server's OAuth metadata does not include a registration endpoint. The server may not support Dynamic Client Registration. - `dynamic_client_registration_missing_oauth_endpoints` -- The MCP server's OAuth metadata is missing a required authorization or token endpoint. - `dynamic_client_registration_rejected` -- The MCP server rejected the Dynamic Client Registration request. - `dynamic_client_registration_invalid_response` -- The MCP server returned an invalid response during Dynamic Client Registration. - `app_edit_disabled` -- The app cannot be edited. See https://docs.slack.dev/reference/methods/apps.manifest.update */ export const updateManifest: API.OperationMethod< UpdateManifestRequest, UpdateManifestResponse, UpdateManifestError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(68, __c17, 0) as any as S.Schema, - output: __S(69, __c17, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(104, __c26, 0) as any as S.Schema, + output: __S(105, __c26, 1) as any as S.Schema, + errors: [ + AppEditDisabled, + AppNotEligible, + AppNotFound, + AppNotOwnedByManagerApp, + DynamicClientRegistrationFailed, + DynamicClientRegistrationInvalidRedirectUri, + DynamicClientRegistrationInvalidResponse, + DynamicClientRegistrationMissingOauthEndpoints, + DynamicClientRegistrationNotSupported, + DynamicClientRegistrationRejected, + FailedAddingCollaborator, + FailedCreatingApp, + FailedDatastoreOperation, + InvalidApp, + InvalidAppId, + InvalidManifest, + NoPermission, + OauthMetadataNotFound, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateManifest", })); -export type UpdateUserConnectionError = SlackOpError; -/** Updates the connection status between a user and an app. Required scopes -- user: `users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `app_not_found` -- The app was not found. - `invalid_auth` -- The token doesn't have access to this endpoint. - `app_not_subscribed` -- The app is not subscribed to the required events. - `user_not_found` -- Value passed for `user_id` was invalid. - `missing_scope` -- The token provided doesn't have the required scopes. - `internal_error` -- The connection status could not be written. Retry the call. See https://docs.slack.dev/reference/methods/apps.user.connection.update */ +export type UpdateUserConnectionError = + | AppNotFound + | AppNotSubscribed + | MissingScope + | UserNotFound + | SlackOpError; +/** Updates the connection status between a user and an app. Required scopes -- user: `users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `app_not_found` -- The app was not found. - `invalid_auth` -- The token doesn't have access to this endpoint. - `app_not_subscribed` -- The app is not subscribed to the required events. - `user_not_found` -- Value passed for `user_id` was invalid. - `missing_scope` -- The token provided doesn't have the required scopes. - `internal_error` -- The connection status could not be written. Retry the call. See https://docs.slack.dev/reference/methods/apps.user.connection.update */ export const updateUserConnection: API.OperationMethod< UpdateUserConnectionRequest, UpdateUserConnectionResponse, UpdateUserConnectionError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(72, __c18, 0) as any as S.Schema, - output: __S(104, __c26, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(108, __c27, 0) as any as S.Schema, + output: __S(48, __c12, 0) as any as S.Schema, + errors: [AppNotFound, AppNotSubscribed, MissingScope, UserNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateUserConnection", })); -export type ValidateManifestError = SlackOpError; -/** Validate an app manifest Required scopes -- configuration: `app_configurations:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `app_not_eligible` -- The specified app is not eligible for this API. - `invalid_app` -- An app created from the provided manifest would not be valid. - `invalid_app_id` -- The app id passed is invalid. - `invalid_manifest` -- The provided manifest file does not validate against schema. - `failed_adding_collaborator` -- Failed writing a collaborator record for this new app - `failed_creating_app` -- Failed to create the app model - `unknown_method` -- Unknown method - `no_permission` -- User described by the used token does not have proper permissions to take this action. - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only validate apps that it originally created via apps.manifest.create. - `app_edit_disabled` -- The app cannot be edited. See https://docs.slack.dev/reference/methods/apps.manifest.validate */ +export type ValidateManifestError = + | AppEditDisabled + | AppNotEligible + | AppNotOwnedByManagerApp + | FailedAddingCollaborator + | FailedCreatingApp + | InvalidApp + | InvalidAppId + | InvalidManifest + | NoPermission + | UnknownMethod + | SlackOpError; +/** Validate an app manifest Required scopes -- configuration: `app_configurations:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `app_not_eligible` -- The specified app is not eligible for this API. - `invalid_app` -- An app created from the provided manifest would not be valid. - `invalid_app_id` -- The app id passed is invalid. - `invalid_manifest` -- The provided manifest file does not validate against schema. - `failed_adding_collaborator` -- Failed writing a collaborator record for this new app - `failed_creating_app` -- Failed to create the app model - `unknown_method` -- Unknown method - `no_permission` -- User described by the used token does not have proper permissions to take this action. - `app_not_owned_by_manager_app` -- The specified app is not managed by the calling manager app. A manager app can only validate apps that it originally created via apps.manifest.create. - `app_edit_disabled` -- The app cannot be edited. See https://docs.slack.dev/reference/methods/apps.manifest.validate */ export const validateManifest: API.OperationMethod< ValidateManifestRequest, ValidateManifestResponse, ValidateManifestError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(76, __c19, 0) as any as S.Schema, - output: __S(79, __c19, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(112, __c28, 0) as any as S.Schema, + output: __S(115, __c28, 3) as any as S.Schema, + errors: [ + AppEditDisabled, + AppNotEligible, + AppNotOwnedByManagerApp, + FailedAddingCollaborator, + FailedCreatingApp, + InvalidApp, + InvalidAppId, + InvalidManifest, + NoPermission, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -915,6 +2333,174 @@ function __c4(j: number): any { } } function __c5(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + datastore: S.String, + items: __S(16, __c4, 0), + app_id: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/apps.datastore.bulkPut", code: 200 })), + ).annotate({ identifier: "BulkPutRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + datastore: S.optional(S.String), + failed_items: S.optional(__S(16, __c4, 0)), + }), + ).annotate({ identifier: "BulkPutResponse" }); + } +} +function __c6(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({}).pipe(T.Http({ method: "POST", uri: "/apps.connections.open", code: 200 })), + ).annotate({ identifier: "ConnectionsOpenRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + url: S.String, + }), + ).annotate({ identifier: "ConnectionsOpenResponse" }); + } +} +function __c7(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + manifest: S.String, + team_id: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/apps.manifest.create", code: 200 })), + ).annotate({ identifier: "CreateManifestRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + client_id: S.optional(S.String), + client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))), + verification_token: S.optional(S.String.pipe(T.SensitiveValue({}))), + signing_secret: S.optional(S.String.pipe(T.SensitiveValue({}))), + }), + ).annotate({ identifier: "CreateManifestResponseCredentials" }); + case 2: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + app_id: S.String, + credentials: __S(29, __c7, 1), + oauth_authorize_url: S.optional(S.String), + team_id: S.optional(S.String), + team_domain: S.optional(S.String), + app_token: S.optional(S.String), + }), + ).annotate({ identifier: "CreateManifestResponse" }); + } +} +function __c8(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + datastore: S.String, + expression: S.optional(S.String), + expression_attributes: S.optional(__S(12, __c3, 0)), + expression_values: S.optional(__S(12, __c3, 0)), + app_id: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/apps.datastore.count", code: 200 })), + ).annotate({ identifier: "DatastoreCountRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + datastore: S.optional(S.String), + count: S.optional(S.Number), + }), + ).annotate({ identifier: "DatastoreCountResponse" }); + } +} +function __c9(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + datastore: S.String, + expression: S.optional(S.String), + expression_attributes: S.optional(__S(12, __c3, 0)), + expression_values: S.optional(__S(12, __c3, 0)), + app_id: S.optional(S.String), + cursor: S.optional(S.String), + limit: S.optional(S.Number), + }).pipe(T.Http({ method: "POST", uri: "/apps.datastore.query", code: 200 })), + ).annotate({ identifier: "DatastoreQueryRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + datastore: S.optional(S.String), + items: __S(16, __c4, 0), + response_metadata: S.optional(__S(40, __c10, 0)), + }), + ).annotate({ identifier: "DatastoreQueryResponse" }); + } +} +function __c10(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + next_cursor: S.optional(S.String), + }), + ).annotate({ identifier: "DatastoreQueryResponseResponseMetadata" }); + } +} +function __c11(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + app_id: S.optional(S.String), + provider_key: S.optional(S.String), + external_token_id: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/apps.auth.external.delete", code: 200 })), + ).annotate({ identifier: "DeleteAuthExternalRequest" }); + } +} +function __c12(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + }), + ).annotate({ identifier: "DeleteAuthExternalResponse" }); + } +} +function __c13(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + datastore: S.String, + id: S.String, + app_id: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/apps.datastore.delete", code: 200 })), + ).annotate({ identifier: "DeleteDatastoreRequest" }); + } +} +function __c14(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + app_id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/apps.manifest.delete", code: 200 })), + ).annotate({ identifier: "DeleteManifestRequest" }); + } +} +function __c15(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -931,7 +2517,7 @@ function __c5(j: number): any { ).annotate({ identifier: "ExportManifestResponse" }); } } -function __c6(j: number): any { +function __c16(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -950,7 +2536,7 @@ function __c6(j: number): any { ).annotate({ identifier: "GetAuthExternalResponse" }); } } -function __c7(j: number): any { +function __c17(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -962,7 +2548,7 @@ function __c7(j: number): any { ).annotate({ identifier: "GetDatastoreRequest" }); } } -function __c8(j: number): any { +function __c18(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -974,7 +2560,7 @@ function __c8(j: number): any { ).annotate({ identifier: "GetDatastoreResponse" }); } } -function __c9(j: number): any { +function __c19(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1007,13 +2593,13 @@ function __c9(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - activities: __S(37, __c9, 1), - response_metadata: S.optional(__S(96, __c24, 0)), + activities: __S(77, __c19, 1), + response_metadata: S.optional(__S(40, __c10, 0)), }), ).annotate({ identifier: "ListActivitiesResponse" }); } } -function __c10(j: number): any { +function __c20(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1034,19 +2620,19 @@ function __c10(j: number): any { }), ).annotate({ identifier: "ListEventAuthorizationsResponseAuthorizationsItem" }); case 2: - return S.Array(__S(41, __c10, 1)); + return S.Array(__S(81, __c20, 1)); case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, cursor_next: S.optional(S.String), - authorizations: __S(42, __c10, 2), - response_metadata: S.optional(__S(96, __c24, 0)), + authorizations: __S(82, __c20, 2), + response_metadata: S.optional(__S(40, __c10, 0)), }), ).annotate({ identifier: "ListEventAuthorizationsResponse" }); } } -function __c11(j: number): any { +function __c21(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1058,7 +2644,7 @@ function __c11(j: number): any { ).annotate({ identifier: "PutDatastoreRequest" }); } } -function __c12(j: number): any { +function __c22(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1070,7 +2656,7 @@ function __c12(j: number): any { ).annotate({ identifier: "SetIconRequest" }); } } -function __c13(j: number): any { +function __c23(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1081,7 +2667,7 @@ function __c13(j: number): any { ).annotate({ identifier: "SetManagedPermissionsRequest" }); } } -function __c14(j: number): any { +function __c24(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1106,7 +2692,7 @@ function __c14(j: number): any { ).annotate({ identifier: "UninstallAppResponse" }); } } -function __c15(j: number): any { +function __c25(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1118,27 +2704,7 @@ function __c15(j: number): any { ).annotate({ identifier: "UpdateDatastoreRequest" }); } } -function __c16(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - datastore: S.String, - items: __S(16, __c4, 0), - app_id: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/apps.datastore.bulkPut", code: 200 })), - ).annotate({ identifier: "BulkPutRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - datastore: S.optional(S.String), - failed_items: S.optional(__S(16, __c4, 0)), - }), - ).annotate({ identifier: "BulkPutResponse" }); - } -} -function __c17(j: number): any { +function __c26(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1157,7 +2723,7 @@ function __c17(j: number): any { ).annotate({ identifier: "UpdateManifestResponse" }); } } -function __c18(j: number): any { +function __c27(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1168,7 +2734,7 @@ function __c18(j: number): any { ).annotate({ identifier: "UpdateUserConnectionRequest" }); } } -function __c19(j: number): any { +function __c28(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1186,165 +2752,17 @@ function __c19(j: number): any { }), ).annotate({ identifier: "ValidateManifestResponseWarningsItem" }); case 2: - return S.Array(__S(77, __c19, 1)); + return S.Array(__S(113, __c28, 1)); case 3: return S.suspend(() => S.Struct({ ok: S.Boolean, errors: __S(4, __c1, 0), - warnings: S.optional(__S(78, __c19, 2)), + warnings: S.optional(__S(114, __c28, 2)), }), ).annotate({ identifier: "ValidateManifestResponse" }); } } -function __c20(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({}).pipe(T.Http({ method: "POST", uri: "/apps.connections.open", code: 200 })), - ).annotate({ identifier: "ConnectionsOpenRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - url: S.String, - }), - ).annotate({ identifier: "ConnectionsOpenResponse" }); - } -} -function __c21(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - manifest: S.String, - team_id: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/apps.manifest.create", code: 200 })), - ).annotate({ identifier: "CreateManifestRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - client_id: S.optional(S.String), - client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))), - verification_token: S.optional(S.String), - signing_secret: S.optional(S.String.pipe(T.SensitiveValue({}))), - }), - ).annotate({ identifier: "CreateManifestResponseCredentials" }); - case 2: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - app_id: S.String, - credentials: __S(85, __c21, 1), - oauth_authorize_url: S.optional(S.String), - team_id: S.optional(S.String), - team_domain: S.optional(S.String), - app_token: S.optional(S.String), - }), - ).annotate({ identifier: "CreateManifestResponse" }); - } -} -function __c22(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - datastore: S.String, - expression: S.optional(S.String), - expression_attributes: S.optional(__S(12, __c3, 0)), - expression_values: S.optional(__S(12, __c3, 0)), - app_id: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/apps.datastore.count", code: 200 })), - ).annotate({ identifier: "DatastoreCountRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - datastore: S.optional(S.String), - count: S.optional(S.Number), - }), - ).annotate({ identifier: "DatastoreCountResponse" }); - } -} -function __c23(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - datastore: S.String, - expression: S.optional(S.String), - expression_attributes: S.optional(__S(12, __c3, 0)), - expression_values: S.optional(__S(12, __c3, 0)), - app_id: S.optional(S.String), - cursor: S.optional(S.String), - limit: S.optional(S.Number), - }).pipe(T.Http({ method: "POST", uri: "/apps.datastore.query", code: 200 })), - ).annotate({ identifier: "DatastoreQueryRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - datastore: S.optional(S.String), - items: __S(16, __c4, 0), - response_metadata: S.optional(__S(96, __c24, 0)), - }), - ).annotate({ identifier: "DatastoreQueryResponse" }); - } -} -function __c24(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - next_cursor: S.optional(S.String), - }), - ).annotate({ identifier: "DatastoreQueryResponseResponseMetadata" }); - } -} -function __c25(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - app_id: S.optional(S.String), - provider_key: S.optional(S.String), - external_token_id: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/apps.auth.external.delete", code: 200 })), - ).annotate({ identifier: "DeleteAuthExternalRequest" }); - } -} -function __c26(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - }), - ).annotate({ identifier: "DeleteAuthExternalResponse" }); - } -} -function __c27(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - datastore: S.String, - id: S.String, - app_id: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/apps.datastore.delete", code: 200 })), - ).annotate({ identifier: "DeleteDatastoreRequest" }); - } -} -function __c28(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - app_id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/apps.manifest.delete", code: 200 })), - ).annotate({ identifier: "DeleteManifestRequest" }); - } -} // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); diff --git a/packages/slack/src/services/assistant.ts b/packages/slack/src/services/assistant.ts index b339575a33..d2e418d85c 100644 --- a/packages/slack/src/services/assistant.ts +++ b/packages/slack/src/services/assistant.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,233 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `assistant_search_context_disabled` -- We're having issues returning your search results. Please wait and try again. */ +export class AssistantSearchContextDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "AssistantSearchContextDisabled", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "assistant_search_context_disabled" } }], + ) {} + +/** `channel_not_found` -- Error returned when given an invalid channel_id */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `context_channel_not_found` -- Specified `context_channel_id` is invalid or the user lacks permission to view it. */ +export class ContextChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ContextChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "context_channel_not_found" } }], + ) {} + +/** `feature_not_enabled` -- The feature is not available on the current workspace. */ +export class FeatureNotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FeatureNotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "feature_not_enabled" } }], + ) {} + +/** `invalid_action_token` -- The `action_token` provided is not valid, has expired, or was not issued to the app whose token accompanies it. */ +export class InvalidActionToken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidActionToken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_action_token" } }], + ) {} + +/** `invalid_cursor` -- The cursormark provided is not valid. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_thread_ts` -- Error returned when given an invalid thread_ts */ +export class InvalidThreadTs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidThreadTs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_thread_ts" } }], + ) {} + +/** `message_not_found` -- Error returned when given an invalid message */ +export class MessageNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessageNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "message_not_found" } }], + ) {} + +/** `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. Use `agents.sessions.setStatus` to set status in a session channel. */ +export class MethodNotSupportedForChannelType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "MethodNotSupportedForChannelType", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "method_not_supported_for_channel_type" } }], + ) {} + +/** `missing_query` -- Missing query. */ +export class MissingQuery + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingQuery", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_query" } }], + ) {} + +/** `missing_scope` -- The requested channel types are not allowed by the provided scopes. */ +export class MissingScope + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingScope", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_scope" } }], + ) {} + +/** `missing_thread_ts` -- Missing thread_ts */ +export class MissingThreadTs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingThreadTs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_thread_ts" } }], + ) {} + +/** `not_agent_app` -- This method requires the app to be configured as an agent. Enable the Agent feature in your app configuration at https://api.slack.com/apps. */ +export class NotAgentApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAgentApp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_agent_app" } }], + ) {} + +/** `query_too_long` -- Query too long. */ +export class QueryTooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("QueryTooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "query_too_long" } }], + ) {} + +/** `reserved_username` -- Reserved usernames are not allowed to be used. */ +export class ReservedUsername + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ReservedUsername", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "reserved_username" } }], + ) {} + +/** `restricted_action` -- The calling user is a guest, or is not an active member of the workspace. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `static_prompts_configured` -- Suggested prompts can't be set dynamically without thread_ts because the app already has static suggested prompts configured. Remove the static prompts in your app configuration to set them via this method without thread_ts. */ +export class StaticPromptsConfigured + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("StaticPromptsConfigured", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "static_prompts_configured" } }], + ) {} + export type SearchContextRequestChannelTypesItem = | "public_channel" | "private_channel" @@ -294,8 +522,18 @@ export interface SetTitleResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type SearchContextError = SlackOpError; -/** Searches messages, files, channels and users across your Slack organization. Required scopes -- user: `search:read.public`, `search:read.private`, `search:read.im`, `search:read.mpim`, `search:read.files`, `search:read.users`; bot: `search:read.public`, `search:read.files`, `search:read.users` Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Internal error. - `rate_limited` -- Rate limited. - `missing_query` -- Missing query. - `query_too_long` -- Query too long. - `feature_not_enabled` -- The feature is not available on the current workspace. - `invalid_action_token` -- The `action_token` provided is not valid, has expired, or was not issued to the app whose token accompanies it. - `invalid_cursor` -- The cursormark provided is not valid. - `context_channel_not_found` -- Specified `context_channel_id` is invalid or the user lacks permission to view it. - `missing_scope` -- The requested channel types are not allowed by the provided scopes. - `assistant_search_context_disabled` -- We're having issues returning your search results. Please wait and try again. - `restricted_action` -- The calling user is a guest, or is not an active member of the workspace. See https://docs.slack.dev/reference/methods/assistant.search.context */ +export type SearchContextError = + | AssistantSearchContextDisabled + | ContextChannelNotFound + | FeatureNotEnabled + | InvalidActionToken + | InvalidCursor + | MissingQuery + | MissingScope + | QueryTooLong + | RestrictedAction + | SlackOpError; +/** Searches messages, files, channels and users across your Slack organization. Required scopes -- user: `search:read.public`, `search:read.private`, `search:read.im`, `search:read.mpim`, `search:read.files`, `search:read.users`; bot: `search:read.public`, `search:read.files`, `search:read.users` Rate limit tier: 5 Method-specific errors (each a typed error named after its slug): - `internal_error` -- Internal error. - `rate_limited` -- Rate limited. - `missing_query` -- Missing query. - `query_too_long` -- Query too long. - `feature_not_enabled` -- The feature is not available on the current workspace. - `invalid_action_token` -- The `action_token` provided is not valid, has expired, or was not issued to the app whose token accompanies it. - `invalid_cursor` -- The cursormark provided is not valid. - `context_channel_not_found` -- Specified `context_channel_id` is invalid or the user lacks permission to view it. - `missing_scope` -- The requested channel types are not allowed by the provided scopes. - `assistant_search_context_disabled` -- We're having issues returning your search results. Please wait and try again. - `restricted_action` -- The calling user is a guest, or is not an active member of the workspace. See https://docs.slack.dev/reference/methods/assistant.search.context */ export const searchContext: API.PaginatedOperationMethod< SearchContextRequest, SearchContextResponse, @@ -306,7 +544,19 @@ export const searchContext: API.PaginatedOperationMethod< () => ({ input: __S(1, __c0, 1) as any as S.Schema, output: __S(14, __c0, 14) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AssistantSearchContextDisabled, + ContextChannelNotFound, + FeatureNotEnabled, + InvalidActionToken, + InvalidCursor, + MissingQuery, + MissingScope, + QueryTooLong, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -339,8 +589,13 @@ export const searchInfo: API.OperationMethod< span: "SearchInfo", })); -export type SetStatusError = SlackOpError; -/** Set the status for an AI assistant thread. Required scopes -- bot: `chat:write` Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Error returned when given an invalid channel_id - `invalid_thread_ts` -- Error returned when given an invalid thread_ts - `reserved_username` -- Reserved usernames are not allowed to be used. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. Use `agents.sessions.setStatus` to set status in a session channel. See https://docs.slack.dev/reference/methods/assistant.threads.setStatus */ +export type SetStatusError = + | ChannelNotFound + | InvalidThreadTs + | MethodNotSupportedForChannelType + | ReservedUsername + | SlackOpError; +/** Set the status for an AI assistant thread. Required scopes -- bot: `chat:write` Rate limit tier: 5 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Error returned when given an invalid channel_id - `invalid_thread_ts` -- Error returned when given an invalid thread_ts - `reserved_username` -- Reserved usernames are not allowed to be used. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. Use `agents.sessions.setStatus` to set status in a session channel. See https://docs.slack.dev/reference/methods/assistant.threads.setStatus */ export const setStatus: API.OperationMethod< SetStatusRequest, SetStatusResponse, @@ -349,15 +604,29 @@ export const setStatus: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c3, 0) as any as S.Schema, output: __S(64, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + InvalidThreadTs, + MethodNotSupportedForChannelType, + ReservedUsername, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetStatus", })); -export type SetSuggestedPromptsError = SlackOpError; -/** Set suggested prompts for the given assistant thread Required scopes -- bot: `assistant:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `invalid_thread_ts` -- Thread not found - `missing_thread_ts` -- Missing thread_ts - `channel_not_found` -- Error returned when given an invalid channel_id - `message_not_found` -- Error returned when given an invalid message - `not_agent_app` -- This method requires the app to be configured as an agent. Enable the Agent feature in your app configuration at https://api.slack.com/apps. - `static_prompts_configured` -- Suggested prompts can't be set dynamically without thread_ts because the app already has static suggested prompts configured. Remove the static prompts in your app configuration to set them via this method without thread_ts. See https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts */ +export type SetSuggestedPromptsError = + | ChannelNotFound + | InvalidThreadTs + | MessageNotFound + | MissingThreadTs + | NotAgentApp + | StaticPromptsConfigured + | SlackOpError; +/** Set suggested prompts for the given assistant thread Required scopes -- bot: `assistant:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `invalid_thread_ts` -- Thread not found - `missing_thread_ts` -- Missing thread_ts - `channel_not_found` -- Error returned when given an invalid channel_id - `message_not_found` -- Error returned when given an invalid message - `not_agent_app` -- This method requires the app to be configured as an agent. Enable the Agent feature in your app configuration at https://api.slack.com/apps. - `static_prompts_configured` -- Suggested prompts can't be set dynamically without thread_ts because the app already has static suggested prompts configured. Remove the static prompts in your app configuration to set them via this method without thread_ts. See https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts */ export const setSuggestedPrompts: API.OperationMethod< SetSuggestedPromptsRequest, SetSuggestedPromptsResponse, @@ -366,15 +635,24 @@ export const setSuggestedPrompts: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(80, __c5, 0) as any as S.Schema, output: __S(64, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + InvalidThreadTs, + MessageNotFound, + MissingThreadTs, + NotAgentApp, + StaticPromptsConfigured, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetSuggestedPrompts", })); -export type SetTitleError = SlackOpError; -/** Set the title for the given assistant thread Required scopes -- bot: `assistant:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `invalid_thread_ts` -- Thread not found - `channel_not_found` -- Error returned when given an invalid channel_id See https://docs.slack.dev/reference/methods/assistant.threads.setTitle */ +export type SetTitleError = ChannelNotFound | InvalidThreadTs | SlackOpError; +/** Set the title for the given assistant thread Required scopes -- bot: `assistant:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `invalid_thread_ts` -- Thread not found - `channel_not_found` -- Error returned when given an invalid channel_id See https://docs.slack.dev/reference/methods/assistant.threads.setTitle */ export const setTitle: API.OperationMethod< SetTitleRequest, SetTitleResponse, @@ -383,7 +661,7 @@ export const setTitle: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(96, __c6, 0) as any as S.Schema, output: __S(64, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ChannelNotFound, InvalidThreadTs, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/auth.ts b/packages/slack/src/services/auth.ts index 833c2185c8..188dcb8346 100644 --- a/packages/slack/src/services/auth.ts +++ b/packages/slack/src/services/auth.ts @@ -25,6 +25,45 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `invalid_cursor` -- Invalid cursor. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_limit` -- The value passed for `limit` was not valid. */ +export class InvalidLimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidLimit", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_limit" } }], + ) {} + +/** `not_bearer_token` -- Incompatible token type provided */ +export class NotBearerToken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotBearerToken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_bearer_token" } }], + ) {} + export interface ListTeamsRequest { /** The maximum number of workspaces to return. Must be a positive integer no larger than 1000. */ limit?: number | undefined; @@ -90,8 +129,8 @@ export interface TestAuthResponse { is_enterprise_install?: boolean | undefined; expires_in?: number | null | undefined; } -export type ListTeamsError = SlackOpError; -/** Obtain a full list of workspaces your org-wide app has been approved for. Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Invalid cursor. - `invalid_limit` -- The value passed for `limit` was not valid. - `invalid_auth` -- The token doesn't have access to this endpoint. - `internal_error` -- There was an internal error. See https://docs.slack.dev/reference/methods/auth.teams.list */ +export type ListTeamsError = InvalidCursor | InvalidLimit | SlackOpError; +/** Obtain a full list of workspaces your org-wide app has been approved for. Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- Invalid cursor. - `invalid_limit` -- The value passed for `limit` was not valid. - `invalid_auth` -- The token doesn't have access to this endpoint. - `internal_error` -- There was an internal error. See https://docs.slack.dev/reference/methods/auth.teams.list */ export const listTeams: API.PaginatedOperationMethod< ListTeamsRequest, ListTeamsResponse, @@ -102,7 +141,7 @@ export const listTeams: API.PaginatedOperationMethod< () => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(5, __c0, 5) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [InvalidCursor, InvalidLimit, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -118,8 +157,8 @@ export const listTeams: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type RevokeAuthError = SlackOpError; -/** Revokes a token. Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Internal system error - `not_bearer_token` -- Incompatible token type provided See https://docs.slack.dev/reference/methods/auth.revoke */ +export type RevokeAuthError = NotBearerToken | SlackOpError; +/** Revokes a token. Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `internal_error` -- Internal system error - `not_bearer_token` -- Incompatible token type provided See https://docs.slack.dev/reference/methods/auth.revoke */ export const revokeAuth: API.OperationMethod< RevokeAuthRequest, RevokeAuthResponse, @@ -128,7 +167,7 @@ export const revokeAuth: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c1, 0) as any as S.Schema, output: __S(9, __c1, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [NotBearerToken, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -136,7 +175,7 @@ export const revokeAuth: API.OperationMethod< })); export type TestAuthError = SlackOpError; -/** Checks authentication & identity. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- An internal error has been found. - `invalid_auth` -- Method was called with invalid credentials See https://docs.slack.dev/reference/methods/auth.test */ +/** Checks authentication & identity. Rate limit tier: 5 Method-specific errors (each a typed error named after its slug): - `internal_error` -- An internal error has been found. - `invalid_auth` -- Method was called with invalid credentials See https://docs.slack.dev/reference/methods/auth.test */ export const testAuth: API.OperationMethod< TestAuthRequest, TestAuthResponse, diff --git a/packages/slack/src/services/blocks.ts b/packages/slack/src/services/blocks.ts index f526a10dee..3ebff75b7a 100644 --- a/packages/slack/src/services/blocks.ts +++ b/packages/slack/src/services/blocks.ts @@ -24,6 +24,58 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `invalid_arguments` -- The request arguments are invalid. Ensure you provide exactly one of `blocks`, `view`, or `message`, and that the value is valid JSON. Consult `response_metadata.messages` for details. */ +export class InvalidArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_arguments" } }], + ) {} + +/** `invalid_blocks` -- The blocks array failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. */ +export class InvalidBlocks + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidBlocks", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_blocks" } }], + ) {} + +/** `invalid_message` -- The message payload failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. */ +export class InvalidMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_message" } }], + ) {} + +/** `invalid_view` -- The view payload failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. */ +export class InvalidView + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidView", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_view" } }], + ) {} + export type ValidateBlockRequestBlocksCase1ItemMap = { [key: string]: unknown | undefined }; export type ValidateBlockRequestBlocksCase1List = Array; /** A JSON-encoded array of [structured blocks](/reference/block-kit/blocks). Provide exactly one of `blocks`, `view`, or `message`. */ @@ -40,8 +92,13 @@ export interface ValidateBlockResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type ValidateBlockError = SlackOpError; -/** Validates blocks, messages, and views Block Kit JSON payloads. Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The request arguments are invalid. Ensure you provide exactly one of `blocks`, `view`, or `message`, and that the value is valid JSON. Consult `response_metadata.messages` for details. - `invalid_blocks` -- The blocks array failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. - `invalid_view` -- The view payload failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. - `invalid_message` -- The message payload failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. - `ratelimited` -- Too many requests. Reduce your request rate and retry after a brief wait. See https://docs.slack.dev/reference/methods/blocks.validate */ +export type ValidateBlockError = + | InvalidArguments + | InvalidBlocks + | InvalidMessage + | InvalidView + | SlackOpError; +/** Validates blocks, messages, and views Block Kit JSON payloads. Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The request arguments are invalid. Ensure you provide exactly one of `blocks`, `view`, or `message`, and that the value is valid JSON. Consult `response_metadata.messages` for details. - `invalid_blocks` -- The blocks array failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. - `invalid_view` -- The view payload failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. - `invalid_message` -- The message payload failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. - `ratelimited` -- Too many requests. Reduce your request rate and retry after a brief wait. See https://docs.slack.dev/reference/methods/blocks.validate */ export const validateBlock: API.OperationMethod< ValidateBlockRequest, ValidateBlockResponse, @@ -50,7 +107,14 @@ export const validateBlock: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(1, __c0, 1) as any as S.Schema, output: __S(2, __c0, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + InvalidArguments, + InvalidBlocks, + InvalidMessage, + InvalidView, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/bookmarks.ts b/packages/slack/src/services/bookmarks.ts index c302c0f2f7..3d38941fd7 100644 --- a/packages/slack/src/services/bookmarks.ts +++ b/packages/slack/src/services/bookmarks.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,353 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `access_denied` -- Actor lacks access to the requested resource. */ +export class AccessDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AccessDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "access_denied" } }], + ) {} + +/** `cannot_bookmark_from_external_org` -- File is an external file and cannot be bookmarked. */ +export class CannotBookmarkFromExternalOrg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotBookmarkFromExternalOrg", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_bookmark_from_external_org" } }], + ) {} + +/** `cannot_bookmark_restricted_sharing_enabled` -- File has restricted sharing enabled and cannot be bookmarked. */ +export class CannotBookmarkRestrictedSharingEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "CannotBookmarkRestrictedSharingEnabled", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "cannot_bookmark_restricted_sharing_enabled" } }], + ) {} + +/** `channel_not_found` -- Channel cannot be found. */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `file_already_added` -- The file has already been added to the folder. */ +export class FileAlreadyAdded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileAlreadyAdded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_already_added" } }], + ) {} + +/** `file_not_found` -- File cannot be found. */ +export class FileNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_not_found" } }], + ) {} + +/** `invalid_app_action_type` -- App action type is not valid. */ +export class InvalidAppActionType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAppActionType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_app_action_type" } }], + ) {} + +/** `invalid_bookmark_type` -- Bookmark type is not valid. */ +export class InvalidBookmarkType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidBookmarkType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_bookmark_type" } }], + ) {} + +/** `invalid_child_type` -- Child type is not valid. */ +export class InvalidChildType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChildType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_child_type" } }], + ) {} + +/** `invalid_emoji` -- Invalid emoji, does not follow the pattern of a valid emoji name. */ +export class InvalidEmoji + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEmoji", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_emoji" } }], + ) {} + +/** `invalid_entity_id` -- Invalid entity_id, file or message type bookmark should have original file or message ID. */ +export class InvalidEntityId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEntityId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_entity_id" } }], + ) {} + +/** `invalid_link` -- Invalid link, link should begin with either http:// or https://. */ +export class InvalidLink + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidLink", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_link" } }], + ) {} + +/** `invalid_parent_type` -- Parent type is not valid. */ +export class InvalidParentType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidParentType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_parent_type" } }], + ) {} + +/** `invalid_shortcut_type` -- Shortcut type is not valid. */ +export class InvalidShortcutType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidShortcutType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_shortcut_type" } }], + ) {} + +/** `not_found` -- Bookmark cannot be found. */ +export class NotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "not_found" } }], + ) {} + +/** `parent_bookmark_disabled` -- Parent bookmark feature flag is off. */ +export class ParentBookmarkDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ParentBookmarkDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "parent_bookmark_disabled" } }], + ) {} + +/** `parent_with_link` -- Parent bookmark should not have link. */ +export class ParentWithLink + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ParentWithLink", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "parent_with_link" } }], + ) {} + +/** `permission_denied` -- No permission to perform this operation. */ +export class PermissionDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PermissionDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "permission_denied" } }], + ) {} + +/** `restricted_action` -- Members from an external organization cannot add workflow bookmarks to this channel. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `slack_connect_blocked_file_type` -- Files with certain extensions are blocked from being uploaded in all Slack Connect communications */ +export class SlackConnectBlockedFileType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SlackConnectBlockedFileType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "slack_connect_blocked_file_type" } }], + ) {} + +/** `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip sharing in Slack Connect channels */ +export class SlackConnectClipSharingBlocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "SlackConnectClipSharingBlocked", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "slack_connect_clip_sharing_blocked" } }], + ) {} + +/** `slack_connect_file_upload_sharing_blocked` -- Admin has disabled File uploads in all Slack Connect communications */ +export class SlackConnectFileUploadSharingBlocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "SlackConnectFileUploadSharingBlocked", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "slack_connect_file_upload_sharing_blocked" } }], + ) {} + +/** `too_many_bookmarks` -- Bookmark limit reached for channel. */ +export class TooManyBookmarks + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyBookmarks", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_bookmarks" } }], + ) {} + +/** `too_many_requests` -- Too many concurrent requests. Please retry. */ +export class TooManyRequests + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyRequests", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_requests" } }], + ) {} + +/** `too_many_tabs` -- tab limit reached for channel. */ +export class TooManyTabs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyTabs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_tabs" } }], + ) {} + +/** `user_not_found` -- User cannot be found. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + /** The level that we are setting the file's permission to (read or write) */ export type AddBookmarkRequestAccessLevel = "read" | "write"; export interface AddBookmarkRequest { @@ -88,8 +436,33 @@ export interface RemoveBookmarkResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type AddBookmarkError = SlackOpError; -/** Add bookmark to a channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- Actor lacks access to the requested resource. - `cannot_bookmark_from_external_org` -- File is an external file and cannot be bookmarked. - `cannot_bookmark_restricted_sharing_enabled` -- File has restricted sharing enabled and cannot be bookmarked. - `channel_not_found` -- Channel cannot be found. - `file_already_added` -- The file has already been added to the folder. - `file_not_found` -- File cannot be found. - `invalid_bookmark_type` -- Bookmark type is not valid. - `invalid_app_action_type` -- App action type is not valid. - `invalid_shortcut_type` -- Shortcut type is not valid. - `invalid_child_type` -- Child type is not valid. - `invalid_emoji` -- Invalid emoji, does not follow the pattern of a valid emoji name. - `invalid_entity_id` -- Invalid entity_id, file or message type bookmark should have original file or message ID. - `invalid_link` -- Invalid link, link should begin with either http:// or https://. - `invalid_parent_type` -- Parent type is not valid. - `parent_bookmark_disabled` -- Parent bookmark feature flag is off. - `parent_with_link` -- Parent bookmark should not have link. - `permission_denied` -- No permission to perform this operation. - `restricted_action` -- Members from an external organization cannot add workflow bookmarks to this channel. - `slack_connect_file_upload_sharing_blocked` -- Admin has disabled File uploads in all Slack Connect communications - `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip sharing in Slack Connect channels - `slack_connect_blocked_file_type` -- Files with certain extensions are blocked from being uploaded in all Slack Connect communications - `too_many_bookmarks` -- Bookmark limit reached for channel. - `too_many_tabs` -- tab limit reached for channel. - `too_many_requests` -- Too many concurrent requests. Please retry. See https://docs.slack.dev/reference/methods/bookmarks.add */ +export type AddBookmarkError = + | AccessDenied + | CannotBookmarkFromExternalOrg + | CannotBookmarkRestrictedSharingEnabled + | ChannelNotFound + | FileAlreadyAdded + | FileNotFound + | InvalidAppActionType + | InvalidBookmarkType + | InvalidChildType + | InvalidEmoji + | InvalidEntityId + | InvalidLink + | InvalidParentType + | InvalidShortcutType + | ParentBookmarkDisabled + | ParentWithLink + | PermissionDenied + | RestrictedAction + | SlackConnectBlockedFileType + | SlackConnectClipSharingBlocked + | SlackConnectFileUploadSharingBlocked + | TooManyBookmarks + | TooManyRequests + | TooManyTabs + | SlackOpError; +/** Add bookmark to a channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `access_denied` -- Actor lacks access to the requested resource. - `cannot_bookmark_from_external_org` -- File is an external file and cannot be bookmarked. - `cannot_bookmark_restricted_sharing_enabled` -- File has restricted sharing enabled and cannot be bookmarked. - `channel_not_found` -- Channel cannot be found. - `file_already_added` -- The file has already been added to the folder. - `file_not_found` -- File cannot be found. - `invalid_bookmark_type` -- Bookmark type is not valid. - `invalid_app_action_type` -- App action type is not valid. - `invalid_shortcut_type` -- Shortcut type is not valid. - `invalid_child_type` -- Child type is not valid. - `invalid_emoji` -- Invalid emoji, does not follow the pattern of a valid emoji name. - `invalid_entity_id` -- Invalid entity_id, file or message type bookmark should have original file or message ID. - `invalid_link` -- Invalid link, link should begin with either http:// or https://. - `invalid_parent_type` -- Parent type is not valid. - `parent_bookmark_disabled` -- Parent bookmark feature flag is off. - `parent_with_link` -- Parent bookmark should not have link. - `permission_denied` -- No permission to perform this operation. - `restricted_action` -- Members from an external organization cannot add workflow bookmarks to this channel. - `slack_connect_file_upload_sharing_blocked` -- Admin has disabled File uploads in all Slack Connect communications - `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip sharing in Slack Connect channels - `slack_connect_blocked_file_type` -- Files with certain extensions are blocked from being uploaded in all Slack Connect communications - `too_many_bookmarks` -- Bookmark limit reached for channel. - `too_many_tabs` -- tab limit reached for channel. - `too_many_requests` -- Too many concurrent requests. Please retry. See https://docs.slack.dev/reference/methods/bookmarks.add */ export const addBookmark: API.OperationMethod< AddBookmarkRequest, AddBookmarkResponse, @@ -98,15 +471,55 @@ export const addBookmark: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + CannotBookmarkFromExternalOrg, + CannotBookmarkRestrictedSharingEnabled, + ChannelNotFound, + FileAlreadyAdded, + FileNotFound, + InvalidAppActionType, + InvalidBookmarkType, + InvalidChildType, + InvalidEmoji, + InvalidEntityId, + InvalidLink, + InvalidParentType, + InvalidShortcutType, + ParentBookmarkDisabled, + ParentWithLink, + PermissionDenied, + RestrictedAction, + SlackConnectBlockedFileType, + SlackConnectClipSharingBlocked, + SlackConnectFileUploadSharingBlocked, + TooManyBookmarks, + TooManyRequests, + TooManyTabs, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddBookmark", })); -export type EditBookmarkError = SlackOpError; -/** Edit bookmark. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- Actor lacks access to the requested resource. - `channel_not_found` -- Channel cannot be found. - `invalid_bookmark_type` -- Bookmark type is not valid. - `invalid_emoji` -- Invalid emoji, does not follow the pattern of a valid emoji name. - `invalid_link` -- Invalid link, link should begin with either http:// or https://. - `not_found` -- Bookmark cannot be found. - `parent_with_link` -- Parent bookmark should not have link. - `permission_denied` -- No permission to perform this operation. - `restricted_action` -- Members from an external organization cannot edit workflow bookmarks in this channel. - `slack_connect_file_upload_sharing_blocked` -- Admin has disabled File uploads in all Slack Connect communications - `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip sharing in Slack Connect channels - `slack_connect_blocked_file_type` -- Files with certain extensions are blocked from being uploaded in all Slack Connect communications See https://docs.slack.dev/reference/methods/bookmarks.edit */ +export type EditBookmarkError = + | AccessDenied + | ChannelNotFound + | InvalidBookmarkType + | InvalidEmoji + | InvalidLink + | NotFound + | ParentWithLink + | PermissionDenied + | RestrictedAction + | SlackConnectBlockedFileType + | SlackConnectClipSharingBlocked + | SlackConnectFileUploadSharingBlocked + | SlackOpError; +/** Edit bookmark. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `access_denied` -- Actor lacks access to the requested resource. - `channel_not_found` -- Channel cannot be found. - `invalid_bookmark_type` -- Bookmark type is not valid. - `invalid_emoji` -- Invalid emoji, does not follow the pattern of a valid emoji name. - `invalid_link` -- Invalid link, link should begin with either http:// or https://. - `not_found` -- Bookmark cannot be found. - `parent_with_link` -- Parent bookmark should not have link. - `permission_denied` -- No permission to perform this operation. - `restricted_action` -- Members from an external organization cannot edit workflow bookmarks in this channel. - `slack_connect_file_upload_sharing_blocked` -- Admin has disabled File uploads in all Slack Connect communications - `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip sharing in Slack Connect channels - `slack_connect_blocked_file_type` -- Files with certain extensions are blocked from being uploaded in all Slack Connect communications See https://docs.slack.dev/reference/methods/bookmarks.edit */ export const editBookmark: API.OperationMethod< EditBookmarkRequest, EditBookmarkResponse, @@ -115,15 +528,30 @@ export const editBookmark: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c2, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + ChannelNotFound, + InvalidBookmarkType, + InvalidEmoji, + InvalidLink, + NotFound, + ParentWithLink, + PermissionDenied, + RestrictedAction, + SlackConnectBlockedFileType, + SlackConnectClipSharingBlocked, + SlackConnectFileUploadSharingBlocked, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "EditBookmark", })); -export type ListBookmarksError = SlackOpError; -/** List bookmark for the channel. Required scopes -- bot: `bookmarks:read`; user: `bookmarks:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- Actor lacks access to the requested resource. - `channel_not_found` -- Channel cannot be found. See https://docs.slack.dev/reference/methods/bookmarks.list */ +export type ListBookmarksError = AccessDenied | ChannelNotFound | SlackOpError; +/** List bookmark for the channel. Required scopes -- bot: `bookmarks:read`; user: `bookmarks:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `access_denied` -- Actor lacks access to the requested resource. - `channel_not_found` -- Channel cannot be found. See https://docs.slack.dev/reference/methods/bookmarks.list */ export const listBookmarks: API.OperationMethod< ListBookmarksRequest, ListBookmarksResponse, @@ -132,15 +560,23 @@ export const listBookmarks: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(12, __c3, 0) as any as S.Schema, output: __S(14, __c3, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [AccessDenied, ChannelNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListBookmarks", })); -export type RemoveBookmarkError = SlackOpError; -/** Remove bookmark from the channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- Actor lacks access to the requested resource. - `channel_not_found` -- Channel cannot be found. - `user_not_found` -- User cannot be found. - `invalid_bookmark_type` -- Bookmark type is not valid. - `not_found` -- Bookmark cannot be found. - `permission_denied` -- No permission to perform this operation. - `restricted_action` -- Members from an external organization cannot remove workflow bookmarks from this channel. See https://docs.slack.dev/reference/methods/bookmarks.remove */ +export type RemoveBookmarkError = + | AccessDenied + | ChannelNotFound + | InvalidBookmarkType + | NotFound + | PermissionDenied + | RestrictedAction + | UserNotFound + | SlackOpError; +/** Remove bookmark from the channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `access_denied` -- Actor lacks access to the requested resource. - `channel_not_found` -- Channel cannot be found. - `user_not_found` -- User cannot be found. - `invalid_bookmark_type` -- Bookmark type is not valid. - `not_found` -- Bookmark cannot be found. - `permission_denied` -- No permission to perform this operation. - `restricted_action` -- Members from an external organization cannot remove workflow bookmarks from this channel. See https://docs.slack.dev/reference/methods/bookmarks.remove */ export const removeBookmark: API.OperationMethod< RemoveBookmarkRequest, RemoveBookmarkResponse, @@ -149,7 +585,17 @@ export const removeBookmark: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(16, __c4, 0) as any as S.Schema, output: __S(17, __c4, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + ChannelNotFound, + InvalidBookmarkType, + NotFound, + PermissionDenied, + RestrictedAction, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/bots.ts b/packages/slack/src/services/bots.ts index 36b40684b1..708a6b13ff 100644 --- a/packages/slack/src/services/bots.ts +++ b/packages/slack/src/services/bots.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,58 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `bot_not_found` -- Value passed for `bot` was invalid. */ +export class BotNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BotNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "bot_not_found" } }], + ) {} + +/** `bots_not_found` -- At least one value passed for `bots` was invalid. */ +export class BotsNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BotsNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "bots_not_found" } }], + ) {} + +/** `missing_argument` -- A required argument is missing. */ +export class MissingArgument + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgument", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_argument" } }], + ) {} + +/** `team_not_found` -- Value passed for `team_id` was invalid. */ +export class TeamNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "team_not_found" } }], + ) {} + export interface BotsInfoRequest { /** Bot user to get info on */ bot?: string | undefined; @@ -69,8 +122,13 @@ export interface BotsInfoResponse { bots?: BotsInfoResponseBotsList | undefined; bot?: BotsInfoResponseBot | undefined; } -export type BotsInfoError = SlackOpError; -/** Gets information about a bot user. Required scopes -- bot: `users:read`; user: `users:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `bot_not_found` -- Value passed for `bot` was invalid. - `bots_not_found` -- At least one value passed for `bots` was invalid. - `missing_argument` -- A required argument is missing. - `team_not_found` -- Value passed for `team_id` was invalid. See https://docs.slack.dev/reference/methods/bots.info */ +export type BotsInfoError = + | BotNotFound + | BotsNotFound + | MissingArgument + | TeamNotFound + | SlackOpError; +/** Gets information about a bot user. Required scopes -- bot: `users:read`; user: `users:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `bot_not_found` -- Value passed for `bot` was invalid. - `bots_not_found` -- At least one value passed for `bots` was invalid. - `missing_argument` -- A required argument is missing. - `team_not_found` -- Value passed for `team_id` was invalid. See https://docs.slack.dev/reference/methods/bots.info */ export const botsInfo: API.OperationMethod< BotsInfoRequest, BotsInfoResponse, @@ -79,7 +137,7 @@ export const botsInfo: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(5, __c0, 5) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [BotNotFound, BotsNotFound, MissingArgument, TeamNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/calls.ts b/packages/slack/src/services/calls.ts index 917cb1c01e..3abe939d0f 100644 --- a/packages/slack/src/services/calls.ts +++ b/packages/slack/src/services/calls.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,123 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `bad_users` -- At least one specified user is already part of the Call. */ +export class BadUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_users" } }], + ) {} + +/** `inactive_call` -- The Call has been already stopped. */ +export class InactiveCall + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InactiveCall", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "inactive_call" } }], + ) {} + +/** `invalid_call_id` -- Invalid Call ID. */ +export class InvalidCallId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCallId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_call_id" } }], + ) {} + +/** `invalid_created_by` -- The `created_by` user ID is invalid. */ +export class InvalidCreatedBy + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCreatedBy", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_created_by" } }], + ) {} + +/** `invalid_start_time` -- The start time is invalid. */ +export class InvalidStartTime + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidStartTime", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_start_time" } }], + ) {} + +/** `missing_argument` -- A required argument is missing. */ +export class MissingArgument + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgument", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_argument" } }], + ) {} + +/** `not_authorized` -- The specified user is not authorized to create a Call in this channel. */ +export class NotAuthorized + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAuthorized", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_authorized" } }], + ) {} + +/** `not_implemented` -- This method is not available. */ +export class NotImplemented + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotImplemented", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_implemented" } }], + ) {} + +/** `user_not_found` -- A specified user wasn't found. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + /** The list of users to register as participants in the Call. [Read more on how to specify users here](/apis/web-api/using-the-calls-api#users). */ export type AddCallRequestUsersList = Array; export interface AddCallRequest { @@ -110,102 +228,148 @@ export interface UpdateCallResponse { ok: boolean; call: unknown; } -export type AddCallError = SlackOpError; -/** Registers a new Call. Required scopes -- bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- An unexpected error has occurred while trying to register the Call. - `invalid_created_by` -- The `created_by` user ID is invalid. - `invalid_start_time` -- The start time is invalid. - `not_authorized` -- The specified user is not authorized to create a Call in this channel. - `not_implemented` -- This method is not available. - `user_not_found` -- A specified user wasn't found. See https://docs.slack.dev/reference/methods/calls.add */ +export type AddCallError = + | InvalidCreatedBy + | InvalidStartTime + | NotAuthorized + | NotImplemented + | UserNotFound + | SlackOpError; +/** Registers a new Call. Required scopes -- bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `internal_error` -- An unexpected error has occurred while trying to register the Call. - `invalid_created_by` -- The `created_by` user ID is invalid. - `invalid_start_time` -- The start time is invalid. - `not_authorized` -- The specified user is not authorized to create a Call in this channel. - `not_implemented` -- This method is not available. - `user_not_found` -- A specified user wasn't found. See https://docs.slack.dev/reference/methods/calls.add */ export const addCall: API.OperationMethod< AddCallRequest, AddCallResponse, AddCallError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(0, __c0, 0) as any as S.Schema, - output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(10, __c5, 0) as any as S.Schema, + output: __S(12, __c6, 0) as any as S.Schema, + errors: [ + InvalidCreatedBy, + InvalidStartTime, + NotAuthorized, + NotImplemented, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddCall", })); -export type AddParticipantError = SlackOpError; -/** Registers new participants added to a Call. Required scopes -- bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `bad_users` -- At least one specified user is already part of the Call. - `inactive_call` -- The Call has been already ended. - `internal_error` -- An unexpected exception occurred while adding a Call participant. - `invalid_call_id` -- The specified Call wasn't found. - `missing_argument` -- A required argument is missing. - `not_implemented` -- This method is not available. - `user_not_found` -- At least one specified user wasn't found. See https://docs.slack.dev/reference/methods/calls.participants.add */ +export type AddParticipantError = + | BadUsers + | InactiveCall + | InvalidCallId + | MissingArgument + | NotImplemented + | UserNotFound + | SlackOpError; +/** Registers new participants added to a Call. Required scopes -- bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `bad_users` -- At least one specified user is already part of the Call. - `inactive_call` -- The Call has been already ended. - `internal_error` -- An unexpected exception occurred while adding a Call participant. - `invalid_call_id` -- The specified Call wasn't found. - `missing_argument` -- A required argument is missing. - `not_implemented` -- This method is not available. - `user_not_found` -- At least one specified user wasn't found. See https://docs.slack.dev/reference/methods/calls.participants.add */ export const addParticipant: API.OperationMethod< AddParticipantRequest, AddParticipantResponse, AddParticipantError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(6, __c3, 0) as any as S.Schema, - output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(0, __c0, 0) as any as S.Schema, + output: __S(12, __c6, 0) as any as S.Schema, + errors: [ + BadUsers, + InactiveCall, + InvalidCallId, + MissingArgument, + NotImplemented, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddParticipant", })); -export type CallsEndError = SlackOpError; -/** Ends a Call. Required scopes -- bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `inactive_call` -- The Call has been already stopped. - `internal_error` -- An unexpected error has occurred while ending the Call. - `invalid_call_id` -- Invalid Call ID. - `not_implemented` -- This method is not publicly available yet. See https://docs.slack.dev/reference/methods/calls.end */ +export type CallsEndError = InactiveCall | InvalidCallId | NotImplemented | SlackOpError; +/** Ends a Call. Required scopes -- bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `inactive_call` -- The Call has been already stopped. - `internal_error` -- An unexpected error has occurred while ending the Call. - `invalid_call_id` -- Invalid Call ID. - `not_implemented` -- This method is not publicly available yet. See https://docs.slack.dev/reference/methods/calls.end */ export const callsEnd: API.OperationMethod< CallsEndRequest, CallsEndResponse, CallsEndError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(8, __c4, 0) as any as S.Schema, - output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(2, __c1, 0) as any as S.Schema, + output: __S(12, __c6, 0) as any as S.Schema, + errors: [InactiveCall, InvalidCallId, NotImplemented, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CallsEnd", })); -export type CallsInfoError = SlackOpError; -/** Returns information about a Call. Required scopes -- bot: `calls:read`; user: `calls:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- An unexpected error occurred while finding information about this Call. - `not_implemented` -- This method is not available. See https://docs.slack.dev/reference/methods/calls.info */ +export type CallsInfoError = NotImplemented | SlackOpError; +/** Returns information about a Call. Required scopes -- bot: `calls:read`; user: `calls:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `internal_error` -- An unexpected error occurred while finding information about this Call. - `not_implemented` -- This method is not available. See https://docs.slack.dev/reference/methods/calls.info */ export const callsInfo: API.OperationMethod< CallsInfoRequest, CallsInfoResponse, CallsInfoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(10, __c5, 0) as any as S.Schema, - output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(4, __c2, 0) as any as S.Schema, + output: __S(12, __c6, 0) as any as S.Schema, + errors: [NotImplemented, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CallsInfo", })); -export type RemoveParticipantError = SlackOpError; -/** Registers participants removed from a Call. Required scopes -- bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `bad_users` -- At least one specified user is not part of the Call. - `inactive_call` -- The Call has been already ended. - `internal_error` -- An unexpected exception occurred while removing participants from the Call. - `invalid_call_id` -- The specified Call wasn't found. - `missing_argument` -- A required argument is missing. - `not_implemented` -- This method is not available. - `user_not_found` -- At least one specified user wasn't found. See https://docs.slack.dev/reference/methods/calls.participants.remove */ +export type RemoveParticipantError = + | BadUsers + | InactiveCall + | InvalidCallId + | MissingArgument + | NotImplemented + | UserNotFound + | SlackOpError; +/** Registers participants removed from a Call. Required scopes -- bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `bad_users` -- At least one specified user is not part of the Call. - `inactive_call` -- The Call has been already ended. - `internal_error` -- An unexpected exception occurred while removing participants from the Call. - `invalid_call_id` -- The specified Call wasn't found. - `missing_argument` -- A required argument is missing. - `not_implemented` -- This method is not available. - `user_not_found` -- At least one specified user wasn't found. See https://docs.slack.dev/reference/methods/calls.participants.remove */ export const removeParticipant: API.OperationMethod< RemoveParticipantRequest, RemoveParticipantResponse, RemoveParticipantError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(12, __c6, 0) as any as S.Schema, - output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(6, __c3, 0) as any as S.Schema, + output: __S(12, __c6, 0) as any as S.Schema, + errors: [ + BadUsers, + InactiveCall, + InvalidCallId, + MissingArgument, + NotImplemented, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveParticipant", })); -export type UpdateCallError = SlackOpError; -/** Updates information about a Call. Required scopes -- bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- An unexpected exception occurred while updating the Call info. - `invalid_call_id` -- The Call's `id` was invalid. - `not_implemented` -- This method is not available. See https://docs.slack.dev/reference/methods/calls.update */ +export type UpdateCallError = InvalidCallId | NotImplemented | SlackOpError; +/** Updates information about a Call. Required scopes -- bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `internal_error` -- An unexpected exception occurred while updating the Call info. - `invalid_call_id` -- The Call's `id` was invalid. - `not_implemented` -- This method is not available. See https://docs.slack.dev/reference/methods/calls.update */ export const updateCall: API.OperationMethod< UpdateCallRequest, UpdateCallResponse, UpdateCallError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(14, __c7, 0) as any as S.Schema, - output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(8, __c4, 0) as any as S.Schema, + output: __S(12, __c6, 0) as any as S.Schema, + errors: [InvalidCallId, NotImplemented, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -218,16 +382,10 @@ function __c0(j: number): any { case 0: return S.suspend(() => S.Struct({ - external_unique_id: S.String, - external_display_id: S.optional(S.String), - join_url: S.String, - desktop_app_join_url: S.optional(S.String), - date_start: S.optional(S.Number), - title: S.optional(S.String), - created_by: S.optional(S.String), - users: S.optional(__S(4, __c2, 0)), - }).pipe(T.Http({ method: "POST", uri: "/calls.add", code: 200 })), - ).annotate({ identifier: "AddCallRequest" }); + id: S.String, + users: __S(14, __c7, 0), + }).pipe(T.Http({ method: "POST", uri: "/calls.participants.add", code: 200 })), + ).annotate({ identifier: "AddParticipantRequest" }); } } function __c1(j: number): any { @@ -235,16 +393,20 @@ function __c1(j: number): any { case 0: return S.suspend(() => S.Struct({ - ok: S.Boolean, - call: S.Unknown, - }), - ).annotate({ identifier: "AddCallResponse" }); + id: S.String, + duration: S.optional(S.Number), + }).pipe(T.Http({ method: "POST", uri: "/calls.end", code: 200 })), + ).annotate({ identifier: "CallsEndRequest" }); } } function __c2(j: number): any { switch (j) { case 0: - return S.Array(S.Unknown); + return S.suspend(() => + S.Struct({ + id: S.String, + }).pipe(T.Http({ method: "POST", uri: "/calls.info", code: 200 })), + ).annotate({ identifier: "CallsInfoRequest" }); } } function __c3(j: number): any { @@ -253,9 +415,9 @@ function __c3(j: number): any { return S.suspend(() => S.Struct({ id: S.String, - users: __S(4, __c2, 0), - }).pipe(T.Http({ method: "POST", uri: "/calls.participants.add", code: 200 })), - ).annotate({ identifier: "AddParticipantRequest" }); + users: __S(14, __c7, 0), + }).pipe(T.Http({ method: "POST", uri: "/calls.participants.remove", code: 200 })), + ).annotate({ identifier: "RemoveParticipantRequest" }); } } function __c4(j: number): any { @@ -264,9 +426,11 @@ function __c4(j: number): any { return S.suspend(() => S.Struct({ id: S.String, - duration: S.optional(S.Number), - }).pipe(T.Http({ method: "POST", uri: "/calls.end", code: 200 })), - ).annotate({ identifier: "CallsEndRequest" }); + title: S.optional(S.String), + join_url: S.optional(S.String), + desktop_app_join_url: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/calls.update", code: 200 })), + ).annotate({ identifier: "UpdateCallRequest" }); } } function __c5(j: number): any { @@ -274,9 +438,16 @@ function __c5(j: number): any { case 0: return S.suspend(() => S.Struct({ - id: S.String, - }).pipe(T.Http({ method: "POST", uri: "/calls.info", code: 200 })), - ).annotate({ identifier: "CallsInfoRequest" }); + external_unique_id: S.String, + external_display_id: S.optional(S.String), + join_url: S.String, + desktop_app_join_url: S.optional(S.String), + date_start: S.optional(S.Number), + title: S.optional(S.String), + created_by: S.optional(S.String), + users: S.optional(__S(14, __c7, 0)), + }).pipe(T.Http({ method: "POST", uri: "/calls.add", code: 200 })), + ).annotate({ identifier: "AddCallRequest" }); } } function __c6(j: number): any { @@ -284,23 +455,16 @@ function __c6(j: number): any { case 0: return S.suspend(() => S.Struct({ - id: S.String, - users: __S(4, __c2, 0), - }).pipe(T.Http({ method: "POST", uri: "/calls.participants.remove", code: 200 })), - ).annotate({ identifier: "RemoveParticipantRequest" }); + ok: S.Boolean, + call: S.Unknown, + }), + ).annotate({ identifier: "AddCallResponse" }); } } function __c7(j: number): any { switch (j) { case 0: - return S.suspend(() => - S.Struct({ - id: S.String, - title: S.optional(S.String), - join_url: S.optional(S.String), - desktop_app_join_url: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/calls.update", code: 200 })), - ).annotate({ identifier: "UpdateCallRequest" }); + return S.Array(S.Unknown); } } // Schema table: entry i is schema j of builder f, made on first reach. diff --git a/packages/slack/src/services/canvases.ts b/packages/slack/src/services/canvases.ts index 2049742949..94e2845ecf 100644 --- a/packages/slack/src/services/canvases.ts +++ b/packages/slack/src/services/canvases.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,236 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `canvas_creation_failed` -- Canvas was unable to be created. */ +export class CanvasCreationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasCreationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_creation_failed" } }], + ) {} + +/** `canvas_deleted` -- The canvas you wish to search is not available. */ +export class CanvasDeleted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasDeleted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_deleted" } }], + ) {} + +/** `canvas_deleting_disabled` -- This functionality is disabled. */ +export class CanvasDeletingDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasDeletingDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_deleting_disabled" } }], + ) {} + +/** `canvas_disabled_user_team` -- Canvas is disabled on user's team. */ +export class CanvasDisabledUserTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasDisabledUserTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_disabled_user_team" } }], + ) {} + +/** `canvas_editing_failed` -- The changes to the canvas failed to be applied. */ +export class CanvasEditingFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasEditingFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_editing_failed" } }], + ) {} + +/** `canvas_editing_locked` -- Another edit to this canvas is currently in progress. Please retry after a short delay. */ +export class CanvasEditingLocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasEditingLocked", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_editing_locked" } }], + ) {} + +/** `canvas_not_found` -- The canvas you wish to revoke permissions for is not available. */ +export class CanvasNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "canvas_not_found" } }], + ) {} + +/** `canvas_too_large` -- The canvas is too large to apply the requested changes. Reduce the size of the canvas or the edit and try again. */ +export class CanvasTooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasTooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_too_large" } }], + ) {} + +/** `channel_not_found` -- A channel could not be found. */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `failed_to_update_user_ids` -- Failed to update the specified user_ids. */ +export class FailedToUpdateUserIds + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToUpdateUserIds", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_update_user_ids" } }], + ) {} + +/** `free_team_canvas_tab_already_exists` -- Free teams are limited to one canvas tab per channel */ +export class FreeTeamCanvasTabAlreadyExists + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "FreeTeamCanvasTabAlreadyExists", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "free_team_canvas_tab_already_exists" } }], + ) {} + +/** `free_teams_cannot_create_standalone_canvases` -- Free teams cannot create standalone canvases */ +export class FreeTeamsCannotCreateStandaloneCanvases + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "FreeTeamsCannotCreateStandaloneCanvases", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "free_teams_cannot_create_standalone_canvases" } }], + ) {} + +/** `free_teams_cannot_edit_standalone_canvases` -- Free teams cannot edit standalone canvases */ +export class FreeTeamsCannotEditStandaloneCanvases + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "FreeTeamsCannotEditStandaloneCanvases", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "free_teams_cannot_edit_standalone_canvases" } }], + ) {} + +/** `invalid_parameters` -- One of user_ids and channel_ids must be defined. */ +export class InvalidParameters + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidParameters", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_parameters" } }], + ) {} + +/** `restricted_action` -- User does not have permission to perform this action. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `user_not_found` -- A user could not be found. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + +/** `use_skills_api` -- When the Skills API is enabled for the caller, skill canvases must be deleted with slackbot.skills.delete using a user OAuth token with skills:write. Pass the canvas ID as skill_id. The success response remains ok: true. The skill and its canvas have not been deleted. */ +export class UseSkillsApi + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UseSkillsApi", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "use_skills_api" } }], + ) {} + export interface CreateCanvaseRequest { /** Title of the newly created canvas */ title?: string | undefined; @@ -143,8 +374,14 @@ export interface SetAccessResponse { /** The user IDs that could not be updated */ failed_to_update_user_ids?: SetAccessResponseFailedToUpdateUserIdsList | undefined; } -export type CreateCanvaseError = SlackOpError; -/** Create canvas for a user Required scopes -- bot: `canvases:write`; user: `canvases:write`; seamless_user: `seamless.user` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `restricted_action` -- User does not have permission to perform this action. - `canvas_creation_failed` -- Canvas was unable to be created. - `free_team_canvas_tab_already_exists` -- Free teams are limited to one canvas tab per channel - `free_teams_cannot_create_standalone_canvases` -- Free teams cannot create standalone canvases See https://docs.slack.dev/reference/methods/canvases.create */ +export type CreateCanvaseError = + | CanvasCreationFailed + | CanvasDisabledUserTeam + | FreeTeamCanvasTabAlreadyExists + | FreeTeamsCannotCreateStandaloneCanvases + | RestrictedAction + | SlackOpError; +/** Create canvas for a user Required scopes -- bot: `canvases:write`; user: `canvases:write`; seamless_user: `seamless.user` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `restricted_action` -- User does not have permission to perform this action. - `canvas_creation_failed` -- Canvas was unable to be created. - `free_team_canvas_tab_already_exists` -- Free teams are limited to one canvas tab per channel - `free_teams_cannot_create_standalone_canvases` -- Free teams cannot create standalone canvases See https://docs.slack.dev/reference/methods/canvases.create */ export const createCanvase: API.OperationMethod< CreateCanvaseRequest, CreateCanvaseResponse, @@ -153,15 +390,30 @@ export const createCanvase: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CanvasCreationFailed, + CanvasDisabledUserTeam, + FreeTeamCanvasTabAlreadyExists, + FreeTeamsCannotCreateStandaloneCanvases, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateCanvase", })); -export type DeleteAccessError = SlackOpError; -/** Remove access to a canvas for specified entities Required scopes -- bot: `canvases:write`; user: `canvases:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_not_found` -- The canvas you wish to revoke permissions for is not available. - `restricted_action` -- User does not have permission to perform this action. - `canvas_disabled_user_team` -- Canvas is disabled on user's team. - `invalid_parameters` -- One of user_ids and channel_ids must be defined. - `channel_not_found` -- A channel could not be found. - `user_not_found` -- A user could not be found. See https://docs.slack.dev/reference/methods/canvases.access.delete */ +export type DeleteAccessError = + | CanvasDisabledUserTeam + | CanvasNotFound + | ChannelNotFound + | InvalidParameters + | RestrictedAction + | UserNotFound + | SlackOpError; +/** Remove access to a canvas for specified entities Required scopes -- bot: `canvases:write`; user: `canvases:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `canvas_not_found` -- The canvas you wish to revoke permissions for is not available. - `restricted_action` -- User does not have permission to perform this action. - `canvas_disabled_user_team` -- Canvas is disabled on user's team. - `invalid_parameters` -- One of user_ids and channel_ids must be defined. - `channel_not_found` -- A channel could not be found. - `user_not_found` -- A user could not be found. See https://docs.slack.dev/reference/methods/canvases.access.delete */ export const deleteAccess: API.OperationMethod< DeleteAccessRequest, DeleteAccessResponse, @@ -170,15 +422,29 @@ export const deleteAccess: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(4, __c1, 0) as any as S.Schema, output: __S(16, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CanvasDisabledUserTeam, + CanvasNotFound, + ChannelNotFound, + InvalidParameters, + RestrictedAction, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteAccess", })); -export type DeleteCanvaseError = SlackOpError; -/** Deletes a canvas Required scopes -- bot: `canvases:write`; user: `canvases:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_deleting_disabled` -- This functionality is disabled. - `canvas_not_found` -- The canvas does not exist, or is not visible to the calling user. - `restricted_action` -- User does not have permission to perform this action. - `use_skills_api` -- When the Skills API is enabled for the caller, skill canvases must be deleted with slackbot.skills.delete using a user OAuth token with skills:write. Pass the canvas ID as skill_id. The success response remains ok: true. The skill and its canvas have not been deleted. See https://docs.slack.dev/reference/methods/canvases.delete */ +export type DeleteCanvaseError = + | CanvasDeletingDisabled + | CanvasNotFound + | RestrictedAction + | UseSkillsApi + | SlackOpError; +/** Deletes a canvas Required scopes -- bot: `canvases:write`; user: `canvases:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `canvas_deleting_disabled` -- This functionality is disabled. - `canvas_not_found` -- The canvas does not exist, or is not visible to the calling user. - `restricted_action` -- User does not have permission to perform this action. - `use_skills_api` -- When the Skills API is enabled for the caller, skill canvases must be deleted with slackbot.skills.delete using a user OAuth token with skills:write. Pass the canvas ID as skill_id. The success response remains ok: true. The skill and its canvas have not been deleted. See https://docs.slack.dev/reference/methods/canvases.delete */ export const deleteCanvase: API.OperationMethod< DeleteCanvaseRequest, DeleteCanvaseResponse, @@ -187,15 +453,31 @@ export const deleteCanvase: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(20, __c5, 0) as any as S.Schema, output: __S(24, __c6, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CanvasDeletingDisabled, + CanvasNotFound, + RestrictedAction, + UseSkillsApi, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteCanvase", })); -export type EditCanvaseError = SlackOpError; -/** Update an existing canvas Required scopes -- bot: `canvases:write`; user: `canvases:write`; seamless_user: `seamless.user` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_not_found` -- The canvas you wish to apply changes to is not available. - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `free_teams_cannot_edit_standalone_canvases` -- Free teams cannot edit standalone canvases - `restricted_action` -- User does not have permission to perform this action. - `canvas_editing_failed` -- The changes to the canvas failed to be applied. - `canvas_editing_locked` -- Another edit to this canvas is currently in progress. Please retry after a short delay. - `canvas_too_large` -- The canvas is too large to apply the requested changes. Reduce the size of the canvas or the edit and try again. - `use_skills_api` -- When the Skills API is enabled for the caller, skill canvases must be updated with slackbot.skills.update using a user OAuth token with skills:write. Pass the canvas ID as skill_id. The instructions input replaces the whole document; section edits are not supported. The response contains a skill object. No changes were made. See https://docs.slack.dev/reference/methods/canvases.edit */ +export type EditCanvaseError = + | CanvasDisabledUserTeam + | CanvasEditingFailed + | CanvasEditingLocked + | CanvasNotFound + | CanvasTooLarge + | FreeTeamsCannotEditStandaloneCanvases + | RestrictedAction + | UseSkillsApi + | SlackOpError; +/** Update an existing canvas Required scopes -- bot: `canvases:write`; user: `canvases:write`; seamless_user: `seamless.user` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `canvas_not_found` -- The canvas you wish to apply changes to is not available. - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `free_teams_cannot_edit_standalone_canvases` -- Free teams cannot edit standalone canvases - `restricted_action` -- User does not have permission to perform this action. - `canvas_editing_failed` -- The changes to the canvas failed to be applied. - `canvas_editing_locked` -- Another edit to this canvas is currently in progress. Please retry after a short delay. - `canvas_too_large` -- The canvas is too large to apply the requested changes. Reduce the size of the canvas or the edit and try again. - `use_skills_api` -- When the Skills API is enabled for the caller, skill canvases must be updated with slackbot.skills.update using a user OAuth token with skills:write. Pass the canvas ID as skill_id. The instructions input replaces the whole document; section edits are not supported. The response contains a skill object. No changes were made. See https://docs.slack.dev/reference/methods/canvases.edit */ export const editCanvase: API.OperationMethod< EditCanvaseRequest, EditCanvaseResponse, @@ -204,15 +486,26 @@ export const editCanvase: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(28, __c7, 0) as any as S.Schema, output: __S(24, __c6, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CanvasDisabledUserTeam, + CanvasEditingFailed, + CanvasEditingLocked, + CanvasNotFound, + CanvasTooLarge, + FreeTeamsCannotEditStandaloneCanvases, + RestrictedAction, + UseSkillsApi, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "EditCanvase", })); -export type GetContentError = SlackOpError; -/** Get the content of a canvas as markdown (default) or HTML. Required scopes -- bot: `canvases:read`; user: `canvases:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `canvas_not_found` -- The canvas does not exist, or is not visible to the calling user. - `internal_error` -- The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised. See https://docs.slack.dev/reference/methods/canvases.getContent */ +export type GetContentError = CanvasDisabledUserTeam | CanvasNotFound | SlackOpError; +/** Get the content of a canvas as markdown (default) or HTML. Required scopes -- bot: `canvases:read`; user: `canvases:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `canvas_not_found` -- The canvas does not exist, or is not visible to the calling user. - `internal_error` -- The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised. See https://docs.slack.dev/reference/methods/canvases.getContent */ export const getContent: API.OperationMethod< GetContentRequest, GetContentResponse, @@ -221,15 +514,19 @@ export const getContent: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c8, 0) as any as S.Schema, output: __S(33, __c8, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [CanvasDisabledUserTeam, CanvasNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetContent", })); -export type LookupSectionError = SlackOpError; -/** Find sections matching the provided criteria Required scopes -- bot: `canvases:read`; user: `canvases:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_deleted` -- The canvas you wish to search is not available. - `canvas_disabled_user_team` -- Canvas is disabled on user's team. - `canvas_not_found` -- The canvas you wish to search for is not available. - `internal_error` -- Something went wrong on our end, please try again. See https://docs.slack.dev/reference/methods/canvases.sections.lookup */ +export type LookupSectionError = + | CanvasDeleted + | CanvasDisabledUserTeam + | CanvasNotFound + | SlackOpError; +/** Find sections matching the provided criteria Required scopes -- bot: `canvases:read`; user: `canvases:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `canvas_deleted` -- The canvas you wish to search is not available. - `canvas_disabled_user_team` -- Canvas is disabled on user's team. - `canvas_not_found` -- The canvas you wish to search for is not available. - `internal_error` -- Something went wrong on our end, please try again. See https://docs.slack.dev/reference/methods/canvases.sections.lookup */ export const lookupSection: API.OperationMethod< LookupSectionRequest, LookupSectionResponse, @@ -238,15 +535,23 @@ export const lookupSection: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(36, __c9, 0) as any as S.Schema, output: __S(39, __c9, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [CanvasDeleted, CanvasDisabledUserTeam, CanvasNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "LookupSection", })); -export type SetAccessError = SlackOpError; -/** Sets the access level to a canvas for specified entities Required scopes -- bot: `canvases:write`; user: `canvases:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `canvas_not_found` -- The canvas you wish to update permissions for is not available. - `channel_not_found` -- A channel could not be found. - `failed_to_update_user_ids` -- Failed to update the specified user_ids. - `invalid_parameters` -- One of user_ids or channel_ids must be defined, but not both. - `restricted_action` -- User does not have permission to perform this action. - `user_not_found` -- A user could not be found. See https://docs.slack.dev/reference/methods/canvases.access.set */ +export type SetAccessError = + | CanvasDisabledUserTeam + | CanvasNotFound + | ChannelNotFound + | FailedToUpdateUserIds + | InvalidParameters + | RestrictedAction + | UserNotFound + | SlackOpError; +/** Sets the access level to a canvas for specified entities Required scopes -- bot: `canvases:write`; user: `canvases:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `canvas_not_found` -- The canvas you wish to update permissions for is not available. - `channel_not_found` -- A channel could not be found. - `failed_to_update_user_ids` -- Failed to update the specified user_ids. - `invalid_parameters` -- One of user_ids or channel_ids must be defined, but not both. - `restricted_action` -- User does not have permission to perform this action. - `user_not_found` -- A user could not be found. See https://docs.slack.dev/reference/methods/canvases.access.set */ export const setAccess: API.OperationMethod< SetAccessRequest, SetAccessResponse, @@ -255,7 +560,17 @@ export const setAccess: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(40, __c10, 0) as any as S.Schema, output: __S(16, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CanvasDisabledUserTeam, + CanvasNotFound, + ChannelNotFound, + FailedToUpdateUserIds, + InvalidParameters, + RestrictedAction, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/chat.ts b/packages/slack/src/services/chat.ts index 581e57a507..f205c21751 100644 --- a/packages/slack/src/services/chat.ts +++ b/packages/slack/src/services/chat.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,1388 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `agent_prompt_display_not_allowed` -- `client_context.agent_prompt_display` may only be set by the Slack client when posting to the user's Slackbot DM. */ +export class AgentPromptDisplayNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AgentPromptDisplayNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "agent_prompt_display_not_allowed" } }], + ) {} + +/** `app_access_restricted` -- The user does not have permission to use this app. */ +export class AppAccessRestricted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppAccessRestricted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_access_restricted" } }], + ) {} + +/** `as_user_not_supported` -- The `as_user` parameter does not function with workspace apps. */ +export class AsUserNotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AsUserNotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "as_user_not_supported" } }], + ) {} + +/** `attachment_payload_limit_exceeded` -- Attachment payload size is too long. */ +export class AttachmentPayloadLimitExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "AttachmentPayloadLimitExceeded", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "attachment_payload_limit_exceeded" } }], + ) {} + +/** `bad_token` -- The provided `token` was invalid. */ +export class BadToken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadToken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_token" } }], + ) {} + +/** `blocked_file_type` -- Admin has disabled uploading this type of file. */ +export class BlockedFileType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BlockedFileType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "blocked_file_type" } }], + ) {} + +/** `block_mismatch` -- Rich-text blocks cannot be replaced with non-rich-text blocks */ +export class BlockMismatch + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BlockMismatch", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "block_mismatch" } }], + ) {} + +/** `cannot_auth_user` -- The current user cannot be authenticated. */ +export class CannotAuthUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotAuthUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_auth_user" } }], + ) {} + +/** `cannot_find_channel` -- The specified channel could not be located for this token. */ +export class CannotFindChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotFindChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_find_channel" } }], + ) {} + +/** `cannot_find_message` -- The `ts` value in the request does not match a message. */ +export class CannotFindMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotFindMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_find_message" } }], + ) {} + +/** `cannot_find_service` -- A record of your app being allowed to unfurl for this workspace could not be found. */ +export class CannotFindService + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotFindService", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_find_service" } }], + ) {} + +/** `cannot_parse_attachment` -- The provided `unfurls` argument could not be parsed or understood. */ +export class CannotParseAttachment + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotParseAttachment", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_parse_attachment" } }], + ) {} + +/** `cannot_prompt` -- The current user has already interacted with and dismissed a prompt for this application. */ +export class CannotPrompt + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotPrompt", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_prompt" } }], + ) {} + +/** `cannot_provide_both_markdown_text_and_chunks` -- Cannot provide both `markdown_text` and `chunks` in the same request. */ +export class CannotProvideBothMarkdownTextAndChunks + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "CannotProvideBothMarkdownTextAndChunks", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "cannot_provide_both_markdown_text_and_chunks" } }], + ) {} + +/** `cannot_reply_to_message` -- This message type cannot have thread replies. */ +export class CannotReplyToMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotReplyToMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_reply_to_message" } }], + ) {} + +/** `cannot_unfurl_message` -- The URL cannot be unfurled because the URL provided does not appear in the message. */ +export class CannotUnfurlMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotUnfurlMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_unfurl_message" } }], + ) {} + +/** `cannot_unfurl_url` -- The URL cannot be unfurled. This error may be returned if you haven't acknowledged a `link_shared` event tied to the same URL. It is also returned when the domain appears in a workspace's administrative blocklists. */ +export class CannotUnfurlUrl + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotUnfurlUrl", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_unfurl_url" } }], + ) {} + +/** `cant_broadcast_message` -- Unable to broadcast this message. */ +export class CantBroadcastMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantBroadcastMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_broadcast_message" } }], + ) {} + +/** `cant_delete_message` -- Authenticated user does not have permission to delete this message. */ +export class CantDeleteMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantDeleteMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_delete_message" } }], + ) {} + +/** `cant_update_message` -- Authenticated user does not have permission to update this message. */ +export class CantUpdateMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantUpdateMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_update_message" } }], + ) {} + +/** `channel_not_found` -- Value passed for `channel` was invalid. */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `channel_type_not_supported` -- Channel type not supported */ +export class ChannelTypeNotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelTypeNotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_type_not_supported" } }], + ) {} + +/** `draft_already_deleted` -- The draft has already been deleted. */ +export class DraftAlreadyDeleted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DraftAlreadyDeleted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "draft_already_deleted" } }], + ) {} + +/** `draft_already_sent` -- The draft has already been sent. */ +export class DraftAlreadySent + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DraftAlreadySent", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "draft_already_sent" } }], + ) {} + +/** `draft_has_conflict` -- The client draft version is out of sync with the server draft version. */ +export class DraftHasConflict + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DraftHasConflict", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "draft_has_conflict" } }], + ) {} + +/** `draft_not_found` -- The draft was not found. */ +export class DraftNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DraftNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "draft_not_found" } }], + ) {} + +/** `duplicate_channel_not_found` -- Channel associated with `client_msg_id` was invalid. */ +export class DuplicateChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DuplicateChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "duplicate_channel_not_found" } }], + ) {} + +/** `duplicate_message_not_found` -- No duplicate message exists associated with `client_msg_id`. */ +export class DuplicateMessageNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DuplicateMessageNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "duplicate_message_not_found" } }], + ) {} + +/** `edit_window_closed` -- The message cannot be edited due to the team message edit settings */ +export class EditWindowClosed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EditWindowClosed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "edit_window_closed" } }], + ) {} + +/** `ekm_access_denied` -- Your message couldn't be sent because your admins have disabled sending messages to this channel. */ +export class EkmAccessDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EkmAccessDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "ekm_access_denied" } }], + ) {} + +/** `external_channel_migrating` -- The channel is in the process of migrating and so the message cannot be updated at this time. */ +export class ExternalChannelMigrating + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExternalChannelMigrating", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "external_channel_migrating" } }], + ) {} + +/** `file_deleted` -- File to share deleted. */ +export class FileDeleted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileDeleted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_deleted" } }], + ) {} + +/** `file_is_deleted` -- The file is deleted. */ +export class FileIsDeleted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileIsDeleted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_is_deleted" } }], + ) {} + +/** `file_not_found` -- One or more of the provided file IDs could not be found. */ +export class FileNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_not_found" } }], + ) {} + +/** `file_share_limit_reached` -- The file has reached the share limit. */ +export class FileShareLimitReached + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileShareLimitReached", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_share_limit_reached" } }], + ) {} + +/** `invalid_attachments` -- Attachments that contain blocks are not valid */ +export class InvalidAttachments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAttachments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_attachments" } }], + ) {} + +/** `invalid_blocks` -- Blocks submitted with this message are not valid. */ +export class InvalidBlocks + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidBlocks", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_blocks" } }], + ) {} + +/** `invalid_blocks_format` -- The `blocks` is not a valid JSON object or doesn't match the Block Kit syntax. */ +export class InvalidBlocksFormat + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidBlocksFormat", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_blocks_format" } }], + ) {} + +/** `invalid_channel` -- The channel passed is invalid */ +export class InvalidChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_channel" } }], + ) {} + +/** `invalid_channel_id` -- Value passed for `channel` was not a valid channel ID. */ +export class InvalidChannelId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChannelId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_channel_id" } }], + ) {} + +/** `invalid_chunks` -- Chunks submitted with this message are not valid. */ +export class InvalidChunks + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChunks", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_chunks" } }], + ) {} + +/** `invalid_cursor` -- Provided cursor is invalid */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_metadata_format` -- Invalid metadata format provided */ +export class InvalidMetadataFormat + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidMetadataFormat", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_metadata_format" } }], + ) {} + +/** `invalid_metadata_schema` -- Invalid metadata schema provided */ +export class InvalidMetadataSchema + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidMetadataSchema", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_metadata_schema" } }], + ) {} + +/** `invalid_scheduled_message_id` -- The `scheduled_message_id` passed is either an invalid ID, or the scheduled message it's referencing has already been sent or deleted. */ +export class InvalidScheduledMessageId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidScheduledMessageId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_scheduled_message_id" } }], + ) {} + +/** `invalid_source` -- The unfurl source is invalid. */ +export class InvalidSource + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidSource", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_source" } }], + ) {} + +/** `invalid_time` -- value passed for `post_time` was invalid. */ +export class InvalidTime + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTime", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_time" } }], + ) {} + +/** `invalid_token` -- Token is invalid */ +export class InvalidToken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidToken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_token" } }], + ) {} + +/** `invalid_unfurl_id` -- The unfurl ID is invalid. */ +export class InvalidUnfurlId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidUnfurlId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_unfurl_id" } }], + ) {} + +/** `invalid_unfurls_format` -- The `unfurls` parameter cannot be JSON-decoded into a map of URLs to attachments. */ +export class InvalidUnfurlsFormat + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidUnfurlsFormat", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_unfurls_format" } }], + ) {} + +/** `is_archived` -- Channel has been archived. */ +export class IsArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("IsArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "is_archived" } }], + ) {} + +/** `is_inactive` -- The message cannot be edited within a frozen, archived or deleted channel. */ +export class IsInactive + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("IsInactive", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "is_inactive" } }], + ) {} + +/** `markdown_text_conflict` -- Markdown text cannot be used in conjunction with `blocks` or `text` argument. */ +export class MarkdownTextConflict + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MarkdownTextConflict", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "markdown_text_conflict" } }], + ) {} + +/** `markdown_text_or_chunks_required` -- One of 'markdown_text' or 'chunks' is required */ +export class MarkdownTextOrChunksRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MarkdownTextOrChunksRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "markdown_text_or_chunks_required" } }], + ) {} + +/** `markdown_text_required` -- Missing required field: 'markdown_text' */ +export class MarkdownTextRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MarkdownTextRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "markdown_text_required" } }], + ) {} + +/** `max_file_sharing_exceeded` -- Exceeded max allowed files shared. */ +export class MaxFileSharingExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MaxFileSharingExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "max_file_sharing_exceeded" } }], + ) {} + +/** `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces */ +export class MessageLimitExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessageLimitExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "message_limit_exceeded" } }], + ) {} + +/** `message_not_found` -- Message not found */ +export class MessageNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessageNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "message_not_found" } }], + ) {} + +/** `message_not_in_streaming_state` -- The message is not in the streaming state. */ +export class MessageNotInStreamingState + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessageNotInStreamingState", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "message_not_in_streaming_state" } }], + ) {} + +/** `message_not_owned_by_app` -- The message is not owned by the app. */ +export class MessageNotOwnedByApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessageNotOwnedByApp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "message_not_owned_by_app" } }], + ) {} + +/** `messages_tab_disabled` -- Messages tab for the app is disabled. */ +export class MessagesTabDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessagesTabDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "messages_tab_disabled" } }], + ) {} + +/** `messaging_processing_failed` -- Failed to process the message. */ +export class MessagingProcessingFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessagingProcessingFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "messaging_processing_failed" } }], + ) {} + +/** `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token */ +export class MetadataMustBeSentFromApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MetadataMustBeSentFromApp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "metadata_must_be_sent_from_app" } }], + ) {} + +/** `metadata_too_large` -- Metadata exceeds size limit */ +export class MetadataTooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MetadataTooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "metadata_too_large" } }], + ) {} + +/** `missing_channel` -- The request is missing the `channel` parameter */ +export class MissingChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_channel" } }], + ) {} + +/** `missing_file_data` -- Attempted to share a file but some required data was missing. */ +export class MissingFileData + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingFileData", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_file_data" } }], + ) {} + +/** `missing_recipient_team_id` -- Missing recipient team ID. */ +export class MissingRecipientTeamId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingRecipientTeamId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_recipient_team_id" } }], + ) {} + +/** `missing_recipient_user_id` -- Missing recipient user ID. */ +export class MissingRecipientUserId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingRecipientUserId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_recipient_user_id" } }], + ) {} + +/** `missing_source` -- The request is missing the `source` parameter. */ +export class MissingSource + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingSource", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_source" } }], + ) {} + +/** `missing_ts` -- The request is missing the `ts` parameter */ +export class MissingTs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingTs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_ts" } }], + ) {} + +/** `missing_unfurl_id` -- The request is missing the `unfurl_id` parameter. */ +export class MissingUnfurlId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingUnfurlId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_unfurl_id" } }], + ) {} + +/** `missing_unfurls` -- The request is missing the `unfurls` parameter. */ +export class MissingUnfurls + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingUnfurls", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_unfurls" } }], + ) {} + +/** `msg_blocks_too_long` -- Blocks submitted with this message are too long. */ +export class MsgBlocksTooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MsgBlocksTooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "msg_blocks_too_long" } }], + ) {} + +/** `msg_blocks_too_many` -- Max blocks exceeded, blocks are limited to 50 per message. */ +export class MsgBlocksTooMany + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MsgBlocksTooMany", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "msg_blocks_too_many" } }], + ) {} + +/** `msg_too_long` -- Message text is too long */ +export class MsgTooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MsgTooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "msg_too_long" } }], + ) {} + +/** `no_dual_broadcast_content_update` -- Can't broadcast an old reply and update the content at the same time. */ +export class NoDualBroadcastContentUpdate + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoDualBroadcastContentUpdate", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_dual_broadcast_content_update" } }], + ) {} + +/** `no_text` -- No message text provided */ +export class NoText + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoText", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_text" } }], + ) {} + +/** `not_in_channel` -- Cannot post user messages to a channel they are not in. */ +export class NotInChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotInChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_in_channel" } }], + ) {} + +/** `posting_to_channel_denied` -- Files and images, including attachments with `image_url` or `thumb_url` and `image` blocks (such as GIFs), can't be posted to this channel. Remove them and try again. */ +export class PostingToChannelDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PostingToChannelDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "posting_to_channel_denied" } }], + ) {} + +/** `restricted_action` -- A workspace preference prevents the authenticated user from posting. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. */ +export class RestrictedActionNonThreadableChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "RestrictedActionNonThreadableChannel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "restricted_action_non_threadable_channel" } }], + ) {} + +/** `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. */ +export class RestrictedActionReadOnlyChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "RestrictedActionReadOnlyChannel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "restricted_action_read_only_channel" } }], + ) {} + +/** `restricted_action_thread_locked` -- Cannot post replies to a thread that has been locked by admins. */ +export class RestrictedActionThreadLocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedActionThreadLocked", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action_thread_locked" } }], + ) {} + +/** `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. */ +export class RestrictedActionThreadOnlyChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "RestrictedActionThreadOnlyChannel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "restricted_action_thread_only_channel" } }], + ) {} + +/** `restricted_too_many` -- Too many messages were scheduled in the channel for a given period. See [usage info](/reference/methods/chat.scheduleMessage#restrictions) for additional details */ +export class RestrictedTooMany + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedTooMany", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_too_many" } }], + ) {} + +/** `send_on_behalf_not_allowed` -- Cannot send on behalf of the provided user. */ +export class SendOnBehalfNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SendOnBehalfNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "send_on_behalf_not_allowed" } }], + ) {} + +/** `slack_connect_blocked_file_type` -- Files with certain extensions are blocked from being uploaded in all Slack Connect messages. */ +export class SlackConnectBlockedFileType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SlackConnectBlockedFileType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "slack_connect_blocked_file_type" } }], + ) {} + +/** `slack_connect_canvas_sharing_blocked` -- Admin has disabled Canvas File sharing in all Slack Connect communications */ +export class SlackConnectCanvasSharingBlocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "SlackConnectCanvasSharingBlocked", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "slack_connect_canvas_sharing_blocked" } }], + ) {} + +/** `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip uploads in Slack Connect channels. */ +export class SlackConnectClipSharingBlocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "SlackConnectClipSharingBlocked", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "slack_connect_clip_sharing_blocked" } }], + ) {} + +/** `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications */ +export class SlackConnectFileLinkSharingBlocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "SlackConnectFileLinkSharingBlocked", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "slack_connect_file_link_sharing_blocked" } }], + ) {} + +/** `slack_connect_file_upload_sharing_blocked` -- Admin has disabled file uploads in all Slack Connect messages. */ +export class SlackConnectFileUploadSharingBlocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "SlackConnectFileUploadSharingBlocked", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "slack_connect_file_upload_sharing_blocked" } }], + ) {} + +/** `slack_connect_lists_sharing_blocked` -- Admin has disabled Lists sharing in all Slack Connect communications */ +export class SlackConnectListsSharingBlocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "SlackConnectListsSharingBlocked", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "slack_connect_lists_sharing_blocked" } }], + ) {} + +/** `stopped_by_user` -- The streaming message was stopped by the user and no further appends are accepted. */ +export class StoppedByUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("StoppedByUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "stopped_by_user" } }], + ) {} + +/** `streaming_mode_mismatch` -- The streaming mode must be the same as the streaming mode used to start the stream. If you started the stream with `markdown_text`, you must append with `markdown_text`. If you started the stream with `chunks`, you must append with `chunks`. */ +export class StreamingModeMismatch + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("StreamingModeMismatch", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "streaming_mode_mismatch" } }], + ) {} + +/** `streaming_state_conflict` -- The message is currently streaming text and cannot be edited. */ +export class StreamingStateConflict + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("StreamingStateConflict", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "streaming_state_conflict" } }], + ) {} + +/** `team_not_found` -- This error occurs if, when using an org-wide token, the `channel_name` is passed instead of the `channel_id`. */ +export class TeamNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "team_not_found" } }], + ) {} + +/** `time_in_past` -- value passed for `post_time` was in the past. */ +export class TimeInPast + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TimeInPast", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "time_in_past" } }], + ) {} + +/** `time_too_far` -- value passed for `post_time` was too far into the future. */ +export class TimeTooFar + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TimeTooFar", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "time_too_far" } }], + ) {} + +/** `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. */ +export class TooManyAttachments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyAttachments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_attachments" } }], + ) {} + +/** `too_many_contact_cards` -- Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message. */ +export class TooManyContactCards + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyContactCards", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_contact_cards" } }], + ) {} + +/** `unable_to_share_files` -- Sharing the files failed. */ +export class UnableToShareFiles + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnableToShareFiles", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unable_to_share_files" } }], + ) {} + +/** `update_failed` -- Internal update failure. */ +export class UpdateFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UpdateFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "update_failed" } }], + ) {} + +/** `user_not_found` -- User not found. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + +/** `user_not_in_channel` -- Intended recipient is not in the specified channel. */ +export class UserNotInChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotInChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_not_in_channel" } }], + ) {} + /** Array of streaming chunks that can contain either markdown text or task updates */ export type AppendStreamRequestChunksList = Array; export interface AppendStreamRequest { @@ -425,8 +1808,48 @@ export interface UpdateChatResponse { text: string; message: UpdateChatResponseMessage; } -export type AppendStreamError = SlackOpError; -/** Appends text to an existing streaming conversation. Required scopes -- bot: `chat:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `message_not_in_streaming_state` -- The message is not in the streaming state. - `messaging_processing_failed` -- Failed to process the message. - `as_user_not_supported` -- The `as_user` parameter does not function with workspace apps. - `channel_not_found` -- Value passed for `channel` was invalid. - `duplicate_channel_not_found` -- Channel associated with `client_msg_id` was invalid. - `duplicate_message_not_found` -- No duplicate message exists associated with `client_msg_id`. - `ekm_access_denied` -- Your message couldn't be sent because your admins have disabled sending messages to this channel. - `invalid_blocks` -- Blocks submitted with this message are not valid. - `invalid_chunks` -- Chunks submitted with this message are not valid. - `invalid_metadata_format` -- Invalid metadata format provided - `invalid_metadata_schema` -- Invalid metadata schema provided - `is_archived` -- Channel has been archived. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces - `messages_tab_disabled` -- Messages tab for the app is disabled. - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token - `msg_blocks_too_long` -- Blocks submitted with this message are too long. - `msg_blocks_too_many` -- Max blocks exceeded, blocks are limited to 50 per message. - `metadata_too_large` -- Metadata exceeds size limit - `no_text` -- No message text provided - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. - `restricted_action_thread_locked` -- Cannot post replies to a thread that has been locked by admins. - `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled Canvas File sharing in all Slack Connect communications - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications - `slack_connect_lists_sharing_blocked` -- Admin has disabled Lists sharing in all Slack Connect communications - `team_not_found` -- This error occurs if, when using an org-wide token, the `channel_name` is passed instead of the `channel_id`. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `too_many_contact_cards` -- Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message. - `message_not_found` -- Message not found - `channel_type_not_supported` -- Channel type not supported - `stopped_by_user` -- The streaming message was stopped by the user and no further appends are accepted. - `message_not_owned_by_app` -- The message is not owned by the app. - `markdown_text_required` -- Missing required field: 'markdown_text' - `markdown_text_or_chunks_required` -- One of 'markdown_text' or 'chunks' is required - `streaming_mode_mismatch` -- The streaming mode must be the same as the streaming mode used to start the stream. If you started the stream with `markdown_text`, you must append with `markdown_text`. If you started the stream with `chunks`, you must append with `chunks`. - `cannot_provide_both_markdown_text_and_chunks` -- Cannot provide both `markdown_text` and `chunks` in the same request. See https://docs.slack.dev/reference/methods/chat.appendStream */ +export type AppendStreamError = + | AsUserNotSupported + | CannotProvideBothMarkdownTextAndChunks + | ChannelNotFound + | ChannelTypeNotSupported + | DuplicateChannelNotFound + | DuplicateMessageNotFound + | EkmAccessDenied + | InvalidBlocks + | InvalidChunks + | InvalidMetadataFormat + | InvalidMetadataSchema + | IsArchived + | MarkdownTextOrChunksRequired + | MarkdownTextRequired + | MessageLimitExceeded + | MessageNotFound + | MessageNotInStreamingState + | MessageNotOwnedByApp + | MessagesTabDisabled + | MessagingProcessingFailed + | MetadataMustBeSentFromApp + | MetadataTooLarge + | MsgBlocksTooLong + | MsgBlocksTooMany + | NoText + | NotInChannel + | RestrictedAction + | RestrictedActionNonThreadableChannel + | RestrictedActionReadOnlyChannel + | RestrictedActionThreadLocked + | RestrictedActionThreadOnlyChannel + | SlackConnectCanvasSharingBlocked + | SlackConnectFileLinkSharingBlocked + | SlackConnectListsSharingBlocked + | StoppedByUser + | StreamingModeMismatch + | TeamNotFound + | TooManyAttachments + | TooManyContactCards + | SlackOpError; +/** Appends text to an existing streaming conversation. Required scopes -- bot: `chat:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `message_not_in_streaming_state` -- The message is not in the streaming state. - `messaging_processing_failed` -- Failed to process the message. - `as_user_not_supported` -- The `as_user` parameter does not function with workspace apps. - `channel_not_found` -- Value passed for `channel` was invalid. - `duplicate_channel_not_found` -- Channel associated with `client_msg_id` was invalid. - `duplicate_message_not_found` -- No duplicate message exists associated with `client_msg_id`. - `ekm_access_denied` -- Your message couldn't be sent because your admins have disabled sending messages to this channel. - `invalid_blocks` -- Blocks submitted with this message are not valid. - `invalid_chunks` -- Chunks submitted with this message are not valid. - `invalid_metadata_format` -- Invalid metadata format provided - `invalid_metadata_schema` -- Invalid metadata schema provided - `is_archived` -- Channel has been archived. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces - `messages_tab_disabled` -- Messages tab for the app is disabled. - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token - `msg_blocks_too_long` -- Blocks submitted with this message are too long. - `msg_blocks_too_many` -- Max blocks exceeded, blocks are limited to 50 per message. - `metadata_too_large` -- Metadata exceeds size limit - `no_text` -- No message text provided - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. - `restricted_action_thread_locked` -- Cannot post replies to a thread that has been locked by admins. - `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled Canvas File sharing in all Slack Connect communications - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications - `slack_connect_lists_sharing_blocked` -- Admin has disabled Lists sharing in all Slack Connect communications - `team_not_found` -- This error occurs if, when using an org-wide token, the `channel_name` is passed instead of the `channel_id`. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `too_many_contact_cards` -- Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message. - `message_not_found` -- Message not found - `channel_type_not_supported` -- Channel type not supported - `stopped_by_user` -- The streaming message was stopped by the user and no further appends are accepted. - `message_not_owned_by_app` -- The message is not owned by the app. - `markdown_text_required` -- Missing required field: 'markdown_text' - `markdown_text_or_chunks_required` -- One of 'markdown_text' or 'chunks' is required - `streaming_mode_mismatch` -- The streaming mode must be the same as the streaming mode used to start the stream. If you started the stream with `markdown_text`, you must append with `markdown_text`. If you started the stream with `chunks`, you must append with `chunks`. - `cannot_provide_both_markdown_text_and_chunks` -- Cannot provide both `markdown_text` and `chunks` in the same request. See https://docs.slack.dev/reference/methods/chat.appendStream */ export const appendStream: API.OperationMethod< AppendStreamRequest, AppendStreamResponse, @@ -434,16 +1857,76 @@ export const appendStream: API.OperationMethod< SlackOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, - output: __S(32, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + output: __S(16, __c1, 0) as any as S.Schema, + errors: [ + AsUserNotSupported, + CannotProvideBothMarkdownTextAndChunks, + ChannelNotFound, + ChannelTypeNotSupported, + DuplicateChannelNotFound, + DuplicateMessageNotFound, + EkmAccessDenied, + InvalidBlocks, + InvalidChunks, + InvalidMetadataFormat, + InvalidMetadataSchema, + IsArchived, + MarkdownTextOrChunksRequired, + MarkdownTextRequired, + MessageLimitExceeded, + MessageNotFound, + MessageNotInStreamingState, + MessageNotOwnedByApp, + MessagesTabDisabled, + MessagingProcessingFailed, + MetadataMustBeSentFromApp, + MetadataTooLarge, + MsgBlocksTooLong, + MsgBlocksTooMany, + NoText, + NotInChannel, + RestrictedAction, + RestrictedActionNonThreadableChannel, + RestrictedActionReadOnlyChannel, + RestrictedActionThreadLocked, + RestrictedActionThreadOnlyChannel, + SlackConnectCanvasSharingBlocked, + SlackConnectFileLinkSharingBlocked, + SlackConnectListsSharingBlocked, + StoppedByUser, + StreamingModeMismatch, + TeamNotFound, + TooManyAttachments, + TooManyContactCards, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AppendStream", })); -export type ChatUnfurlError = SlackOpError; -/** Provide custom unfurl behavior for user-posted URLs Required scopes -- bot: `links:write`; user: `links:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `cannot_auth_user` -- The current user cannot be authenticated. - `cannot_find_channel` -- The specified channel could not be located for this token. - `cannot_find_message` -- The `ts` value in the request does not match a message. - `cannot_find_service` -- A record of your app being allowed to unfurl for this workspace could not be found. - `cannot_parse_attachment` -- The provided `unfurls` argument could not be parsed or understood. - `cannot_prompt` -- The current user has already interacted with and dismissed a prompt for this application. - `cannot_unfurl_message` -- The URL cannot be unfurled because the URL provided does not appear in the message. - `cannot_unfurl_url` -- The URL cannot be unfurled. This error may be returned if you haven't acknowledged a `link_shared` event tied to the same URL. It is also returned when the domain appears in a workspace's administrative blocklists. - `invalid_unfurl_id` -- The unfurl ID is invalid. - `invalid_unfurls_format` -- The `unfurls` parameter cannot be JSON-decoded into a map of URLs to attachments. - `invalid_metadata_format` -- The `metadata` parameter cannot be JSON-decoded into the expected format. - `invalid_source` -- The unfurl source is invalid. - `missing_channel` -- The request is missing the `channel` parameter - `missing_source` -- The request is missing the `source` parameter. - `missing_ts` -- The request is missing the `ts` parameter - `missing_unfurl_id` -- The request is missing the `unfurl_id` parameter. - `missing_unfurls` -- The request is missing the `unfurls` parameter. See https://docs.slack.dev/reference/methods/chat.unfurl */ +export type ChatUnfurlError = + | CannotAuthUser + | CannotFindChannel + | CannotFindMessage + | CannotFindService + | CannotParseAttachment + | CannotPrompt + | CannotUnfurlMessage + | CannotUnfurlUrl + | InvalidMetadataFormat + | InvalidSource + | InvalidUnfurlId + | InvalidUnfurlsFormat + | MissingChannel + | MissingSource + | MissingTs + | MissingUnfurlId + | MissingUnfurls + | SlackOpError; +/** Provide custom unfurl behavior for user-posted URLs Required scopes -- bot: `links:write`; user: `links:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `cannot_auth_user` -- The current user cannot be authenticated. - `cannot_find_channel` -- The specified channel could not be located for this token. - `cannot_find_message` -- The `ts` value in the request does not match a message. - `cannot_find_service` -- A record of your app being allowed to unfurl for this workspace could not be found. - `cannot_parse_attachment` -- The provided `unfurls` argument could not be parsed or understood. - `cannot_prompt` -- The current user has already interacted with and dismissed a prompt for this application. - `cannot_unfurl_message` -- The URL cannot be unfurled because the URL provided does not appear in the message. - `cannot_unfurl_url` -- The URL cannot be unfurled. This error may be returned if you haven't acknowledged a `link_shared` event tied to the same URL. It is also returned when the domain appears in a workspace's administrative blocklists. - `invalid_unfurl_id` -- The unfurl ID is invalid. - `invalid_unfurls_format` -- The `unfurls` parameter cannot be JSON-decoded into a map of URLs to attachments. - `invalid_metadata_format` -- The `metadata` parameter cannot be JSON-decoded into the expected format. - `invalid_source` -- The unfurl source is invalid. - `missing_channel` -- The request is missing the `channel` parameter - `missing_source` -- The request is missing the `source` parameter. - `missing_ts` -- The request is missing the `ts` parameter - `missing_unfurl_id` -- The request is missing the `unfurl_id` parameter. - `missing_unfurls` -- The request is missing the `unfurls` parameter. See https://docs.slack.dev/reference/methods/chat.unfurl */ export const chatUnfurl: API.OperationMethod< ChatUnfurlRequest, ChatUnfurlResponse, @@ -452,66 +1935,106 @@ export const chatUnfurl: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c3, 0) as any as S.Schema, output: __S(64, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotAuthUser, + CannotFindChannel, + CannotFindMessage, + CannotFindService, + CannotParseAttachment, + CannotPrompt, + CannotUnfurlMessage, + CannotUnfurlUrl, + InvalidMetadataFormat, + InvalidSource, + InvalidUnfurlId, + InvalidUnfurlsFormat, + MissingChannel, + MissingSource, + MissingTs, + MissingUnfurlId, + MissingUnfurls, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ChatUnfurl", })); -export type DeleteChatError = SlackOpError; -/** Deletes a message. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `cant_delete_message` -- Authenticated user does not have permission to delete this message. - `channel_not_found` -- Value passed for `channel` was invalid. - `message_not_found` -- No message exists with the requested timestamp. - `invalid_channel_id` -- Value passed for `channel` was not a valid channel ID. See https://docs.slack.dev/reference/methods/chat.delete */ +export type DeleteChatError = + | CantDeleteMessage + | ChannelNotFound + | InvalidChannelId + | MessageNotFound + | SlackOpError; +/** Deletes a message. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `cant_delete_message` -- Authenticated user does not have permission to delete this message. - `channel_not_found` -- Value passed for `channel` was invalid. - `message_not_found` -- No message exists with the requested timestamp. - `invalid_channel_id` -- Value passed for `channel` was not a valid channel ID. See https://docs.slack.dev/reference/methods/chat.delete */ export const deleteChat: API.OperationMethod< DeleteChatRequest, DeleteChatResponse, DeleteChatError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(128, __c8, 0) as any as S.Schema, - output: __S(32, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(80, __c5, 0) as any as S.Schema, + output: __S(16, __c1, 0) as any as S.Schema, + errors: [ + CantDeleteMessage, + ChannelNotFound, + InvalidChannelId, + MessageNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteChat", })); -export type DeleteScheduledMessageError = SlackOpError; -/** Deletes a pending scheduled message from the queue. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `bad_token` -- The provided `token` was invalid. - `channel_not_found` -- The `channel` passed is either an invalid ID or does not exist. - `invalid_scheduled_message_id` -- The `scheduled_message_id` passed is either an invalid ID, or the scheduled message it's referencing has already been sent or deleted. See https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage */ +export type DeleteScheduledMessageError = + | BadToken + | ChannelNotFound + | InvalidScheduledMessageId + | SlackOpError; +/** Deletes a pending scheduled message from the queue. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `bad_token` -- The provided `token` was invalid. - `channel_not_found` -- The `channel` passed is either an invalid ID or does not exist. - `invalid_scheduled_message_id` -- The `scheduled_message_id` passed is either an invalid ID, or the scheduled message it's referencing has already been sent or deleted. See https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage */ export const deleteScheduledMessage: API.OperationMethod< DeleteScheduledMessageRequest, DeleteScheduledMessageResponse, DeleteScheduledMessageError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(144, __c9, 0) as any as S.Schema, + input: __S(96, __c6, 0) as any as S.Schema, output: __S(64, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [BadToken, ChannelNotFound, InvalidScheduledMessageId, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteScheduledMessage", })); -export type GetPermalinkError = SlackOpError; -/** Retrieve a permalink URL for a specific extant message Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `message_not_found` -- The message identified by `message_ts` could not be found. See https://docs.slack.dev/reference/methods/chat.getPermalink */ +export type GetPermalinkError = ChannelNotFound | MessageNotFound | SlackOpError; +/** Retrieve a permalink URL for a specific extant message Rate limit tier: 5 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `message_not_found` -- The message identified by `message_ts` could not be found. See https://docs.slack.dev/reference/methods/chat.getPermalink */ export const getPermalink: API.OperationMethod< GetPermalinkRequest, GetPermalinkResponse, GetPermalinkError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(160, __c10, 0) as any as S.Schema, - output: __S(161, __c10, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(112, __c7, 0) as any as S.Schema, + output: __S(113, __c7, 1) as any as S.Schema, + errors: [ChannelNotFound, MessageNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetPermalink", })); -export type ListScheduledMessagesError = SlackOpError; -/** Returns a list of scheduled messages. Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_channel` -- The channel passed is invalid - `invalid_cursor` -- Provided cursor is invalid - `invalid_token` -- Token is invalid See https://docs.slack.dev/reference/methods/chat.scheduledMessages.list */ +export type ListScheduledMessagesError = + | InvalidChannel + | InvalidCursor + | InvalidToken + | SlackOpError; +/** Returns a list of scheduled messages. Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_channel` -- The channel passed is invalid - `invalid_cursor` -- Provided cursor is invalid - `invalid_token` -- Token is invalid See https://docs.slack.dev/reference/methods/chat.scheduledMessages.list */ export const listScheduledMessages: API.PaginatedOperationMethod< ListScheduledMessagesRequest, ListScheduledMessagesResponse, @@ -520,9 +2043,9 @@ export const listScheduledMessages: API.PaginatedOperationMethod< ListScheduledMessagesResponseScheduledMessagesItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(176, __c11, 0) as any as S.Schema, - output: __S(180, __c11, 4) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(128, __c8, 0) as any as S.Schema, + output: __S(132, __c8, 4) as any as S.Schema, + errors: [InvalidChannel, InvalidCursor, InvalidToken, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -538,119 +2061,541 @@ export const listScheduledMessages: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type MeMessageError = SlackOpError; -/** Share a me message into a channel. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `msg_too_long` -- Message text is too long - `no_text` -- No message text provided - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information See https://docs.slack.dev/reference/methods/chat.meMessage */ +export type MeMessageError = + | ChannelNotFound + | IsArchived + | MsgTooLong + | NoText + | NotInChannel + | SlackOpError; +/** Share a me message into a channel. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `msg_too_long` -- Message text is too long - `no_text` -- No message text provided - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information See https://docs.slack.dev/reference/methods/chat.meMessage */ export const meMessage: API.OperationMethod< MeMessageRequest, MeMessageResponse, MeMessageError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(192, __c12, 0) as any as S.Schema, - output: __S(193, __c12, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(144, __c9, 0) as any as S.Schema, + output: __S(145, __c9, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + IsArchived, + MsgTooLong, + NoText, + NotInChannel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "MeMessage", })); -export type PostEphemeralError = SlackOpError; -/** Sends an ephemeral message to a user in a channel. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `invalid_blocks` -- Blocks submitted with this message are not valid - `invalid_blocks_format` -- The `blocks` is not a valid JSON object or doesn't match the Block Kit syntax. - `is_archived` -- Channel has been archived. - `markdown_text_conflict` -- Markdown text cannot be used in conjunction with `blocks` or `text` argument. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces - `messages_tab_disabled` -- Messages tab for the app is disabled. - `msg_too_long` -- Message text is too long - `no_text` -- No message text provided - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `user_not_in_channel` -- Intended recipient is not in the specified channel. - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `invalid_attachments` -- Attachments that contain blocks are not valid - `cannot_reply_to_message` -- This message type cannot have thread replies. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. See https://docs.slack.dev/reference/methods/chat.postEphemeral */ +export type PostEphemeralError = + | CannotReplyToMessage + | ChannelNotFound + | InvalidAttachments + | InvalidBlocks + | InvalidBlocksFormat + | IsArchived + | MarkdownTextConflict + | MessageLimitExceeded + | MessagesTabDisabled + | MsgTooLong + | NoText + | NotInChannel + | RestrictedAction + | RestrictedActionReadOnlyChannel + | TooManyAttachments + | UserNotInChannel + | SlackOpError; +/** Sends an ephemeral message to a user in a channel. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `invalid_blocks` -- Blocks submitted with this message are not valid - `invalid_blocks_format` -- The `blocks` is not a valid JSON object or doesn't match the Block Kit syntax. - `is_archived` -- Channel has been archived. - `markdown_text_conflict` -- Markdown text cannot be used in conjunction with `blocks` or `text` argument. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces - `messages_tab_disabled` -- Messages tab for the app is disabled. - `msg_too_long` -- Message text is too long - `no_text` -- No message text provided - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `user_not_in_channel` -- Intended recipient is not in the specified channel. - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `invalid_attachments` -- Attachments that contain blocks are not valid - `cannot_reply_to_message` -- This message type cannot have thread replies. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. See https://docs.slack.dev/reference/methods/chat.postEphemeral */ export const postEphemeral: API.OperationMethod< PostEphemeralRequest, PostEphemeralResponse, PostEphemeralError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(210, __c13, 2) as any as S.Schema, - output: __S(211, __c13, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(162, __c10, 2) as any as S.Schema, + output: __S(163, __c10, 3) as any as S.Schema, + errors: [ + CannotReplyToMessage, + ChannelNotFound, + InvalidAttachments, + InvalidBlocks, + InvalidBlocksFormat, + IsArchived, + MarkdownTextConflict, + MessageLimitExceeded, + MessagesTabDisabled, + MsgTooLong, + NoText, + NotInChannel, + RestrictedAction, + RestrictedActionReadOnlyChannel, + TooManyAttachments, + UserNotInChannel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PostEphemeral", })); -export type PostMessageError = SlackOpError; -/** Sends a message to a channel. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `agent_prompt_display_not_allowed` -- `client_context.agent_prompt_display` may only be set by the Slack client when posting to the user's Slackbot DM. - `app_access_restricted` -- The user does not have permission to use this app. - `as_user_not_supported` -- The `as_user` parameter does not function with workspace apps. - `channel_not_found` -- Value passed for `channel` was invalid. - `draft_already_deleted` -- The draft has already been deleted. - `draft_already_sent` -- The draft has already been sent. - `draft_has_conflict` -- The client draft version is out of sync with the server draft version. - `draft_not_found` -- The draft was not found. - `duplicate_channel_not_found` -- Channel associated with `client_msg_id` was invalid. - `duplicate_message_not_found` -- No duplicate message exists associated with `client_msg_id`. - `ekm_access_denied` -- Your message couldn't be sent because your admins have disabled sending messages to this channel. - `invalid_blocks` -- Blocks submitted with this message are not valid. - `invalid_blocks_format` -- The `blocks` is not a valid JSON object or doesn't match the Block Kit syntax. - `invalid_metadata_format` -- Invalid metadata format provided. - `invalid_metadata_schema` -- Invalid metadata schema provided. - `is_archived` -- Channel has been archived. - `markdown_text_conflict` -- Markdown text cannot be used in conjunction with `blocks` or `text` argument. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces. - `messages_tab_disabled` -- Messages tab for the app is disabled. - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token. - `metadata_too_large` -- Metadata exceeds size limit. - `msg_blocks_too_long` -- Blocks submitted with this message are too long. - `no_text` -- No message text provided. - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information. - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. - `restricted_action_thread_locked` -- Cannot post replies to a thread that has been locked by admins. - `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. - `send_on_behalf_not_allowed` -- Cannot send on behalf of the provided user. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled Canvas File sharing in all Slack Connect communications. - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications. - `slack_connect_lists_sharing_blocked` -- Admin has disabled Lists sharing in all Slack Connect communications. - `team_not_found` -- This error occurs if, when using an org-wide token, the `channel_name` is passed instead of the `channel_id`. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `too_many_contact_cards` -- Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message. - `cannot_reply_to_message` -- This message type cannot have thread replies. - `missing_file_data` -- Attempted to share a file but some required data was missing. - `attachment_payload_limit_exceeded` -- Attachment payload size is too long. - `posting_to_channel_denied` -- Files and images, including attachments with `image_url` or `thumb_url` and `image` blocks (such as GIFs), can't be posted to this channel. Remove them and try again. See https://docs.slack.dev/reference/methods/chat.postMessage */ +export type PostMessageError = + | AgentPromptDisplayNotAllowed + | AppAccessRestricted + | AsUserNotSupported + | AttachmentPayloadLimitExceeded + | CannotReplyToMessage + | ChannelNotFound + | DraftAlreadyDeleted + | DraftAlreadySent + | DraftHasConflict + | DraftNotFound + | DuplicateChannelNotFound + | DuplicateMessageNotFound + | EkmAccessDenied + | InvalidBlocks + | InvalidBlocksFormat + | InvalidMetadataFormat + | InvalidMetadataSchema + | IsArchived + | MarkdownTextConflict + | MessageLimitExceeded + | MessagesTabDisabled + | MetadataMustBeSentFromApp + | MetadataTooLarge + | MissingFileData + | MsgBlocksTooLong + | NoText + | NotInChannel + | PostingToChannelDenied + | RestrictedAction + | RestrictedActionNonThreadableChannel + | RestrictedActionReadOnlyChannel + | RestrictedActionThreadLocked + | RestrictedActionThreadOnlyChannel + | SendOnBehalfNotAllowed + | SlackConnectCanvasSharingBlocked + | SlackConnectFileLinkSharingBlocked + | SlackConnectListsSharingBlocked + | TeamNotFound + | TooManyAttachments + | TooManyContactCards + | SlackOpError; +/** Sends a message to a channel. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 5 Method-specific errors (each a typed error named after its slug): - `agent_prompt_display_not_allowed` -- `client_context.agent_prompt_display` may only be set by the Slack client when posting to the user's Slackbot DM. - `app_access_restricted` -- The user does not have permission to use this app. - `as_user_not_supported` -- The `as_user` parameter does not function with workspace apps. - `channel_not_found` -- Value passed for `channel` was invalid. - `draft_already_deleted` -- The draft has already been deleted. - `draft_already_sent` -- The draft has already been sent. - `draft_has_conflict` -- The client draft version is out of sync with the server draft version. - `draft_not_found` -- The draft was not found. - `duplicate_channel_not_found` -- Channel associated with `client_msg_id` was invalid. - `duplicate_message_not_found` -- No duplicate message exists associated with `client_msg_id`. - `ekm_access_denied` -- Your message couldn't be sent because your admins have disabled sending messages to this channel. - `invalid_blocks` -- Blocks submitted with this message are not valid. - `invalid_blocks_format` -- The `blocks` is not a valid JSON object or doesn't match the Block Kit syntax. - `invalid_metadata_format` -- Invalid metadata format provided. - `invalid_metadata_schema` -- Invalid metadata schema provided. - `is_archived` -- Channel has been archived. - `markdown_text_conflict` -- Markdown text cannot be used in conjunction with `blocks` or `text` argument. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces. - `messages_tab_disabled` -- Messages tab for the app is disabled. - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token. - `metadata_too_large` -- Metadata exceeds size limit. - `msg_blocks_too_long` -- Blocks submitted with this message are too long. - `no_text` -- No message text provided. - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information. - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. - `restricted_action_thread_locked` -- Cannot post replies to a thread that has been locked by admins. - `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. - `send_on_behalf_not_allowed` -- Cannot send on behalf of the provided user. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled Canvas File sharing in all Slack Connect communications. - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications. - `slack_connect_lists_sharing_blocked` -- Admin has disabled Lists sharing in all Slack Connect communications. - `team_not_found` -- This error occurs if, when using an org-wide token, the `channel_name` is passed instead of the `channel_id`. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `too_many_contact_cards` -- Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message. - `cannot_reply_to_message` -- This message type cannot have thread replies. - `missing_file_data` -- Attempted to share a file but some required data was missing. - `attachment_payload_limit_exceeded` -- Attachment payload size is too long. - `posting_to_channel_denied` -- Files and images, including attachments with `image_url` or `thumb_url` and `image` blocks (such as GIFs), can't be posted to this channel. Remove them and try again. See https://docs.slack.dev/reference/methods/chat.postMessage */ export const postMessage: API.OperationMethod< PostMessageRequest, PostMessageResponse, PostMessageError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(226, __c14, 2) as any as S.Schema, - output: __S(227, __c14, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(178, __c11, 2) as any as S.Schema, + output: __S(179, __c11, 3) as any as S.Schema, + errors: [ + AgentPromptDisplayNotAllowed, + AppAccessRestricted, + AsUserNotSupported, + AttachmentPayloadLimitExceeded, + CannotReplyToMessage, + ChannelNotFound, + DraftAlreadyDeleted, + DraftAlreadySent, + DraftHasConflict, + DraftNotFound, + DuplicateChannelNotFound, + DuplicateMessageNotFound, + EkmAccessDenied, + InvalidBlocks, + InvalidBlocksFormat, + InvalidMetadataFormat, + InvalidMetadataSchema, + IsArchived, + MarkdownTextConflict, + MessageLimitExceeded, + MessagesTabDisabled, + MetadataMustBeSentFromApp, + MetadataTooLarge, + MissingFileData, + MsgBlocksTooLong, + NoText, + NotInChannel, + PostingToChannelDenied, + RestrictedAction, + RestrictedActionNonThreadableChannel, + RestrictedActionReadOnlyChannel, + RestrictedActionThreadLocked, + RestrictedActionThreadOnlyChannel, + SendOnBehalfNotAllowed, + SlackConnectCanvasSharingBlocked, + SlackConnectFileLinkSharingBlocked, + SlackConnectListsSharingBlocked, + TeamNotFound, + TooManyAttachments, + TooManyContactCards, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PostMessage", })); -export type ScheduleMessageError = SlackOpError; -/** Schedules a message to be sent to a channel. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `invalid_blocks` -- Blocks submitted with this message are not valid - `invalid_blocks_format` -- The `blocks` is not a valid JSON object or doesn't match the Block Kit syntax. - `invalid_metadata_format` -- Invalid metadata format provided - `invalid_metadata_schema` -- Invalid metadata schema provided - `invalid_time` -- value passed for `post_time` was invalid. - `markdown_text_conflict` -- Markdown text cannot be used in conjunction with `blocks` or `text` argument. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token - `metadata_too_large` -- Metadata exceeds size limit - `msg_too_long` -- Message text is too long - `no_text` -- No message text provided - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. - `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. - `restricted_too_many` -- Too many messages were scheduled in the channel for a given period. See [usage info](/reference/methods/chat.scheduleMessage#restrictions) for additional details - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications - `time_in_past` -- value passed for `post_time` was in the past. - `time_too_far` -- value passed for `post_time` was too far into the future. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `invalid_token` -- The passed token is invalid or not supported by this method. - `posting_to_channel_denied` -- Files and images, including attachments with `image_url` or `thumb_url` and `image` blocks (such as GIFs), can't be posted to this channel. Remove them and try again. See https://docs.slack.dev/reference/methods/chat.scheduleMessage */ +export type ScheduleMessageError = + | ChannelNotFound + | InvalidBlocks + | InvalidBlocksFormat + | InvalidMetadataFormat + | InvalidMetadataSchema + | InvalidTime + | InvalidToken + | IsArchived + | MarkdownTextConflict + | MessageLimitExceeded + | MetadataMustBeSentFromApp + | MetadataTooLarge + | MsgTooLong + | NoText + | NotInChannel + | PostingToChannelDenied + | RestrictedAction + | RestrictedActionNonThreadableChannel + | RestrictedActionReadOnlyChannel + | RestrictedActionThreadOnlyChannel + | RestrictedTooMany + | SlackConnectFileLinkSharingBlocked + | TimeInPast + | TimeTooFar + | TooManyAttachments + | SlackOpError; +/** Schedules a message to be sent to a channel. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `invalid_blocks` -- Blocks submitted with this message are not valid - `invalid_blocks_format` -- The `blocks` is not a valid JSON object or doesn't match the Block Kit syntax. - `invalid_metadata_format` -- Invalid metadata format provided - `invalid_metadata_schema` -- Invalid metadata schema provided - `invalid_time` -- value passed for `post_time` was invalid. - `markdown_text_conflict` -- Markdown text cannot be used in conjunction with `blocks` or `text` argument. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token - `metadata_too_large` -- Metadata exceeds size limit - `msg_too_long` -- Message text is too long - `no_text` -- No message text provided - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. - `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. - `restricted_too_many` -- Too many messages were scheduled in the channel for a given period. See [usage info](/reference/methods/chat.scheduleMessage#restrictions) for additional details - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications - `time_in_past` -- value passed for `post_time` was in the past. - `time_too_far` -- value passed for `post_time` was too far into the future. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `invalid_token` -- The passed token is invalid or not supported by this method. - `posting_to_channel_denied` -- Files and images, including attachments with `image_url` or `thumb_url` and `image` blocks (such as GIFs), can't be posted to this channel. Remove them and try again. See https://docs.slack.dev/reference/methods/chat.scheduleMessage */ export const scheduleMessage: API.OperationMethod< ScheduleMessageRequest, ScheduleMessageResponse, ScheduleMessageError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(242, __c15, 2) as any as S.Schema, - output: __S(243, __c15, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(194, __c12, 2) as any as S.Schema, + output: __S(195, __c12, 3) as any as S.Schema, + errors: [ + ChannelNotFound, + InvalidBlocks, + InvalidBlocksFormat, + InvalidMetadataFormat, + InvalidMetadataSchema, + InvalidTime, + InvalidToken, + IsArchived, + MarkdownTextConflict, + MessageLimitExceeded, + MetadataMustBeSentFromApp, + MetadataTooLarge, + MsgTooLong, + NoText, + NotInChannel, + PostingToChannelDenied, + RestrictedAction, + RestrictedActionNonThreadableChannel, + RestrictedActionReadOnlyChannel, + RestrictedActionThreadOnlyChannel, + RestrictedTooMany, + SlackConnectFileLinkSharingBlocked, + TimeInPast, + TimeTooFar, + TooManyAttachments, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ScheduleMessage", })); -export type StartStreamError = SlackOpError; -/** Starts a new streaming conversation. Required scopes -- bot: `chat:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `messaging_processing_failed` -- Failed to process the message. - `channel_not_found` -- Value passed for `channel` was invalid. - `duplicate_channel_not_found` -- Channel associated with `client_msg_id` was invalid. - `duplicate_message_not_found` -- No duplicate message exists associated with `client_msg_id`. - `ekm_access_denied` -- Your message couldn't be sent because your admins have disabled sending messages to this channel. - `invalid_blocks` -- Blocks submitted with this message are not valid - `invalid_chunks` -- Chunks submitted with this message are not valid. - `invalid_blocks_format` -- The `blocks` is not a valid JSON object or doesn't match the Block Kit syntax. - `invalid_metadata_format` -- Invalid metadata format provided - `invalid_metadata_schema` -- Invalid metadata schema provided - `is_archived` -- Channel has been archived. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces - `messages_tab_disabled` -- Messages tab for the app is disabled. - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token - `metadata_too_large` -- Metadata exceeds size limit - `msg_blocks_too_long` -- Blocks submitted with this message are too long. - `msg_blocks_too_many` -- Max blocks exceeded, blocks are limited to 50 per message. - `no_text` -- No message text provided - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. - `restricted_action_thread_locked` -- Cannot post replies to a thread that has been locked by admins. - `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled Canvas File sharing in all Slack Connect communications - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications - `slack_connect_lists_sharing_blocked` -- Admin has disabled Lists sharing in all Slack Connect communications - `team_not_found` -- This error occurs if, when using an org-wide token, the `channel_name` is passed instead of the `channel_id`. - `channel_type_not_supported` -- Channel type not supported - `user_not_found` -- User not found. - `missing_recipient_team_id` -- Missing recipient team ID. - `missing_recipient_user_id` -- Missing recipient user ID. - `cannot_provide_both_markdown_text_and_chunks` -- Cannot provide both `markdown_text` and `chunks` in the same request. - `cannot_reply_to_message` -- This message type cannot have thread replies. See https://docs.slack.dev/reference/methods/chat.startStream */ +export type StartStreamError = + | CannotProvideBothMarkdownTextAndChunks + | CannotReplyToMessage + | ChannelNotFound + | ChannelTypeNotSupported + | DuplicateChannelNotFound + | DuplicateMessageNotFound + | EkmAccessDenied + | InvalidBlocks + | InvalidBlocksFormat + | InvalidChunks + | InvalidMetadataFormat + | InvalidMetadataSchema + | IsArchived + | MessageLimitExceeded + | MessagesTabDisabled + | MessagingProcessingFailed + | MetadataMustBeSentFromApp + | MetadataTooLarge + | MissingRecipientTeamId + | MissingRecipientUserId + | MsgBlocksTooLong + | MsgBlocksTooMany + | NoText + | NotInChannel + | RestrictedAction + | RestrictedActionNonThreadableChannel + | RestrictedActionReadOnlyChannel + | RestrictedActionThreadLocked + | RestrictedActionThreadOnlyChannel + | SlackConnectCanvasSharingBlocked + | SlackConnectFileLinkSharingBlocked + | SlackConnectListsSharingBlocked + | TeamNotFound + | UserNotFound + | SlackOpError; +/** Starts a new streaming conversation. Required scopes -- bot: `chat:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `messaging_processing_failed` -- Failed to process the message. - `channel_not_found` -- Value passed for `channel` was invalid. - `duplicate_channel_not_found` -- Channel associated with `client_msg_id` was invalid. - `duplicate_message_not_found` -- No duplicate message exists associated with `client_msg_id`. - `ekm_access_denied` -- Your message couldn't be sent because your admins have disabled sending messages to this channel. - `invalid_blocks` -- Blocks submitted with this message are not valid - `invalid_chunks` -- Chunks submitted with this message are not valid. - `invalid_blocks_format` -- The `blocks` is not a valid JSON object or doesn't match the Block Kit syntax. - `invalid_metadata_format` -- Invalid metadata format provided - `invalid_metadata_schema` -- Invalid metadata schema provided - `is_archived` -- Channel has been archived. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces - `messages_tab_disabled` -- Messages tab for the app is disabled. - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token - `metadata_too_large` -- Metadata exceeds size limit - `msg_blocks_too_long` -- Blocks submitted with this message are too long. - `msg_blocks_too_many` -- Max blocks exceeded, blocks are limited to 50 per message. - `no_text` -- No message text provided - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. - `restricted_action_thread_locked` -- Cannot post replies to a thread that has been locked by admins. - `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled Canvas File sharing in all Slack Connect communications - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications - `slack_connect_lists_sharing_blocked` -- Admin has disabled Lists sharing in all Slack Connect communications - `team_not_found` -- This error occurs if, when using an org-wide token, the `channel_name` is passed instead of the `channel_id`. - `channel_type_not_supported` -- Channel type not supported - `user_not_found` -- User not found. - `missing_recipient_team_id` -- Missing recipient team ID. - `missing_recipient_user_id` -- Missing recipient user ID. - `cannot_provide_both_markdown_text_and_chunks` -- Cannot provide both `markdown_text` and `chunks` in the same request. - `cannot_reply_to_message` -- This message type cannot have thread replies. See https://docs.slack.dev/reference/methods/chat.startStream */ export const startStream: API.OperationMethod< StartStreamRequest, StartStreamResponse, StartStreamError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(80, __c5, 0) as any as S.Schema, - output: __S(32, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(224, __c14, 0) as any as S.Schema, + output: __S(16, __c1, 0) as any as S.Schema, + errors: [ + CannotProvideBothMarkdownTextAndChunks, + CannotReplyToMessage, + ChannelNotFound, + ChannelTypeNotSupported, + DuplicateChannelNotFound, + DuplicateMessageNotFound, + EkmAccessDenied, + InvalidBlocks, + InvalidBlocksFormat, + InvalidChunks, + InvalidMetadataFormat, + InvalidMetadataSchema, + IsArchived, + MessageLimitExceeded, + MessagesTabDisabled, + MessagingProcessingFailed, + MetadataMustBeSentFromApp, + MetadataTooLarge, + MissingRecipientTeamId, + MissingRecipientUserId, + MsgBlocksTooLong, + MsgBlocksTooMany, + NoText, + NotInChannel, + RestrictedAction, + RestrictedActionNonThreadableChannel, + RestrictedActionReadOnlyChannel, + RestrictedActionThreadLocked, + RestrictedActionThreadOnlyChannel, + SlackConnectCanvasSharingBlocked, + SlackConnectFileLinkSharingBlocked, + SlackConnectListsSharingBlocked, + TeamNotFound, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "StartStream", })); -export type StopStreamError = SlackOpError; -/** Stops a streaming conversation. Required scopes -- bot: `chat:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `message_not_found` -- The message was not found. - `message_not_in_streaming_state` -- The message is not in a streaming state. - `as_user_not_supported` -- The `as_user` parameter does not function with workspace apps. - `channel_not_found` -- Value passed for `channel` was invalid. - `channel_type_not_supported` -- Channel type not supported. - `duplicate_channel_not_found` -- Channel associated with `client_msg_id` was invalid. - `duplicate_message_not_found` -- No duplicate message exists associated with `client_msg_id`. - `ekm_access_denied` -- Your message couldn't be sent because your admins have disabled sending messages to this channel. - `invalid_blocks` -- Blocks submitted with this message are not valid. - `invalid_chunks` -- Chunks submitted with this message are not valid. - `invalid_metadata_format` -- Invalid metadata format provided - `invalid_metadata_schema` -- Invalid metadata schema provided - `is_archived` -- Channel has been archived. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces - `message_not_owned_by_app` -- The message is not owned by the app. - `messages_tab_disabled` -- Messages tab for the app is disabled. - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token - `metadata_too_large` -- Metadata exceeds size limit - `msg_blocks_too_long` -- Blocks submitted with this message are too long. - `msg_blocks_too_many` -- Max blocks exceeded, blocks are limited to 50 per message. - `no_text` -- No message text provided - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. - `restricted_action_thread_locked` -- Cannot post replies to a thread that has been locked by admins. - `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled Canvas File sharing in all Slack Connect communications - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications - `slack_connect_lists_sharing_blocked` -- Admin has disabled Lists sharing in all Slack Connect communications - `team_not_found` -- This error occurs if, when using an org-wide token, the `channel_name` is passed instead of the `channel_id`. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `too_many_contact_cards` -- Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message. - `cannot_reply_to_message` -- This message type cannot have thread replies. - `missing_file_data` -- Attempted to share a file but some required data was missing. - `attachment_payload_limit_exceeded` -- Attachment payload size is too long. - `cannot_provide_both_markdown_text_and_chunks` -- Cannot provide both `markdown_text` and `chunks` in the same request. - `streaming_mode_mismatch` -- The streaming mode must be the same as the streaming mode used to start the stream. If you started the stream with `markdown_text`, you must append with `markdown_text`. If you started the stream with `chunks`, you must append with `chunks`. See https://docs.slack.dev/reference/methods/chat.stopStream */ +export type StopStreamError = + | AsUserNotSupported + | AttachmentPayloadLimitExceeded + | CannotProvideBothMarkdownTextAndChunks + | CannotReplyToMessage + | ChannelNotFound + | ChannelTypeNotSupported + | DuplicateChannelNotFound + | DuplicateMessageNotFound + | EkmAccessDenied + | InvalidBlocks + | InvalidChunks + | InvalidMetadataFormat + | InvalidMetadataSchema + | IsArchived + | MessageLimitExceeded + | MessageNotFound + | MessageNotInStreamingState + | MessageNotOwnedByApp + | MessagesTabDisabled + | MetadataMustBeSentFromApp + | MetadataTooLarge + | MissingFileData + | MsgBlocksTooLong + | MsgBlocksTooMany + | NoText + | NotInChannel + | RestrictedAction + | RestrictedActionNonThreadableChannel + | RestrictedActionReadOnlyChannel + | RestrictedActionThreadLocked + | RestrictedActionThreadOnlyChannel + | SlackConnectCanvasSharingBlocked + | SlackConnectFileLinkSharingBlocked + | SlackConnectListsSharingBlocked + | StreamingModeMismatch + | TeamNotFound + | TooManyAttachments + | TooManyContactCards + | SlackOpError; +/** Stops a streaming conversation. Required scopes -- bot: `chat:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `message_not_found` -- The message was not found. - `message_not_in_streaming_state` -- The message is not in a streaming state. - `as_user_not_supported` -- The `as_user` parameter does not function with workspace apps. - `channel_not_found` -- Value passed for `channel` was invalid. - `channel_type_not_supported` -- Channel type not supported. - `duplicate_channel_not_found` -- Channel associated with `client_msg_id` was invalid. - `duplicate_message_not_found` -- No duplicate message exists associated with `client_msg_id`. - `ekm_access_denied` -- Your message couldn't be sent because your admins have disabled sending messages to this channel. - `invalid_blocks` -- Blocks submitted with this message are not valid. - `invalid_chunks` -- Chunks submitted with this message are not valid. - `invalid_metadata_format` -- Invalid metadata format provided - `invalid_metadata_schema` -- Invalid metadata schema provided - `is_archived` -- Channel has been archived. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces - `message_not_owned_by_app` -- The message is not owned by the app. - `messages_tab_disabled` -- Messages tab for the app is disabled. - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token - `metadata_too_large` -- Metadata exceeds size limit - `msg_blocks_too_long` -- Blocks submitted with this message are too long. - `msg_blocks_too_many` -- Max blocks exceeded, blocks are limited to 50 per message. - `no_text` -- No message text provided - `not_in_channel` -- Cannot post user messages to a channel they are not in. - `rate_limited` -- Application has posted too many messages, [read the Rate Limit documentation](/apis/web-api/rate-limits) for more information - `restricted_action` -- A workspace preference prevents the authenticated user from posting. - `restricted_action_non_threadable_channel` -- Cannot post thread replies into a non_threadable channel. - `restricted_action_read_only_channel` -- Cannot post any message into a read-only channel. - `restricted_action_thread_locked` -- Cannot post replies to a thread that has been locked by admins. - `restricted_action_thread_only_channel` -- Cannot post top-level messages into a thread-only channel. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled Canvas File sharing in all Slack Connect communications - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack File sharing in all Slack Connect communications - `slack_connect_lists_sharing_blocked` -- Admin has disabled Lists sharing in all Slack Connect communications - `team_not_found` -- This error occurs if, when using an org-wide token, the `channel_name` is passed instead of the `channel_id`. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `too_many_contact_cards` -- Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message. - `cannot_reply_to_message` -- This message type cannot have thread replies. - `missing_file_data` -- Attempted to share a file but some required data was missing. - `attachment_payload_limit_exceeded` -- Attachment payload size is too long. - `cannot_provide_both_markdown_text_and_chunks` -- Cannot provide both `markdown_text` and `chunks` in the same request. - `streaming_mode_mismatch` -- The streaming mode must be the same as the streaming mode used to start the stream. If you started the stream with `markdown_text`, you must append with `markdown_text`. If you started the stream with `chunks`, you must append with `chunks`. See https://docs.slack.dev/reference/methods/chat.stopStream */ export const stopStream: API.OperationMethod< StopStreamRequest, StopStreamResponse, StopStreamError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(96, __c6, 0) as any as S.Schema, - output: __S(97, __c6, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(240, __c15, 0) as any as S.Schema, + output: __S(241, __c15, 1) as any as S.Schema, + errors: [ + AsUserNotSupported, + AttachmentPayloadLimitExceeded, + CannotProvideBothMarkdownTextAndChunks, + CannotReplyToMessage, + ChannelNotFound, + ChannelTypeNotSupported, + DuplicateChannelNotFound, + DuplicateMessageNotFound, + EkmAccessDenied, + InvalidBlocks, + InvalidChunks, + InvalidMetadataFormat, + InvalidMetadataSchema, + IsArchived, + MessageLimitExceeded, + MessageNotFound, + MessageNotInStreamingState, + MessageNotOwnedByApp, + MessagesTabDisabled, + MetadataMustBeSentFromApp, + MetadataTooLarge, + MissingFileData, + MsgBlocksTooLong, + MsgBlocksTooMany, + NoText, + NotInChannel, + RestrictedAction, + RestrictedActionNonThreadableChannel, + RestrictedActionReadOnlyChannel, + RestrictedActionThreadLocked, + RestrictedActionThreadOnlyChannel, + SlackConnectCanvasSharingBlocked, + SlackConnectFileLinkSharingBlocked, + SlackConnectListsSharingBlocked, + StreamingModeMismatch, + TeamNotFound, + TooManyAttachments, + TooManyContactCards, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "StopStream", })); -export type UpdateChatError = SlackOpError; -/** Updates a message. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `as_user_not_supported` -- The `as_user` parameter does not function with workspace apps. - `blocked_file_type` -- Admin has disabled uploading this type of file. - `block_mismatch` -- Rich-text blocks cannot be replaced with non-rich-text blocks - `cant_broadcast_message` -- Unable to broadcast this message. - `cant_update_message` -- Authenticated user does not have permission to update this message. - `channel_not_found` -- Value passed for `channel` was invalid. - `edit_window_closed` -- The message cannot be edited due to the team message edit settings - `external_channel_migrating` -- The channel is in the process of migrating and so the message cannot be updated at this time. - `file_deleted` -- File to share deleted. - `file_is_deleted` -- The file is deleted. - `file_not_found` -- One or more of the provided file IDs could not be found. - `file_share_limit_reached` -- The file has reached the share limit. - `invalid_attachments` -- The attachments were invalid. - `invalid_blocks` -- The blocks were invalid for the requesting user. - `invalid_blocks_format` -- The `blocks` array is not a valid JSON object or doesn't match the Block Kit syntax. - `invalid_metadata_format` -- Invalid metadata format provided - `invalid_metadata_schema` -- Invalid metadata schema provided - `is_inactive` -- The message cannot be edited within a frozen, archived or deleted channel. - `markdown_text_conflict` -- Markdown text cannot be used in conjunction with `blocks` or `text` argument. - `max_file_sharing_exceeded` -- Exceeded max allowed files shared. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces. - `message_not_found` -- No message exists with the requested timestamp. - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token - `metadata_too_large` -- Metadata exceeds size limit - `msg_too_long` -- Message text is too long. The `text` field cannot exceed 4,000 characters. - `no_dual_broadcast_content_update` -- Can't broadcast an old reply and update the content at the same time. - `no_text` -- No message text provided - `posting_to_channel_denied` -- Files and images, including attachments with `image_url` or `thumb_url` and `image` blocks (such as GIFs), can't be added to messages in this channel. Remove them and try again. - `slack_connect_blocked_file_type` -- Files with certain extensions are blocked from being uploaded in all Slack Connect messages. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled sharing of canvas links in all Slack Connect messages. - `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip uploads in Slack Connect channels. - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack file sharing in all Slack Connect messages. - `slack_connect_file_upload_sharing_blocked` -- Admin has disabled file uploads in all Slack Connect messages. - `streaming_state_conflict` -- The message is currently streaming text and cannot be edited. - `team_not_found` -- Team associated with the message and channel could not be found. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `unable_to_share_files` -- Sharing the files failed. - `update_failed` -- Internal update failure. - `invalid_channel_id` -- Value passed for `channel` was not a valid channel ID. See https://docs.slack.dev/reference/methods/chat.update */ +export type UpdateChatError = + | AsUserNotSupported + | BlockMismatch + | BlockedFileType + | CantBroadcastMessage + | CantUpdateMessage + | ChannelNotFound + | EditWindowClosed + | ExternalChannelMigrating + | FileDeleted + | FileIsDeleted + | FileNotFound + | FileShareLimitReached + | InvalidAttachments + | InvalidBlocks + | InvalidBlocksFormat + | InvalidChannelId + | InvalidMetadataFormat + | InvalidMetadataSchema + | IsInactive + | MarkdownTextConflict + | MaxFileSharingExceeded + | MessageLimitExceeded + | MessageNotFound + | MetadataMustBeSentFromApp + | MetadataTooLarge + | MsgTooLong + | NoDualBroadcastContentUpdate + | NoText + | PostingToChannelDenied + | SlackConnectBlockedFileType + | SlackConnectCanvasSharingBlocked + | SlackConnectClipSharingBlocked + | SlackConnectFileLinkSharingBlocked + | SlackConnectFileUploadSharingBlocked + | StreamingStateConflict + | TeamNotFound + | TooManyAttachments + | UnableToShareFiles + | UpdateFailed + | SlackOpError; +/** Updates a message. Required scopes -- bot: `chat:write`; user: `chat:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `as_user_not_supported` -- The `as_user` parameter does not function with workspace apps. - `blocked_file_type` -- Admin has disabled uploading this type of file. - `block_mismatch` -- Rich-text blocks cannot be replaced with non-rich-text blocks - `cant_broadcast_message` -- Unable to broadcast this message. - `cant_update_message` -- Authenticated user does not have permission to update this message. - `channel_not_found` -- Value passed for `channel` was invalid. - `edit_window_closed` -- The message cannot be edited due to the team message edit settings - `external_channel_migrating` -- The channel is in the process of migrating and so the message cannot be updated at this time. - `file_deleted` -- File to share deleted. - `file_is_deleted` -- The file is deleted. - `file_not_found` -- One or more of the provided file IDs could not be found. - `file_share_limit_reached` -- The file has reached the share limit. - `invalid_attachments` -- The attachments were invalid. - `invalid_blocks` -- The blocks were invalid for the requesting user. - `invalid_blocks_format` -- The `blocks` array is not a valid JSON object or doesn't match the Block Kit syntax. - `invalid_metadata_format` -- Invalid metadata format provided - `invalid_metadata_schema` -- Invalid metadata schema provided - `is_inactive` -- The message cannot be edited within a frozen, archived or deleted channel. - `markdown_text_conflict` -- Markdown text cannot be used in conjunction with `blocks` or `text` argument. - `max_file_sharing_exceeded` -- Exceeded max allowed files shared. - `message_limit_exceeded` -- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces. - `message_not_found` -- No message exists with the requested timestamp. - `metadata_must_be_sent_from_app` -- Message metadata can only be posted or updated using an app-level token - `metadata_too_large` -- Metadata exceeds size limit - `msg_too_long` -- Message text is too long. The `text` field cannot exceed 4,000 characters. - `no_dual_broadcast_content_update` -- Can't broadcast an old reply and update the content at the same time. - `no_text` -- No message text provided - `posting_to_channel_denied` -- Files and images, including attachments with `image_url` or `thumb_url` and `image` blocks (such as GIFs), can't be added to messages in this channel. Remove them and try again. - `slack_connect_blocked_file_type` -- Files with certain extensions are blocked from being uploaded in all Slack Connect messages. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled sharing of canvas links in all Slack Connect messages. - `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip uploads in Slack Connect channels. - `slack_connect_file_link_sharing_blocked` -- Admin has disabled Slack file sharing in all Slack Connect messages. - `slack_connect_file_upload_sharing_blocked` -- Admin has disabled file uploads in all Slack Connect messages. - `streaming_state_conflict` -- The message is currently streaming text and cannot be edited. - `team_not_found` -- Team associated with the message and channel could not be found. - `too_many_attachments` -- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message. - `unable_to_share_files` -- Sharing the files failed. - `update_failed` -- Internal update failure. - `invalid_channel_id` -- Value passed for `channel` was not a valid channel ID. See https://docs.slack.dev/reference/methods/chat.update */ export const updateChat: API.OperationMethod< UpdateChatRequest, UpdateChatResponse, UpdateChatError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(118, __c7, 6) as any as S.Schema, - output: __S(120, __c7, 8) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(262, __c16, 6) as any as S.Schema, + output: __S(264, __c16, 8) as any as S.Schema, + errors: [ + AsUserNotSupported, + BlockMismatch, + BlockedFileType, + CantBroadcastMessage, + CantUpdateMessage, + ChannelNotFound, + EditWindowClosed, + ExternalChannelMigrating, + FileDeleted, + FileIsDeleted, + FileNotFound, + FileShareLimitReached, + InvalidAttachments, + InvalidBlocks, + InvalidBlocksFormat, + InvalidChannelId, + InvalidMetadataFormat, + InvalidMetadataSchema, + IsInactive, + MarkdownTextConflict, + MaxFileSharingExceeded, + MessageLimitExceeded, + MessageNotFound, + MetadataMustBeSentFromApp, + MetadataTooLarge, + MsgTooLong, + NoDualBroadcastContentUpdate, + NoText, + PostingToChannelDenied, + SlackConnectBlockedFileType, + SlackConnectCanvasSharingBlocked, + SlackConnectClipSharingBlocked, + SlackConnectFileLinkSharingBlocked, + SlackConnectFileUploadSharingBlocked, + StreamingStateConflict, + TeamNotFound, + TooManyAttachments, + UnableToShareFiles, + UpdateFailed, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -664,7 +2609,7 @@ function __c0(j: number): any { return S.suspend(() => S.Struct({ channel: S.String, - chunks: S.optional(__S(16, __c1, 0)), + chunks: S.optional(__S(32, __c2, 0)), ts: S.String, markdown_text: S.optional(S.String), }).pipe(T.Http({ method: "POST", uri: "/chat.appendStream", code: 200 })), @@ -672,12 +2617,6 @@ function __c0(j: number): any { } } function __c1(j: number): any { - switch (j) { - case 0: - return S.Array(S.Unknown); - } -} -function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -689,6 +2628,12 @@ function __c2(j: number): any { ).annotate({ identifier: "AppendStreamResponse" }); } } +function __c2(j: number): any { + switch (j) { + case 0: + return S.Array(S.Unknown); + } +} function __c3(j: number): any { switch (j) { case 0: @@ -718,103 +2663,6 @@ function __c4(j: number): any { } } function __c5(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channel: S.String, - chunks: S.optional(__S(16, __c1, 0)), - markdown_text: S.optional(S.String), - thread_ts: S.optional(S.String), - recipient_user_id: S.optional(S.String), - recipient_team_id: S.optional(S.String), - task_display_mode: S.optional(S.String), - icon_emoji: S.optional(S.NullOr(S.String)), - icon_url: S.optional(S.NullOr(S.String)), - username: S.optional(S.NullOr(S.String)), - }).pipe(T.Http({ method: "POST", uri: "/chat.startStream", code: 200 })), - ).annotate({ identifier: "StartStreamRequest" }); - } -} -function __c6(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channel: S.String, - chunks: S.optional(S.Unknown), - ts: S.String, - markdown_text: S.optional(S.String), - blocks: S.optional(S.Unknown), - metadata: S.optional(S.NullOr(S.String)), - session_status: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/chat.stopStream", code: 200 })), - ).annotate({ identifier: "StopStreamRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - channel: S.String, - ts: S.String, - message: S.Unknown, - }), - ).annotate({ identifier: "StopStreamResponse" }); - } -} -function __c7(j: number): any { - switch (j) { - case 0: - return S.Array(__S(256, __c16, 0)); - case 1: - return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); - case 2: - return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); - case 3: - return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); - case 4: - return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); - case 5: - return S.Array(S.String); - case 6: - return S.suspend(() => - S.Struct({ - as_user: S.optional(S.NullOr(__S(113, __c7, 1))), - attachments: S.optional(__S(114, __c7, 2)), - unfurled_attachments: S.optional(S.NullOr(S.String)), - blocks: S.optional(__S(115, __c7, 3)), - markdown_text: S.optional(S.String), - metadata: S.optional(S.NullOr(S.String)), - channel: S.String, - link_names: S.optional(S.NullOr(__S(116, __c7, 4))), - parse: S.optional(S.NullOr(S.String)), - text: S.optional(S.NullOr(S.String)), - ts: S.String, - reply_broadcast: S.optional(S.Boolean), - file_ids: S.optional(__S(117, __c7, 5)), - }).pipe(T.Http({ method: "POST", uri: "/chat.update", code: 200 })), - ).annotate({ identifier: "UpdateChatRequest" }); - case 7: - return S.suspend(() => - S.Struct({ - text: S.String, - blocks: S.optional(S.Unknown), - attachments: S.optional(__S(112, __c7, 0)), - metadata: S.optional(__S(256, __c16, 0)), - }), - ).annotate({ identifier: "UpdateChatResponseMessage" }); - case 8: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - channel: S.String, - ts: S.String, - text: S.String, - message: __S(119, __c7, 7), - }), - ).annotate({ identifier: "UpdateChatResponse" }); - } -} -function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -826,7 +2674,7 @@ function __c8(j: number): any { ).annotate({ identifier: "DeleteChatRequest" }); } } -function __c9(j: number): any { +function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -838,7 +2686,7 @@ function __c9(j: number): any { ).annotate({ identifier: "DeleteScheduledMessageRequest" }); } } -function __c10(j: number): any { +function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -857,7 +2705,7 @@ function __c10(j: number): any { ).annotate({ identifier: "GetPermalinkResponse" }); } } -function __c11(j: number): any { +function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -881,7 +2729,7 @@ function __c11(j: number): any { }), ).annotate({ identifier: "ListScheduledMessagesResponseScheduledMessagesItem" }); case 2: - return S.Array(__S(177, __c11, 1)); + return S.Array(__S(129, __c8, 1)); case 3: return S.suspend(() => S.Struct({ @@ -892,13 +2740,13 @@ function __c11(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - scheduled_messages: __S(178, __c11, 2), - response_metadata: S.optional(__S(179, __c11, 3)), + scheduled_messages: __S(130, __c8, 2), + response_metadata: S.optional(__S(131, __c8, 3)), }), ).annotate({ identifier: "ListScheduledMessagesResponse" }); } } -function __c12(j: number): any { +function __c9(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -917,7 +2765,7 @@ function __c12(j: number): any { ).annotate({ identifier: "MeMessageResponse" }); } } -function __c13(j: number): any { +function __c10(j: number): any { switch (j) { case 0: return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); @@ -927,8 +2775,8 @@ function __c13(j: number): any { return S.suspend(() => S.Struct({ as_user: S.optional(S.Boolean), - attachments: S.optional(__S(208, __c13, 0)), - blocks: S.optional(__S(209, __c13, 1)), + attachments: S.optional(__S(160, __c10, 0)), + blocks: S.optional(__S(161, __c10, 1)), channel: S.String, icon_emoji: S.optional(S.String), icon_url: S.optional(S.String), @@ -951,7 +2799,7 @@ function __c13(j: number): any { ).annotate({ identifier: "PostEphemeralResponse" }); } } -function __c14(j: number): any { +function __c11(j: number): any { switch (j) { case 0: return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); @@ -961,8 +2809,8 @@ function __c14(j: number): any { return S.suspend(() => S.Struct({ as_user: S.optional(S.Boolean), - attachments: S.optional(__S(224, __c14, 0)), - blocks: S.optional(__S(225, __c14, 1)), + attachments: S.optional(__S(176, __c11, 0)), + blocks: S.optional(__S(177, __c11, 1)), channel: S.String, current_draft_last_updated_ts: S.optional(S.String), icon_emoji: S.optional(S.NullOr(S.String)), @@ -993,7 +2841,7 @@ function __c14(j: number): any { ).annotate({ identifier: "PostMessageResponse" }); } } -function __c15(j: number): any { +function __c12(j: number): any { switch (j) { case 0: return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); @@ -1003,8 +2851,8 @@ function __c15(j: number): any { return S.suspend(() => S.Struct({ as_user: S.optional(S.Boolean), - attachments: S.optional(__S(240, __c15, 0)), - blocks: S.optional(__S(241, __c15, 1)), + attachments: S.optional(__S(192, __c12, 0)), + blocks: S.optional(__S(193, __c12, 1)), channel: S.String, link_names: S.optional(S.Boolean), markdown_text: S.optional(S.String), @@ -1025,17 +2873,114 @@ function __c15(j: number): any { channel: S.String, post_at: S.Number, scheduled_message_id: S.String, - message: __S(256, __c16, 0), + message: __S(208, __c13, 0), }), ).annotate({ identifier: "ScheduleMessageResponse" }); } } -function __c16(j: number): any { +function __c13(j: number): any { switch (j) { case 0: return S.Record(S.String, S.Unknown); } } +function __c14(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel: S.String, + chunks: S.optional(__S(32, __c2, 0)), + markdown_text: S.optional(S.String), + thread_ts: S.optional(S.String), + recipient_user_id: S.optional(S.String), + recipient_team_id: S.optional(S.String), + task_display_mode: S.optional(S.String), + icon_emoji: S.optional(S.NullOr(S.String)), + icon_url: S.optional(S.NullOr(S.String)), + username: S.optional(S.NullOr(S.String)), + }).pipe(T.Http({ method: "POST", uri: "/chat.startStream", code: 200 })), + ).annotate({ identifier: "StartStreamRequest" }); + } +} +function __c15(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel: S.String, + chunks: S.optional(S.Unknown), + ts: S.String, + markdown_text: S.optional(S.String), + blocks: S.optional(S.Unknown), + metadata: S.optional(S.NullOr(S.String)), + session_status: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/chat.stopStream", code: 200 })), + ).annotate({ identifier: "StopStreamRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + channel: S.String, + ts: S.String, + message: S.Unknown, + }), + ).annotate({ identifier: "StopStreamResponse" }); + } +} +function __c16(j: number): any { + switch (j) { + case 0: + return S.Array(__S(208, __c13, 0)); + case 1: + return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); + case 2: + return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); + case 3: + return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); + case 4: + return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); + case 5: + return S.Array(S.String); + case 6: + return S.suspend(() => + S.Struct({ + as_user: S.optional(S.NullOr(__S(257, __c16, 1))), + attachments: S.optional(__S(258, __c16, 2)), + unfurled_attachments: S.optional(S.NullOr(S.String)), + blocks: S.optional(__S(259, __c16, 3)), + markdown_text: S.optional(S.String), + metadata: S.optional(S.NullOr(S.String)), + channel: S.String, + link_names: S.optional(S.NullOr(__S(260, __c16, 4))), + parse: S.optional(S.NullOr(S.String)), + text: S.optional(S.NullOr(S.String)), + ts: S.String, + reply_broadcast: S.optional(S.Boolean), + file_ids: S.optional(__S(261, __c16, 5)), + }).pipe(T.Http({ method: "POST", uri: "/chat.update", code: 200 })), + ).annotate({ identifier: "UpdateChatRequest" }); + case 7: + return S.suspend(() => + S.Struct({ + text: S.String, + blocks: S.optional(S.Unknown), + attachments: S.optional(__S(256, __c16, 0)), + metadata: S.optional(__S(208, __c13, 0)), + }), + ).annotate({ identifier: "UpdateChatResponseMessage" }); + case 8: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + channel: S.String, + ts: S.String, + text: S.String, + message: __S(263, __c16, 7), + }), + ).annotate({ identifier: "UpdateChatResponse" }); + } +} // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); diff --git a/packages/slack/src/services/conversations.ts b/packages/slack/src/services/conversations.ts index 2c99cca2cc..4cd6bbf20c 100644 --- a/packages/slack/src/services/conversations.ts +++ b/packages/slack/src/services/conversations.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,1532 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `accepter_email_not_verified` -- The accepting user has not verified the email address on their account. They must verify it before accepting. */ +export class AccepterEmailNotVerified + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AccepterEmailNotVerified", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "accepter_email_not_verified" } }], + ) {} + +/** `already_approved` -- This invite was already approved by this team. */ +export class AlreadyApproved + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyApproved", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_approved" } }], + ) {} + +/** `already_archived` -- Channel has already been archived. */ +export class AlreadyArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_archived" } }], + ) {} + +/** `already_in_channel` -- Invited user is already in the channel. */ +export class AlreadyInChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyInChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_in_channel" } }], + ) {} + +/** `app_cannot_join_channel` -- This app cannot be invited to this channel. */ +export class AppCannotJoinChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppCannotJoinChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_cannot_join_channel" } }], + ) {} + +/** `approval_inactive` -- The approval associated with the invite ID is not active. */ +export class ApprovalInactive + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ApprovalInactive", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "approval_inactive" } }], + ) {} + +/** `approval_not_found` -- We could not find an approval associated with the invite ID provided. */ +export class ApprovalNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ApprovalNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "approval_not_found" } }], + ) {} + +/** `cannot_create_channel` -- This channel is unable to be created. */ +export class CannotCreateChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotCreateChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_create_channel" } }], + ) {} + +/** `cannot_share_cross_workspace_channel` -- You cannot share a cross-workspace or org-wide channel. */ +export class CannotShareCrossWorkspaceChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "CannotShareCrossWorkspaceChannel", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "cannot_share_cross_workspace_channel" } }], + ) {} + +/** `cannot_share_mandatory_channel` -- You cannot share #general or mandatory channels. */ +export class CannotShareMandatoryChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotShareMandatoryChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_share_mandatory_channel" } }], + ) {} + +/** `cant_archive_general` -- You cannot archive the general channel */ +export class CantArchiveGeneral + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantArchiveGeneral", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_archive_general" } }], + ) {} + +/** `cant_archive_required` -- You cannot archive a required channel */ +export class CantArchiveRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantArchiveRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_archive_required" } }], + ) {} + +/** `cant_invite` -- User cannot be invited to this channel. */ +export class CantInvite + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantInvite", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_invite" } }], + ) {} + +/** `cant_invite_self` -- Authenticated user cannot invite themselves to a channel. */ +export class CantInviteSelf + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantInviteSelf", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_invite_self" } }], + ) {} + +/** `cant_kick_from_general` -- User cannot be removed from #general. */ +export class CantKickFromGeneral + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantKickFromGeneral", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_kick_from_general" } }], + ) {} + +/** `cant_kick_self` -- Authenticated user can't kick themselves from a channel. */ +export class CantKickSelf + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantKickSelf", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_kick_self" } }], + ) {} + +/** `cant_leave_general` -- Authenticated user cannot leave the general channel */ +export class CantLeaveGeneral + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantLeaveGeneral", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_leave_general" } }], + ) {} + +/** `canvas_creation_failed` -- Canvas was unable to be created. */ +export class CanvasCreationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasCreationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_creation_failed" } }], + ) {} + +/** `canvas_disabled_user_team` -- Canvas is disabled on user's team */ +export class CanvasDisabledUserTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasDisabledUserTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_disabled_user_team" } }], + ) {} + +/** `canvas_tab_creation_failed` -- Canvas tab was unable to be created. */ +export class CanvasTabCreationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasTabCreationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_tab_creation_failed" } }], + ) {} + +/** `channel_archived` -- You cannot share an archived channel. */ +export class ChannelArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_archived" } }], + ) {} + +/** `channel_canvas_already_exists` -- Channel canvas for the specified channel already exists. */ +export class ChannelCanvasAlreadyExists + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelCanvasAlreadyExists", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "channel_canvas_already_exists" } }], + ) {} + +/** `channel_canvas_creation_failed` -- Channel canvas was unable to be created. */ +export class ChannelCanvasCreationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelCanvasCreationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_canvas_creation_failed" } }], + ) {} + +/** `channel_conversion_in_progress` -- Unable to create a channel connection while a channel conversion is in progress */ +export class ChannelConversionInProgress + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelConversionInProgress", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_conversion_in_progress" } }], + ) {} + +/** `channel_is_limited_access` -- The user has no access to the channel. This is only applicable to private Salesforce record channels. */ +export class ChannelIsLimitedAccess + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelIsLimitedAccess", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channel_is_limited_access" } }], + ) {} + +/** `channel_not_found` -- The channel associated with this invite wasn't found. */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `connection_limit_exceeded` -- This channel has hit the limit of external connections. */ +export class ConnectionLimitExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ConnectionLimitExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "connection_limit_exceeded" } }], + ) {} + +/** `connection_limit_exceeded_pending` -- This channel already has a pending invite. */ +export class ConnectionLimitExceededPending + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "ConnectionLimitExceededPending", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "connection_limit_exceeded_pending" } }], + ) {} + +/** `email_does_not_match` -- User's email does not match the email in the invite. */ +export class EmailDoesNotMatch + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EmailDoesNotMatch", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "email_does_not_match" } }], + ) {} + +/** `external_channel_migrating` -- External channel migrating. */ +export class ExternalChannelMigrating + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExternalChannelMigrating", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "external_channel_migrating" } }], + ) {} + +/** `failed_to_start_trial` -- Unable to initiate a trial on shared invite acceptance */ +export class FailedToStartTrial + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToStartTrial", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_start_trial" } }], + ) {} + +/** `fetch_members_failed` -- Failed to fetch members for the conversation. */ +export class FetchMembersFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FetchMembersFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "fetch_members_failed" } }], + ) {} + +/** `free_team_canvas_tab_already_exists` -- Canvas tab for specified channel and team tier already exists. */ +export class FreeTeamCanvasTabAlreadyExists + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "FreeTeamCanvasTabAlreadyExists", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "free_team_canvas_tab_already_exists" } }], + ) {} + +/** `has_already_connected_to_org` -- A team on the workspace of the org is already in the channel. */ +export class HasAlreadyConnectedToOrg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("HasAlreadyConnectedToOrg", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "has_already_connected_to_org" } }], + ) {} + +/** `inactive_invite` -- This invitation is no longer active, it may have expired or been revoked. */ +export class InactiveInvite + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InactiveInvite", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "inactive_invite" } }], + ) {} + +/** `invalid_action` -- This action is no longer valid, e.g., trying to approve an invite that has already been approved. */ +export class InvalidAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_action" } }], + ) {} + +/** `invalid_arguments` -- Invalid API arguments were provided. Either `sig` or `invite_id` must be specified. */ +export class InvalidArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_arguments" } }], + ) {} + +/** `invalid_channel_type` -- You cannot share MPDMs or DMs. */ +export class InvalidChannelType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChannelType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_channel_type" } }], + ) {} + +/** `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_email` -- At least one email address provided is invalid. */ +export class InvalidEmail + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEmail", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_email" } }], + ) {} + +/** `invalid_emoji_not_allowed` -- The desired name contains emoji. */ +export class InvalidEmojiNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEmojiNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_emoji_not_allowed" } }], + ) {} + +/** `invalid_host_team` -- The host workspace is invalid. */ +export class InvalidHostTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidHostTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_host_team" } }], + ) {} + +/** `invalid_limit` -- Value passed for `limit` is not understood. */ +export class InvalidLimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidLimit", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_limit" } }], + ) {} + +/** `invalid_link` -- We couldn't find an invite associated with the ID provided. */ +export class InvalidLink + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidLink", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_link" } }], + ) {} + +/** `invalid_metadata_filter_keys` -- Value passed for `metadata_keys_to_include` was invalid. Must be valid json array of strings. */ +export class InvalidMetadataFilterKeys + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidMetadataFilterKeys", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_metadata_filter_keys" } }], + ) {} + +/** `invalid_name` -- The value passed for `channel_name` was invalid. */ +export class InvalidName + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidName", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_name" } }], + ) {} + +/** `invalid_name_maxlength` -- The value passed for `channel_name` exceeded the maximum length. */ +export class InvalidNameMaxlength + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidNameMaxlength", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_name_maxlength" } }], + ) {} + +/** `invalid_name_punctuation` -- The value passed for `channel_name` contained only punctuation. */ +export class InvalidNamePunctuation + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidNamePunctuation", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_name_punctuation" } }], + ) {} + +/** `invalid_name_required` -- The value passed for `channel_name` was empty. */ +export class InvalidNameRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidNameRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_name_required" } }], + ) {} + +/** `invalid_name_specials` -- The value passed for `channel_name` contained unallowed special characters or upper case characters. */ +export class InvalidNameSpecials + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidNameSpecials", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_name_specials" } }], + ) {} + +/** `invalid_privacy` -- An invalid channel privacy was provided. */ +export class InvalidPrivacy + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidPrivacy", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_privacy" } }], + ) {} + +/** `invalid_recipient_team` -- The accepting team does not match the expected recipient team. */ +export class InvalidRecipientTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRecipientTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_recipient_team" } }], + ) {} + +/** `invalid_target_team` -- The target workspace is invalid. */ +export class InvalidTargetTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTargetTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_target_team" } }], + ) {} + +/** `invalid_timestamp` -- Value passed for `timestamp` was invalid. */ +export class InvalidTimestamp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTimestamp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_timestamp" } }], + ) {} + +/** `invalid_ts_latest` -- Value passed for `latest` was invalid */ +export class InvalidTsLatest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTsLatest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_ts_latest" } }], + ) {} + +/** `invalid_ts_oldest` -- Value passed for `oldest` was invalid */ +export class InvalidTsOldest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTsOldest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_ts_oldest" } }], + ) {} + +/** `invalid_types` -- Value passed for `type` could not be used based on the method's capabilities or the permission scopes granted to the used token. */ +export class InvalidTypes + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTypes", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_types" } }], + ) {} + +/** `invalid_user_combination` -- All external people must already be in at least one channel together to send a message. */ +export class InvalidUserCombination + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidUserCombination", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_user_combination" } }], + ) {} + +/** `invite_already_approved` -- This invite was already approved. */ +export class InviteAlreadyApproved + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviteAlreadyApproved", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invite_already_approved" } }], + ) {} + +/** `invite_already_denied` -- This invite was already denied. */ +export class InviteAlreadyDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviteAlreadyDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invite_already_denied" } }], + ) {} + +/** `invitee_cant_see_channel` -- The Enterprise org multi-workspace channel you are inviting a user to is not shared with any workspaces the user is currently a member of. */ +export class InviteeCantSeeChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviteeCantSeeChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invitee_cant_see_channel" } }], + ) {} + +/** `invite_expired` -- This invite is expired. */ +export class InviteExpired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviteExpired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invite_expired" } }], + ) {} + +/** `invite_from_same_org` -- You can't accept an invite from the same org or workspace. */ +export class InviteFromSameOrg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviteFromSameOrg", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invite_from_same_org" } }], + ) {} + +/** `invite_lookup_error` -- An error occurred while attempting to look for existing invites. */ +export class InviteLookupError + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviteLookupError", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invite_lookup_error" } }], + ) {} + +/** `invite_not_found` -- We couldn't find a Slack Connect channel invite with the ID provided. */ +export class InviteNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviteNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "invite_not_found" } }], + ) {} + +/** `inviter_email_not_verified` -- The inviting user has not verified the email address on their own account. They must verify it before they can send Slack Connect invites, since the invite presents that address as theirs. */ +export class InviterEmailNotVerified + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviterEmailNotVerified", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "inviter_email_not_verified" } }], + ) {} + +/** `invite_used` -- This invite has already been accepted. */ +export class InviteUsed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InviteUsed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invite_used" } }], + ) {} + +/** `is_archived` -- Channel has been archived. */ +export class IsArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("IsArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "is_archived" } }], + ) {} + +/** `is_pending_connected_to_org` -- A team pending to join the channel is on the org of the team trying to accept. */ +export class IsPendingConnectedToOrg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("IsPendingConnectedToOrg", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "is_pending_connected_to_org" } }], + ) {} + +/** `last_member` -- The last member party to a channel cannot leave the channel. Someone else must join the channel before this user is permitted to exit. */ +export class LastMember + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("LastMember", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "last_member" } }], + ) {} + +/** `legacy_connection_invalid_org` -- Teams not previously connected to this legacy channel can't connect. */ +export class LegacyConnectionInvalidOrg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("LegacyConnectionInvalidOrg", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "legacy_connection_invalid_org" } }], + ) {} + +/** `legacy_connection_limit_exceeded` -- You cannot share a legacy ESC channel with a third team */ +export class LegacyConnectionLimitExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("LegacyConnectionLimitExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "legacy_connection_limit_exceeded" } }], + ) {} + +/** `list_record_comment_fetch_failed` -- Failed to fetch list record comments. */ +export class ListRecordCommentFetchFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ListRecordCommentFetchFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "list_record_comment_fetch_failed" } }], + ) {} + +/** `member_limit_exceeded` -- This channel that has hit the limit of members */ +export class MemberLimitExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MemberLimitExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "member_limit_exceeded" } }], + ) {} + +/** `message_too_long` -- The provided message was longer than 560 characters. */ +export class MessageTooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessageTooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "message_too_long" } }], + ) {} + +/** `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. */ +export class MethodNotSupportedForChannelType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "MethodNotSupportedForChannelType", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "method_not_supported_for_channel_type" } }], + ) {} + +/** `missing_argument` -- A required argument is missing. */ +export class MissingArgument + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgument", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_argument" } }], + ) {} + +/** `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. */ +export class MissingScope + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingScope", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_scope" } }], + ) {} + +/** `missing_target_team` -- The `target_team` parameter is required for this request. The inviting team must provide this argument. */ +export class MissingTargetTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingTargetTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_target_team" } }], + ) {} + +/** `name_taken` -- The desired channel name is already taken in your workspace. */ +export class NameTaken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NameTaken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "name_taken" } }], + ) {} + +/** `no_channel` -- Value passed for `name` was empty. */ +export class NoChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_channel" } }], + ) {} + +/** `no_external_invite_permission` -- User does not have permission to invite that external user to the channel */ +export class NoExternalInvitePermission + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoExternalInvitePermission", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_external_invite_permission" } }], + ) {} + +/** `no_permission` -- User does not have permission to invite that specific user to the channel */ +export class NoPermission + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoPermission", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_permission" } }], + ) {} + +/** `not_allowed_for_grid_workspace` -- Acceptance is not allowed for this workspace. */ +export class NotAllowedForGridWorkspace + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAllowedForGridWorkspace", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_allowed_for_grid_workspace" } }], + ) {} + +/** `not_archived` -- Channel is not archived. */ +export class NotArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_archived" } }], + ) {} + +/** `not_authorized` -- Caller cannot rename this channel. */ +export class NotAuthorized + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAuthorized", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_authorized" } }], + ) {} + +/** `not_enough_users` -- Needs at least 2 users to open */ +export class NotEnoughUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotEnoughUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_enough_users" } }], + ) {} + +/** `not_implemented` -- its not implemented! TODO: remove me */ +export class NotImplemented + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotImplemented", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_implemented" } }], + ) {} + +/** `not_in_channel` -- The token can not be found in channel. */ +export class NotInChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotInChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_in_channel" } }], + ) {} + +/** `not_owner` -- Only the host organization for a channel can request to share it. */ +export class NotOwner + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotOwner", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_owner" } }], + ) {} + +/** `not_paid` -- This workspace doesn't have access to this feature. */ +export class NotPaid + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotPaid", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_paid" } }], + ) {} + +/** `not_permitted` -- Not permitted. */ +export class NotPermitted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotPermitted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_permitted" } }], + ) {} + +/** `not_supported` -- Attempting to upgrade a channel that cannot be upgraded */ +export class NotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_supported" } }], + ) {} + +/** `no_user` -- No value was passed for `users`. */ +export class NoUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_user" } }], + ) {} + +/** `org_user_not_in_team` -- One or more members invited are part of the Enterprise organization but not the specific workspace you're interfacing with. */ +export class OrgUserNotInTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OrgUserNotInTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "org_user_not_in_team" } }], + ) {} + +/** `posting_to_channel_denied` -- Permission to post to a channel denied */ +export class PostingToChannelDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PostingToChannelDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "posting_to_channel_denied" } }], + ) {} + +/** `ratelimit` -- The rate-limit for this method has been reached. The ratelimit is applied on a per-user basis when you pass the `emails` parameter. */ +export class Ratelimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("Ratelimit", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "ratelimit" } }], + ) {} + +/** `recipients_not_specified` -- Bots are required to specify which users to invite. */ +export class RecipientsNotSpecified + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RecipientsNotSpecified", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "recipients_not_specified" } }], + ) {} + +/** `restricted_action` -- A team preference prevents the authenticated user from creating private channels. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `team_not_found` -- The team provided in the `team_id` argument does not exits. */ +export class TeamNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "team_not_found" } }], + ) {} + +/** `team_tier_cannot_create_channel_canvases` -- Team tier cannot create channel canvases */ +export class TeamTierCannotCreateChannelCanvases + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "TeamTierCannotCreateChannelCanvases", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "team_tier_cannot_create_channel_canvases" } }], + ) {} + +/** `thread_not_found` -- Value for `ts` was missing or invalid. */ +export class ThreadNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ThreadNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "thread_not_found" } }], + ) {} + +/** `too_long` -- Description was longer than 250 characters. */ +export class TooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_long" } }], + ) {} + +/** `too_many_emails` -- Too many email recipients were passed in the `emails` parameter. */ +export class TooManyEmails + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyEmails", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_emails" } }], + ) {} + +/** `too_many_members` -- The membership in the channel has exceeded our maximum member limit. No more users can join the channel. */ +export class TooManyMembers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyMembers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_members" } }], + ) {} + +/** `too_many_users` -- Needs at most 8 users to open */ +export class TooManyUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_users" } }], + ) {} + +/** `ura_max_channels` -- An invited user is a single-channel guest user ('ultra restricted access') that is already in the maximum number of conversations. */ +export class UraMaxChannels + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UraMaxChannels", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "ura_max_channels" } }], + ) {} + +/** `url_in_message` -- The message contained a URL. */ +export class UrlInMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UrlInMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "url_in_message" } }], + ) {} + +/** `user_cannot_create_channel` -- This user is not allowed to create a channel. */ +export class UserCannotCreateChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserCannotCreateChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_cannot_create_channel" } }], + ) {} + +/** `user_disabled` -- A specified `user` has been disabled. */ +export class UserDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_disabled" } }], + ) {} + +/** `user_does_not_own_channel` -- Calling user does not own this DM channel. */ +export class UserDoesNotOwnChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserDoesNotOwnChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_does_not_own_channel" } }], + ) {} + +/** `user_is_restricted` -- This user is restricted and cannot accept the invite. */ +export class UserIsRestricted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserIsRestricted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_is_restricted" } }], + ) {} + +/** `user_not_found` -- The user accepting the invite is not a member of the team provided in the `team_id` argument. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + +/** `user_not_visible` -- The calling user is restricted from seeing the requested user. */ +export class UserNotVisible + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotVisible", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_not_visible" } }], + ) {} + +/** `user_required_to_accept_as_private_but_cannot` -- This uer cannot accept a private channel invitation. */ +export class UserRequiredToAcceptAsPrivateButCannot + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "UserRequiredToAcceptAsPrivateButCannot", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "user_required_to_accept_as_private_but_cannot" } }], + ) {} + +/** `users_list_not_supplied` -- Missing `users` in request */ +export class UsersListNotSupplied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UsersListNotSupplied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "users_list_not_supplied" } }], + ) {} + export interface AcceptSharedInviteRequest { /** Name of the channel. If the channel does not exist already in your workspace, this name is the one that the channel will take. */ channel_name: string; @@ -499,8 +2026,42 @@ export interface UnarchiveConversationResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type AcceptSharedInviteError = SlackOpError; -/** Accepts an invitation to a Slack Connect channel. Required scopes -- bot: `conversations.connect:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_conversion_in_progress` -- Unable to create a channel connection while a channel conversion is in progress - `connection_limit_exceeded` -- This channel has hit the limit of external connections. - `email_does_not_match` -- User's email does not match the email in the invite. - `failed_to_start_trial` -- Unable to initiate a trial on shared invite acceptance - `has_already_connected_to_org` -- A team on the workspace of the org is already in the channel. - `invalid_arguments` -- Invalid API arguments were provided. Either `sig` or `invite_id` must be specified. - `invalid_emoji_not_allowed` -- The desired name contains emoji. - `invalid_host_team` -- The host workspace is invalid. - `invalid_link` -- We couldn't find an invite associated with the ID provided. - `invalid_name` -- The value passed for `channel_name` was invalid. - `invalid_name_maxlength` -- The value passed for `channel_name` exceeded the maximum length. - `invalid_name_punctuation` -- The value passed for `channel_name` contained only punctuation. - `invalid_name_required` -- The value passed for `channel_name` was empty. - `invalid_name_specials` -- The value passed for `channel_name` contained unallowed special characters or upper case characters. - `invite_from_same_org` -- You can't accept an invite from the same org or workspace. - `invite_not_found` -- We couldn't find a Slack Connect channel invite with the ID provided. - `invalid_privacy` -- An invalid channel privacy was provided. - `invalid_recipient_team` -- The accepting team does not match the expected recipient team. - `invalid_target_team` -- The target workspace is invalid. - `invite_used` -- This invite has already been accepted. - `is_pending_connected_to_org` -- A team pending to join the channel is on the org of the team trying to accept. - `legacy_connection_invalid_org` -- Teams not previously connected to this legacy channel can't connect. - `legacy_connection_limit_exceeded` -- You cannot share a legacy ESC channel with a third team - `name_taken` -- The desired channel name is already taken in your workspace. - `not_allowed_for_grid_workspace` -- Acceptance is not allowed for this workspace. - `not_paid` -- This workspace doesn't have access to this feature. - `restricted_action` -- A team preference prevents the authenticated user from creating private channels. - `team_not_found` -- The team provided in the `team_id` argument does not exits. - `user_cannot_create_channel` -- This user is not allowed to create a channel. - `user_is_restricted` -- This user is restricted and cannot accept the invite. - `user_not_found` -- The user accepting the invite is not a member of the team provided in the `team_id` argument. - `user_required_to_accept_as_private_but_cannot` -- This uer cannot accept a private channel invitation. - `accepter_email_not_verified` -- The accepting user has not verified the email address on their account. They must verify it before accepting. See https://docs.slack.dev/reference/methods/conversations.acceptSharedInvite */ +export type AcceptSharedInviteError = + | AccepterEmailNotVerified + | ChannelConversionInProgress + | ConnectionLimitExceeded + | EmailDoesNotMatch + | FailedToStartTrial + | HasAlreadyConnectedToOrg + | InvalidArguments + | InvalidEmojiNotAllowed + | InvalidHostTeam + | InvalidLink + | InvalidName + | InvalidNameMaxlength + | InvalidNamePunctuation + | InvalidNameRequired + | InvalidNameSpecials + | InvalidPrivacy + | InvalidRecipientTeam + | InvalidTargetTeam + | InviteFromSameOrg + | InviteNotFound + | InviteUsed + | IsPendingConnectedToOrg + | LegacyConnectionInvalidOrg + | LegacyConnectionLimitExceeded + | NameTaken + | NotAllowedForGridWorkspace + | NotPaid + | RestrictedAction + | TeamNotFound + | UserCannotCreateChannel + | UserIsRestricted + | UserNotFound + | UserRequiredToAcceptAsPrivateButCannot + | SlackOpError; +/** Accepts an invitation to a Slack Connect channel. Required scopes -- bot: `conversations.connect:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_conversion_in_progress` -- Unable to create a channel connection while a channel conversion is in progress - `connection_limit_exceeded` -- This channel has hit the limit of external connections. - `email_does_not_match` -- User's email does not match the email in the invite. - `failed_to_start_trial` -- Unable to initiate a trial on shared invite acceptance - `has_already_connected_to_org` -- A team on the workspace of the org is already in the channel. - `invalid_arguments` -- Invalid API arguments were provided. Either `sig` or `invite_id` must be specified. - `invalid_emoji_not_allowed` -- The desired name contains emoji. - `invalid_host_team` -- The host workspace is invalid. - `invalid_link` -- We couldn't find an invite associated with the ID provided. - `invalid_name` -- The value passed for `channel_name` was invalid. - `invalid_name_maxlength` -- The value passed for `channel_name` exceeded the maximum length. - `invalid_name_punctuation` -- The value passed for `channel_name` contained only punctuation. - `invalid_name_required` -- The value passed for `channel_name` was empty. - `invalid_name_specials` -- The value passed for `channel_name` contained unallowed special characters or upper case characters. - `invite_from_same_org` -- You can't accept an invite from the same org or workspace. - `invite_not_found` -- We couldn't find a Slack Connect channel invite with the ID provided. - `invalid_privacy` -- An invalid channel privacy was provided. - `invalid_recipient_team` -- The accepting team does not match the expected recipient team. - `invalid_target_team` -- The target workspace is invalid. - `invite_used` -- This invite has already been accepted. - `is_pending_connected_to_org` -- A team pending to join the channel is on the org of the team trying to accept. - `legacy_connection_invalid_org` -- Teams not previously connected to this legacy channel can't connect. - `legacy_connection_limit_exceeded` -- You cannot share a legacy ESC channel with a third team - `name_taken` -- The desired channel name is already taken in your workspace. - `not_allowed_for_grid_workspace` -- Acceptance is not allowed for this workspace. - `not_paid` -- This workspace doesn't have access to this feature. - `restricted_action` -- A team preference prevents the authenticated user from creating private channels. - `team_not_found` -- The team provided in the `team_id` argument does not exits. - `user_cannot_create_channel` -- This user is not allowed to create a channel. - `user_is_restricted` -- This user is restricted and cannot accept the invite. - `user_not_found` -- The user accepting the invite is not a member of the team provided in the `team_id` argument. - `user_required_to_accept_as_private_but_cannot` -- This uer cannot accept a private channel invitation. - `accepter_email_not_verified` -- The accepting user has not verified the email address on their account. They must verify it before accepting. See https://docs.slack.dev/reference/methods/conversations.acceptSharedInvite */ export const acceptSharedInvite: API.OperationMethod< AcceptSharedInviteRequest, AcceptSharedInviteResponse, @@ -509,15 +2070,62 @@ export const acceptSharedInvite: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccepterEmailNotVerified, + ChannelConversionInProgress, + ConnectionLimitExceeded, + EmailDoesNotMatch, + FailedToStartTrial, + HasAlreadyConnectedToOrg, + InvalidArguments, + InvalidEmojiNotAllowed, + InvalidHostTeam, + InvalidLink, + InvalidName, + InvalidNameMaxlength, + InvalidNamePunctuation, + InvalidNameRequired, + InvalidNameSpecials, + InvalidPrivacy, + InvalidRecipientTeam, + InvalidTargetTeam, + InviteFromSameOrg, + InviteNotFound, + InviteUsed, + IsPendingConnectedToOrg, + LegacyConnectionInvalidOrg, + LegacyConnectionLimitExceeded, + NameTaken, + NotAllowedForGridWorkspace, + NotPaid, + RestrictedAction, + TeamNotFound, + UserCannotCreateChannel, + UserIsRestricted, + UserNotFound, + UserRequiredToAcceptAsPrivateButCannot, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AcceptSharedInvite", })); -export type ApproveRequestSharedInviteError = SlackOpError; -/** Approves a request to add an external user to a channel and sends them a Slack Connect invite Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invite_not_found` -- We couldn't find a Slack Connect channel invite with the ID provided. - `invite_already_approved` -- This invite was already approved. - `invite_already_denied` -- This invite was already denied. - `invite_expired` -- This invite is expired. - `channel_not_found` -- The provided channel was not found or the channel is no longer visible to the user who requested the invite. - `user_not_found` -- Can not find the user who requested the invite. - `team_not_found` -- Can not find the team who requested the invite. - `restricted_action` -- A team preference prevents the invite from being approved. - `no_external_invite_permission` -- Channel manager has restricted external invites for a given channel. - `internal_error` -- Something unexpected went wrong. - `message_too_long` -- If the passed in approve message is greater than 560 characters. See https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.approve */ +export type ApproveRequestSharedInviteError = + | ChannelNotFound + | InviteAlreadyApproved + | InviteAlreadyDenied + | InviteExpired + | InviteNotFound + | MessageTooLong + | NoExternalInvitePermission + | RestrictedAction + | TeamNotFound + | UserNotFound + | SlackOpError; +/** Approves a request to add an external user to a channel and sends them a Slack Connect invite Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invite_not_found` -- We couldn't find a Slack Connect channel invite with the ID provided. - `invite_already_approved` -- This invite was already approved. - `invite_already_denied` -- This invite was already denied. - `invite_expired` -- This invite is expired. - `channel_not_found` -- The provided channel was not found or the channel is no longer visible to the user who requested the invite. - `user_not_found` -- Can not find the user who requested the invite. - `team_not_found` -- Can not find the team who requested the invite. - `restricted_action` -- A team preference prevents the invite from being approved. - `no_external_invite_permission` -- Channel manager has restricted external invites for a given channel. - `internal_error` -- Something unexpected went wrong. - `message_too_long` -- If the passed in approve message is greater than 560 characters. See https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.approve */ export const approveRequestSharedInvite: API.OperationMethod< ApproveRequestSharedInviteRequest, ApproveRequestSharedInviteResponse, @@ -526,66 +2134,150 @@ export const approveRequestSharedInvite: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(5, __c1, 1) as any as S.Schema, output: __S(6, __c1, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + InviteAlreadyApproved, + InviteAlreadyDenied, + InviteExpired, + InviteNotFound, + MessageTooLong, + NoExternalInvitePermission, + RestrictedAction, + TeamNotFound, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ApproveRequestSharedInvite", })); -export type ApproveSharedInviteError = SlackOpError; -/** Approves an invitation to a Slack Connect channel Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `already_approved` -- This invite was already approved by this team. - `approval_inactive` -- The approval associated with the invite ID is not active. - `approval_not_found` -- We could not find an approval associated with the invite ID provided. - `channel_conversion_in_progress` -- A channel conversion is in progress - `channel_not_found` -- The channel associated with this invite wasn't found. - `invalid_action` -- This action is no longer valid, e.g., trying to approve an invite that has already been approved. - `invalid_link` -- The link provided was invalid. - `invite_not_found` -- The invite specified wasn't found. - `missing_target_team` -- The `target_team` parameter is required for this request. The inviting team must provide this argument. - `not_paid` -- The team attempting to approve this invite is not paid and therefore not eligible. - `restricted_action` -- A team preference prevents the authenticated user from creating private channels. See https://docs.slack.dev/reference/methods/conversations.approveSharedInvite */ +export type ApproveSharedInviteError = + | AlreadyApproved + | ApprovalInactive + | ApprovalNotFound + | ChannelConversionInProgress + | ChannelNotFound + | InvalidAction + | InvalidLink + | InviteNotFound + | MissingTargetTeam + | NotPaid + | RestrictedAction + | SlackOpError; +/** Approves an invitation to a Slack Connect channel Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `already_approved` -- This invite was already approved by this team. - `approval_inactive` -- The approval associated with the invite ID is not active. - `approval_not_found` -- We could not find an approval associated with the invite ID provided. - `channel_conversion_in_progress` -- A channel conversion is in progress - `channel_not_found` -- The channel associated with this invite wasn't found. - `invalid_action` -- This action is no longer valid, e.g., trying to approve an invite that has already been approved. - `invalid_link` -- The link provided was invalid. - `invite_not_found` -- The invite specified wasn't found. - `missing_target_team` -- The `target_team` parameter is required for this request. The inviting team must provide this argument. - `not_paid` -- The team attempting to approve this invite is not paid and therefore not eligible. - `restricted_action` -- A team preference prevents the authenticated user from creating private channels. See https://docs.slack.dev/reference/methods/conversations.approveSharedInvite */ export const approveSharedInvite: API.OperationMethod< ApproveSharedInviteRequest, ApproveSharedInviteResponse, ApproveSharedInviteError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(52, __c13, 0) as any as S.Schema, - output: __S(56, __c14, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(8, __c2, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, + errors: [ + AlreadyApproved, + ApprovalInactive, + ApprovalNotFound, + ChannelConversionInProgress, + ChannelNotFound, + InvalidAction, + InvalidLink, + InviteNotFound, + MissingTargetTeam, + NotPaid, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ApproveSharedInvite", })); -export type ArchiveConversationError = SlackOpError; -/** Archives a conversation. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `already_archived` -- Channel has already been archived. - `cant_archive_general` -- You cannot archive the general channel - `cant_archive_required` -- You cannot archive a required channel - `channel_not_found` -- Value passed for `channel` was invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_in_channel` -- The token can not be found in channel. - `restricted_action` -- A team preference prevents the authenticated user from archiving. See https://docs.slack.dev/reference/methods/conversations.archive */ +export type ArchiveConversationError = + | AlreadyArchived + | CantArchiveGeneral + | CantArchiveRequired + | ChannelNotFound + | MethodNotSupportedForChannelType + | MissingScope + | NotInChannel + | RestrictedAction + | SlackOpError; +/** Archives a conversation. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `already_archived` -- Channel has already been archived. - `cant_archive_general` -- You cannot archive the general channel - `cant_archive_required` -- You cannot archive a required channel - `channel_not_found` -- Value passed for `channel` was invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_in_channel` -- The token can not be found in channel. - `restricted_action` -- A team preference prevents the authenticated user from archiving. See https://docs.slack.dev/reference/methods/conversations.archive */ export const archiveConversation: API.OperationMethod< ArchiveConversationRequest, ArchiveConversationResponse, ArchiveConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(92, __c23, 0) as any as S.Schema, - output: __S(56, __c14, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(16, __c4, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, + errors: [ + AlreadyArchived, + CantArchiveGeneral, + CantArchiveRequired, + ChannelNotFound, + MethodNotSupportedForChannelType, + MissingScope, + NotInChannel, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ArchiveConversation", })); -export type ConversationsCloseError = SlackOpError; -/** Closes a direct message or multi-person direct message. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `user_does_not_own_channel` -- Calling user does not own this DM channel. - `not_permitted` -- Not permitted. - `external_channel_migrating` -- External channel migrating. See https://docs.slack.dev/reference/methods/conversations.close */ +export type ConversationsCloseError = + | ChannelNotFound + | ExternalChannelMigrating + | MethodNotSupportedForChannelType + | MissingScope + | NotPermitted + | UserDoesNotOwnChannel + | SlackOpError; +/** Closes a direct message or multi-person direct message. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `user_does_not_own_channel` -- Calling user does not own this DM channel. - `not_permitted` -- Not permitted. - `external_channel_migrating` -- External channel migrating. See https://docs.slack.dev/reference/methods/conversations.close */ export const conversationsClose: API.OperationMethod< ConversationsCloseRequest, ConversationsCloseResponse, ConversationsCloseError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(96, __c24, 0) as any as S.Schema, - output: __S(97, __c24, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(20, __c5, 0) as any as S.Schema, + output: __S(21, __c5, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + ExternalChannelMigrating, + MethodNotSupportedForChannelType, + MissingScope, + NotPermitted, + UserDoesNotOwnChannel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ConversationsClose", })); -export type ConversationsHistoryError = SlackOpError; -/** Fetches a conversation's history of messages and events. Required scopes -- bot: `groups:history`, `im:history`, `mpim:history`, `channels:history`; user: `groups:history`, `im:history`, `mpim:history`, `channels:history` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_is_limited_access` -- The user has no access to the channel. This is only applicable to private Salesforce record channels. - `channel_not_found` -- Value passed for `channel` was invalid. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_metadata_filter_keys` -- Value passed for `metadata_keys_to_include` was invalid. Must be valid json array of strings. - `invalid_ts_latest` -- Value passed for `latest` was invalid - `invalid_ts_oldest` -- Value passed for `oldest` was invalid - `not_in_channel` -- The token used does not have access to the proper channel. Only user tokens can access public channels they are not in. - `restricted_action` -- User does not have permission to perform this action. See https://docs.slack.dev/reference/methods/conversations.history */ +export type ConversationsHistoryError = + | ChannelIsLimitedAccess + | ChannelNotFound + | InvalidCursor + | InvalidMetadataFilterKeys + | InvalidTsLatest + | InvalidTsOldest + | NotInChannel + | RestrictedAction + | SlackOpError; +/** Fetches a conversation's history of messages and events. Required scopes -- bot: `groups:history`, `im:history`, `mpim:history`, `channels:history`; user: `groups:history`, `im:history`, `mpim:history`, `channels:history` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_is_limited_access` -- The user has no access to the channel. This is only applicable to private Salesforce record channels. - `channel_not_found` -- Value passed for `channel` was invalid. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_metadata_filter_keys` -- Value passed for `metadata_keys_to_include` was invalid. Must be valid json array of strings. - `invalid_ts_latest` -- Value passed for `latest` was invalid - `invalid_ts_oldest` -- Value passed for `oldest` was invalid - `not_in_channel` -- The token used does not have access to the proper channel. Only user tokens can access public channels they are not in. - `restricted_action` -- User does not have permission to perform this action. See https://docs.slack.dev/reference/methods/conversations.history */ export const conversationsHistory: API.PaginatedOperationMethod< ConversationsHistoryRequest, ConversationsHistoryResponse, @@ -594,9 +2286,20 @@ export const conversationsHistory: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(100, __c25, 0) as any as S.Schema, - output: __S(102, __c25, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(24, __c6, 0) as any as S.Schema, + output: __S(26, __c6, 2) as any as S.Schema, + errors: [ + ChannelIsLimitedAccess, + ChannelNotFound, + InvalidCursor, + InvalidMetadataFilterKeys, + InvalidTsLatest, + InvalidTsOldest, + NotInChannel, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -612,59 +2315,98 @@ export const conversationsHistory: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ConversationsInfoError = SlackOpError; -/** Retrieve information about a conversation. Required scopes -- bot: `groups:read`, `im:read`, `mpim:read`, `channels:read`; user: `groups:read`, `im:read`, `mpim:read`, `channels:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_is_limited_access` -- The user has no access to the channel. Only applicable to Salesforce limited access channels. - `channel_not_found` -- Value passed for `channel` was invalid. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. See https://docs.slack.dev/reference/methods/conversations.info */ +export type ConversationsInfoError = + | ChannelIsLimitedAccess + | ChannelNotFound + | MissingScope + | SlackOpError; +/** Retrieve information about a conversation. Required scopes -- bot: `groups:read`, `im:read`, `mpim:read`, `channels:read`; user: `groups:read`, `im:read`, `mpim:read`, `channels:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_is_limited_access` -- The user has no access to the channel. Only applicable to Salesforce limited access channels. - `channel_not_found` -- Value passed for `channel` was invalid. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. See https://docs.slack.dev/reference/methods/conversations.info */ export const conversationsInfo: API.OperationMethod< ConversationsInfoRequest, ConversationsInfoResponse, ConversationsInfoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(120, __c30, 0) as any as S.Schema, - output: __S(121, __c30, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(44, __c11, 0) as any as S.Schema, + output: __S(45, __c11, 1) as any as S.Schema, + errors: [ChannelIsLimitedAccess, ChannelNotFound, MissingScope, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ConversationsInfo", })); -export type ConversationsKickError = SlackOpError; -/** Removes a user from a conversation. Required scopes -- bot: `groups:write`, `channels:manage`; user: `groups:write`, `channels:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `cant_kick_from_general` -- User cannot be removed from #general. - `cant_kick_self` -- Authenticated user can't kick themselves from a channel. - `channel_not_found` -- Value passed for `channel` was invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `no_user` -- No value was passed for `user` or `users`. - `not_in_channel` -- User was not in the channel. - `not_supported` -- This is not supported for this channel and user combination. - `restricted_action` -- A team preference prevents the authenticated user from kicking. - `user_not_found` -- Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/conversations.kick */ +export type ConversationsKickError = + | CantKickFromGeneral + | CantKickSelf + | ChannelNotFound + | MethodNotSupportedForChannelType + | MissingScope + | NoUser + | NotInChannel + | NotSupported + | RestrictedAction + | UserNotFound + | SlackOpError; +/** Removes a user from a conversation. Required scopes -- bot: `groups:write`, `channels:manage`; user: `groups:write`, `channels:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `cant_kick_from_general` -- User cannot be removed from #general. - `cant_kick_self` -- Authenticated user can't kick themselves from a channel. - `channel_not_found` -- Value passed for `channel` was invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `no_user` -- No value was passed for `user` or `users`. - `not_in_channel` -- User was not in the channel. - `not_supported` -- This is not supported for this channel and user combination. - `restricted_action` -- A team preference prevents the authenticated user from kicking. - `user_not_found` -- Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/conversations.kick */ export const conversationsKick: API.OperationMethod< ConversationsKickRequest, ConversationsKickResponse, ConversationsKickError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(124, __c31, 0) as any as S.Schema, - output: __S(125, __c31, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(48, __c12, 0) as any as S.Schema, + output: __S(49, __c12, 1) as any as S.Schema, + errors: [ + CantKickFromGeneral, + CantKickSelf, + ChannelNotFound, + MethodNotSupportedForChannelType, + MissingScope, + NoUser, + NotInChannel, + NotSupported, + RestrictedAction, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ConversationsKick", })); -export type ConversationsMarkError = SlackOpError; -/** Sets the read cursor in a channel. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `invalid_timestamp` -- Value passed for `timestamp` was invalid. - `not_in_channel` -- Caller is not a member of the channel. See https://docs.slack.dev/reference/methods/conversations.mark */ +export type ConversationsMarkError = + | ChannelNotFound + | InvalidTimestamp + | NotInChannel + | SlackOpError; +/** Sets the read cursor in a channel. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `invalid_timestamp` -- Value passed for `timestamp` was invalid. - `not_in_channel` -- Caller is not a member of the channel. See https://docs.slack.dev/reference/methods/conversations.mark */ export const conversationsMark: API.OperationMethod< ConversationsMarkRequest, ConversationsMarkResponse, ConversationsMarkError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(128, __c32, 0) as any as S.Schema, - output: __S(56, __c14, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(52, __c13, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, + errors: [ChannelNotFound, InvalidTimestamp, NotInChannel, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ConversationsMark", })); -export type ConversationsMembersError = SlackOpError; -/** Retrieve members of a conversation. Required scopes -- bot: `groups:read`, `im:read`, `mpim:read`, `channels:read`; user: `groups:read`, `im:read`, `mpim:read`, `channels:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `fetch_members_failed` -- Failed to fetch members for the conversation. - `invalid_cursor` -- Value passed for `cursor` was invalid. - `invalid_limit` -- Value passed for `limit` was invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. See https://docs.slack.dev/reference/methods/conversations.members */ +export type ConversationsMembersError = + | ChannelNotFound + | FetchMembersFailed + | InvalidCursor + | InvalidLimit + | MethodNotSupportedForChannelType + | MissingScope + | SlackOpError; +/** Retrieve members of a conversation. Required scopes -- bot: `groups:read`, `im:read`, `mpim:read`, `channels:read`; user: `groups:read`, `im:read`, `mpim:read`, `channels:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `fetch_members_failed` -- Failed to fetch members for the conversation. - `invalid_cursor` -- Value passed for `cursor` was invalid. - `invalid_limit` -- Value passed for `limit` was invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. See https://docs.slack.dev/reference/methods/conversations.members */ export const conversationsMembers: API.PaginatedOperationMethod< ConversationsMembersRequest, ConversationsMembersResponse, @@ -673,9 +2415,18 @@ export const conversationsMembers: API.PaginatedOperationMethod< string > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(132, __c33, 0) as any as S.Schema, - output: __S(133, __c33, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(56, __c14, 0) as any as S.Schema, + output: __S(57, __c14, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + FetchMembersFailed, + InvalidCursor, + InvalidLimit, + MethodNotSupportedForChannelType, + MissingScope, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -691,25 +2442,63 @@ export const conversationsMembers: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ConversationsOpenError = SlackOpError; -/** Opens or resumes a direct message or multi-person direct message. Required scopes -- bot: `channels:manage`, `groups:write`, `im:write`, `mpim:write`; user: `channels:write`, `groups:write`, `im:write`, `mpim:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `invalid_user_combination` -- All external people must already be in at least one channel together to send a message. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_enough_users` -- Needs at least 2 users to open - `restricted_action` -- User does not have permission to perform this action. - `too_many_users` -- Needs at most 8 users to open - `user_disabled` -- A specified `user` has been disabled. - `user_not_found` -- Value(s) passed for `users` was invalid. - `user_not_visible` -- The calling user is restricted from seeing the requested user. - `users_list_not_supplied` -- Missing `users` in request - `app_cannot_join_channel` -- This app cannot be added to this conversation. See https://docs.slack.dev/reference/methods/conversations.open */ +export type ConversationsOpenError = + | AppCannotJoinChannel + | ChannelNotFound + | InvalidUserCombination + | MethodNotSupportedForChannelType + | MissingScope + | NotEnoughUsers + | RestrictedAction + | TooManyUsers + | UserDisabled + | UserNotFound + | UserNotVisible + | UsersListNotSupplied + | SlackOpError; +/** Opens or resumes a direct message or multi-person direct message. Required scopes -- bot: `channels:manage`, `groups:write`, `im:write`, `mpim:write`; user: `channels:write`, `groups:write`, `im:write`, `mpim:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `invalid_user_combination` -- All external people must already be in at least one channel together to send a message. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_enough_users` -- Needs at least 2 users to open - `restricted_action` -- User does not have permission to perform this action. - `too_many_users` -- Needs at most 8 users to open - `user_disabled` -- A specified `user` has been disabled. - `user_not_found` -- Value(s) passed for `users` was invalid. - `user_not_visible` -- The calling user is restricted from seeing the requested user. - `users_list_not_supplied` -- Missing `users` in request - `app_cannot_join_channel` -- This app cannot be added to this conversation. See https://docs.slack.dev/reference/methods/conversations.open */ export const conversationsOpen: API.OperationMethod< ConversationsOpenRequest, ConversationsOpenResponse, ConversationsOpenError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(8, __c2, 0) as any as S.Schema, - output: __S(9, __c2, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(60, __c15, 0) as any as S.Schema, + output: __S(61, __c15, 1) as any as S.Schema, + errors: [ + AppCannotJoinChannel, + ChannelNotFound, + InvalidUserCombination, + MethodNotSupportedForChannelType, + MissingScope, + NotEnoughUsers, + RestrictedAction, + TooManyUsers, + UserDisabled, + UserNotFound, + UserNotVisible, + UsersListNotSupplied, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ConversationsOpen", })); -export type ConversationsRepliesError = SlackOpError; -/** Retrieve a thread of messages posted to a conversation Required scopes -- bot: `groups:history`, `im:history`, `mpim:history`, `channels:history`; user: `groups:history`, `im:history`, `mpim:history`, `channels:history` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value for `channel` was missing or invalid. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_metadata_filter_keys` -- Value passed for `metadata_keys_to_include` was invalid. Must be valid json array of strings. - `invalid_ts_latest` -- Value passed for `latest` was invalid - `invalid_ts_oldest` -- Value passed for `oldest` was invalid - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `thread_not_found` -- Value for `ts` was missing or invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `list_record_comment_fetch_failed` -- Failed to fetch list record comments. See https://docs.slack.dev/reference/methods/conversations.replies */ +export type ConversationsRepliesError = + | ChannelNotFound + | InvalidCursor + | InvalidMetadataFilterKeys + | InvalidTsLatest + | InvalidTsOldest + | ListRecordCommentFetchFailed + | MethodNotSupportedForChannelType + | MissingScope + | ThreadNotFound + | SlackOpError; +/** Retrieve a thread of messages posted to a conversation Required scopes -- bot: `groups:history`, `im:history`, `mpim:history`, `channels:history`; user: `groups:history`, `im:history`, `mpim:history`, `channels:history` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value for `channel` was missing or invalid. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_metadata_filter_keys` -- Value passed for `metadata_keys_to_include` was invalid. Must be valid json array of strings. - `invalid_ts_latest` -- Value passed for `latest` was invalid - `invalid_ts_oldest` -- Value passed for `oldest` was invalid - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `thread_not_found` -- Value for `ts` was missing or invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `list_record_comment_fetch_failed` -- Failed to fetch list record comments. See https://docs.slack.dev/reference/methods/conversations.replies */ export const conversationsReplies: API.PaginatedOperationMethod< ConversationsRepliesRequest, ConversationsRepliesResponse, @@ -718,9 +2507,21 @@ export const conversationsReplies: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(12, __c3, 0) as any as S.Schema, - output: __S(13, __c3, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(64, __c16, 0) as any as S.Schema, + output: __S(65, __c16, 1) as any as S.Schema, + errors: [ + ChannelNotFound, + InvalidCursor, + InvalidMetadataFilterKeys, + InvalidTsLatest, + InvalidTsOldest, + ListRecordCommentFetchFailed, + MethodNotSupportedForChannelType, + MissingScope, + ThreadNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -736,127 +2537,331 @@ export const conversationsReplies: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type CreateCanvaseError = SlackOpError; -/** Create a channel canvas for a channel Required scopes -- bot: `canvases:write`; user: `canvases:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `restricted_action` -- User does not have permission to perform this action. - `channel_canvas_creation_failed` -- Channel canvas was unable to be created. - `channel_canvas_already_exists` -- Channel canvas for the specified channel already exists. - `team_tier_cannot_create_channel_canvases` -- Team tier cannot create channel canvases - `canvas_creation_failed` -- Canvas was unable to be created. - `canvas_tab_creation_failed` -- Canvas tab was unable to be created. - `free_team_canvas_tab_already_exists` -- Canvas tab for specified channel and team tier already exists. - `posting_to_channel_denied` -- Permission to post to a channel denied - `channel_not_found` -- Value passed for `channel_id` was invalid. See https://docs.slack.dev/reference/methods/conversations.canvases.create */ +export type CreateCanvaseError = + | CanvasCreationFailed + | CanvasDisabledUserTeam + | CanvasTabCreationFailed + | ChannelCanvasAlreadyExists + | ChannelCanvasCreationFailed + | ChannelNotFound + | FreeTeamCanvasTabAlreadyExists + | PostingToChannelDenied + | RestrictedAction + | TeamTierCannotCreateChannelCanvases + | SlackOpError; +/** Create a channel canvas for a channel Required scopes -- bot: `canvases:write`; user: `canvases:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `restricted_action` -- User does not have permission to perform this action. - `channel_canvas_creation_failed` -- Channel canvas was unable to be created. - `channel_canvas_already_exists` -- Channel canvas for the specified channel already exists. - `team_tier_cannot_create_channel_canvases` -- Team tier cannot create channel canvases - `canvas_creation_failed` -- Canvas was unable to be created. - `canvas_tab_creation_failed` -- Canvas tab was unable to be created. - `free_team_canvas_tab_already_exists` -- Canvas tab for specified channel and team tier already exists. - `posting_to_channel_denied` -- Permission to post to a channel denied - `channel_not_found` -- Value passed for `channel_id` was invalid. See https://docs.slack.dev/reference/methods/conversations.canvases.create */ export const createCanvase: API.OperationMethod< CreateCanvaseRequest, CreateCanvaseResponse, CreateCanvaseError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(16, __c4, 0) as any as S.Schema, - output: __S(17, __c4, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(68, __c17, 0) as any as S.Schema, + output: __S(69, __c17, 1) as any as S.Schema, + errors: [ + CanvasCreationFailed, + CanvasDisabledUserTeam, + CanvasTabCreationFailed, + ChannelCanvasAlreadyExists, + ChannelCanvasCreationFailed, + ChannelNotFound, + FreeTeamCanvasTabAlreadyExists, + PostingToChannelDenied, + RestrictedAction, + TeamTierCannotCreateChannelCanvases, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateCanvase", })); -export type CreateConversationError = SlackOpError; -/** Initiates a public or private channel-based conversation Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_create_channel` -- This channel is unable to be created. - `invalid_name` -- Value passed for `name` was invalid. - `invalid_name_maxlength` -- Value passed for `name` exceeded max length. - `invalid_name_punctuation` -- Value passed for `name` contained only punctuation. - `invalid_name_required` -- Value passed for `name` was empty. - `invalid_name_specials` -- Value passed for `name` contained unallowed special characters or upper case characters. - `missing_argument` -- A required argument is missing. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `name_taken` -- A channel cannot be created with the given name. - `no_channel` -- Value passed for `name` was empty. - `restricted_action` -- A team (workspace) preference prevents the authenticated user from creating channels. - `canvas_disabled_user_team` -- Canvas is disabled on user's team See https://docs.slack.dev/reference/methods/conversations.create */ +export type CreateConversationError = + | CannotCreateChannel + | CanvasDisabledUserTeam + | InvalidName + | InvalidNameMaxlength + | InvalidNamePunctuation + | InvalidNameRequired + | InvalidNameSpecials + | MissingArgument + | MissingScope + | NameTaken + | NoChannel + | RestrictedAction + | SlackOpError; +/** Initiates a public or private channel-based conversation Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_create_channel` -- This channel is unable to be created. - `invalid_name` -- Value passed for `name` was invalid. - `invalid_name_maxlength` -- Value passed for `name` exceeded max length. - `invalid_name_punctuation` -- Value passed for `name` contained only punctuation. - `invalid_name_required` -- Value passed for `name` was empty. - `invalid_name_specials` -- Value passed for `name` contained unallowed special characters or upper case characters. - `missing_argument` -- A required argument is missing. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `name_taken` -- A channel cannot be created with the given name. - `no_channel` -- Value passed for `name` was empty. - `restricted_action` -- A team (workspace) preference prevents the authenticated user from creating channels. - `canvas_disabled_user_team` -- Canvas is disabled on user's team See https://docs.slack.dev/reference/methods/conversations.create */ export const createConversation: API.OperationMethod< CreateConversationRequest, CreateConversationResponse, CreateConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(20, __c5, 0) as any as S.Schema, - output: __S(24, __c6, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(72, __c18, 0) as any as S.Schema, + output: __S(76, __c19, 0) as any as S.Schema, + errors: [ + CannotCreateChannel, + CanvasDisabledUserTeam, + InvalidName, + InvalidNameMaxlength, + InvalidNamePunctuation, + InvalidNameRequired, + InvalidNameSpecials, + MissingArgument, + MissingScope, + NameTaken, + NoChannel, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateConversation", })); -export type InviteConversationError = SlackOpError; -/** Invites users to a channel. Required scopes -- bot: `channels:write.invites`, `groups:write.invites`, `channels:manage`, `groups:write`, `im:write`, `mpim:write`; user: `channels:write.invites`, `groups:write.invites`, `channels:write`, `groups:write`, `im:write`, `mpim:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `already_in_channel` -- Invited user is already in the channel. - `app_cannot_join_channel` -- This app cannot be invited to this channel. - `cant_invite` -- User cannot be invited to this channel. - `cant_invite_self` -- Authenticated user cannot invite themselves to a channel. - `channel_not_found` -- Value passed for `channel` was invalid. - `invitee_cant_see_channel` -- The Enterprise org multi-workspace channel you are inviting a user to is not shared with any workspaces the user is currently a member of. - `is_archived` -- Channel has been archived. - `org_user_not_in_team` -- One or more members invited are part of the Enterprise organization but not the specific workspace you're interfacing with. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `no_permission` -- User does not have permission to invite that specific user to the channel - `no_external_invite_permission` -- User does not have permission to invite that external user to the channel - `no_user` -- No value was passed for `users`. - `not_in_channel` -- Authenticated user is not in the channel. - `ura_max_channels` -- An invited user is a single-channel guest user ('ultra restricted access') that is already in the maximum number of conversations. - `user_is_restricted` -- An invited user is a guest user that is restricted from accessing this conversation. - `user_not_found` -- Value passed for `users` was invalid. - `external_channel_migrating` -- External channel migrating. See https://docs.slack.dev/reference/methods/conversations.invite */ +export type InviteConversationError = + | AlreadyInChannel + | AppCannotJoinChannel + | CantInvite + | CantInviteSelf + | ChannelNotFound + | ExternalChannelMigrating + | InviteeCantSeeChannel + | IsArchived + | MethodNotSupportedForChannelType + | MissingScope + | NoExternalInvitePermission + | NoPermission + | NoUser + | NotInChannel + | OrgUserNotInTeam + | UraMaxChannels + | UserIsRestricted + | UserNotFound + | SlackOpError; +/** Invites users to a channel. Required scopes -- bot: `channels:write.invites`, `groups:write.invites`, `channels:manage`, `groups:write`, `im:write`, `mpim:write`; user: `channels:write.invites`, `groups:write.invites`, `channels:write`, `groups:write`, `im:write`, `mpim:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `already_in_channel` -- Invited user is already in the channel. - `app_cannot_join_channel` -- This app cannot be invited to this channel. - `cant_invite` -- User cannot be invited to this channel. - `cant_invite_self` -- Authenticated user cannot invite themselves to a channel. - `channel_not_found` -- Value passed for `channel` was invalid. - `invitee_cant_see_channel` -- The Enterprise org multi-workspace channel you are inviting a user to is not shared with any workspaces the user is currently a member of. - `is_archived` -- Channel has been archived. - `org_user_not_in_team` -- One or more members invited are part of the Enterprise organization but not the specific workspace you're interfacing with. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `no_permission` -- User does not have permission to invite that specific user to the channel - `no_external_invite_permission` -- User does not have permission to invite that external user to the channel - `no_user` -- No value was passed for `users`. - `not_in_channel` -- Authenticated user is not in the channel. - `ura_max_channels` -- An invited user is a single-channel guest user ('ultra restricted access') that is already in the maximum number of conversations. - `user_is_restricted` -- An invited user is a guest user that is restricted from accessing this conversation. - `user_not_found` -- Value passed for `users` was invalid. - `external_channel_migrating` -- External channel migrating. See https://docs.slack.dev/reference/methods/conversations.invite */ export const inviteConversation: API.OperationMethod< InviteConversationRequest, InviteConversationResponse, InviteConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(28, __c7, 0) as any as S.Schema, - output: __S(29, __c7, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(80, __c20, 0) as any as S.Schema, + output: __S(81, __c20, 1) as any as S.Schema, + errors: [ + AlreadyInChannel, + AppCannotJoinChannel, + CantInvite, + CantInviteSelf, + ChannelNotFound, + ExternalChannelMigrating, + InviteeCantSeeChannel, + IsArchived, + MethodNotSupportedForChannelType, + MissingScope, + NoExternalInvitePermission, + NoPermission, + NoUser, + NotInChannel, + OrgUserNotInTeam, + UraMaxChannels, + UserIsRestricted, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "InviteConversation", })); -export type InviteDeclineSharedError = SlackOpError; -/** Declines a Slack Connect channel invite. Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `approval_inactive` -- This approval is no longer active, it may have expired or been declined. - `approval_not_found` -- We could not find a Slack Connect approval for the invite provided. - `inactive_invite` -- This invitation is no longer active, it may have expired or been revoked. - `invite_not_found` -- We could not find a Slack Connect invite associated with the ID provided. - `missing_target_team` -- The `target_team` parameter is required for this request. - `not_paid` -- The workspace is not eligible to use Slack Connect. - `restricted_action` -- A team preference prevents the authenticated user from declining Slack Connect invites.. See https://docs.slack.dev/reference/methods/conversations.declineSharedInvite */ +export type InviteDeclineSharedError = + | ApprovalInactive + | ApprovalNotFound + | InactiveInvite + | InviteNotFound + | MissingTargetTeam + | NotPaid + | RestrictedAction + | SlackOpError; +/** Declines a Slack Connect channel invite. Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `approval_inactive` -- This approval is no longer active, it may have expired or been declined. - `approval_not_found` -- We could not find a Slack Connect approval for the invite provided. - `inactive_invite` -- This invitation is no longer active, it may have expired or been revoked. - `invite_not_found` -- We could not find a Slack Connect invite associated with the ID provided. - `missing_target_team` -- The `target_team` parameter is required for this request. - `not_paid` -- The workspace is not eligible to use Slack Connect. - `restricted_action` -- A team preference prevents the authenticated user from declining Slack Connect invites.. See https://docs.slack.dev/reference/methods/conversations.declineSharedInvite */ export const inviteDeclineShared: API.OperationMethod< InviteDeclineSharedRequest, InviteDeclineSharedResponse, InviteDeclineSharedError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(32, __c8, 0) as any as S.Schema, - output: __S(56, __c14, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(84, __c21, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, + errors: [ + ApprovalInactive, + ApprovalNotFound, + InactiveInvite, + InviteNotFound, + MissingTargetTeam, + NotPaid, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "InviteDeclineShared", })); -export type InviteSharedError = SlackOpError; -/** Sends an invitation to a Slack Connect channel Required scopes -- bot: `conversations.connect:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `already_in_channel` -- User is already in the channel. - `cannot_share_cross_workspace_channel` -- You cannot share a cross-workspace or org-wide channel. - `cannot_share_mandatory_channel` -- You cannot share #general or mandatory channels. - `channel_archived` -- You cannot share an archived channel. - `channel_not_found` -- The channel provided was not found. - `connection_limit_exceeded` -- This channel has hit the limit of external connections. - `connection_limit_exceeded_pending` -- This channel already has a pending invite. - `invalid_channel_type` -- You cannot share MPDMs or DMs. - `invalid_email` -- At least one email address provided is invalid. - `invite_lookup_error` -- An error occurred while attempting to look for existing invites. - `invite_not_found` -- An error occurred while inviting users. - `legacy_connection_limit_exceeded` -- You cannot share a legacy ESC channel with a third team - `member_limit_exceeded` -- This channel that has hit the limit of members - `message_too_long` -- The provided message was longer than 560 characters. - `not_allowed_for_grid_workspace` -- This workspace does not have Slack Connect enabled. - `not_in_channel` -- The app is not a member of the channel to invite. - `not_owner` -- Only the host organization for a channel can request to share it. - `not_paid` -- This feature is only available to paid teams. - `not_supported` -- This channel cannot be shared. - `ratelimit` -- The rate-limit for this method has been reached. The ratelimit is applied on a per-user basis when you pass the `emails` parameter. - `recipients_not_specified` -- Bots are required to specify which users to invite. - `restricted_action` -- A team preference does not allow this authorization to send invites. - `too_many_emails` -- Too many email recipients were passed in the `emails` parameter. - `url_in_message` -- The message contained a URL. - `user_not_found` -- User lookup failed. - `no_external_invite_permission` -- User does not have permission to invite an external user. - `inviter_email_not_verified` -- The inviting user has not verified the email address on their own account. They must verify it before they can send Slack Connect invites, since the invite presents that address as theirs. See https://docs.slack.dev/reference/methods/conversations.inviteShared */ +export type InviteSharedError = + | AlreadyInChannel + | CannotShareCrossWorkspaceChannel + | CannotShareMandatoryChannel + | ChannelArchived + | ChannelNotFound + | ConnectionLimitExceeded + | ConnectionLimitExceededPending + | InvalidChannelType + | InvalidEmail + | InviteLookupError + | InviteNotFound + | InviterEmailNotVerified + | LegacyConnectionLimitExceeded + | MemberLimitExceeded + | MessageTooLong + | NoExternalInvitePermission + | NotAllowedForGridWorkspace + | NotInChannel + | NotOwner + | NotPaid + | NotSupported + | Ratelimit + | RecipientsNotSpecified + | RestrictedAction + | TooManyEmails + | UrlInMessage + | UserNotFound + | SlackOpError; +/** Sends an invitation to a Slack Connect channel Required scopes -- bot: `conversations.connect:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `already_in_channel` -- User is already in the channel. - `cannot_share_cross_workspace_channel` -- You cannot share a cross-workspace or org-wide channel. - `cannot_share_mandatory_channel` -- You cannot share #general or mandatory channels. - `channel_archived` -- You cannot share an archived channel. - `channel_not_found` -- The channel provided was not found. - `connection_limit_exceeded` -- This channel has hit the limit of external connections. - `connection_limit_exceeded_pending` -- This channel already has a pending invite. - `invalid_channel_type` -- You cannot share MPDMs or DMs. - `invalid_email` -- At least one email address provided is invalid. - `invite_lookup_error` -- An error occurred while attempting to look for existing invites. - `invite_not_found` -- An error occurred while inviting users. - `legacy_connection_limit_exceeded` -- You cannot share a legacy ESC channel with a third team - `member_limit_exceeded` -- This channel that has hit the limit of members - `message_too_long` -- The provided message was longer than 560 characters. - `not_allowed_for_grid_workspace` -- This workspace does not have Slack Connect enabled. - `not_in_channel` -- The app is not a member of the channel to invite. - `not_owner` -- Only the host organization for a channel can request to share it. - `not_paid` -- This feature is only available to paid teams. - `not_supported` -- This channel cannot be shared. - `ratelimit` -- The rate-limit for this method has been reached. The ratelimit is applied on a per-user basis when you pass the `emails` parameter. - `recipients_not_specified` -- Bots are required to specify which users to invite. - `restricted_action` -- A team preference does not allow this authorization to send invites. - `too_many_emails` -- Too many email recipients were passed in the `emails` parameter. - `url_in_message` -- The message contained a URL. - `user_not_found` -- User lookup failed. - `no_external_invite_permission` -- User does not have permission to invite an external user. - `inviter_email_not_verified` -- The inviting user has not verified the email address on their own account. They must verify it before they can send Slack Connect invites, since the invite presents that address as theirs. See https://docs.slack.dev/reference/methods/conversations.inviteShared */ export const inviteShared: API.OperationMethod< InviteSharedRequest, InviteSharedResponse, InviteSharedError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(36, __c9, 0) as any as S.Schema, - output: __S(37, __c9, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(88, __c22, 0) as any as S.Schema, + output: __S(89, __c22, 1) as any as S.Schema, + errors: [ + AlreadyInChannel, + CannotShareCrossWorkspaceChannel, + CannotShareMandatoryChannel, + ChannelArchived, + ChannelNotFound, + ConnectionLimitExceeded, + ConnectionLimitExceededPending, + InvalidChannelType, + InvalidEmail, + InviteLookupError, + InviteNotFound, + InviterEmailNotVerified, + LegacyConnectionLimitExceeded, + MemberLimitExceeded, + MessageTooLong, + NoExternalInvitePermission, + NotAllowedForGridWorkspace, + NotInChannel, + NotOwner, + NotPaid, + NotSupported, + Ratelimit, + RecipientsNotSpecified, + RestrictedAction, + TooManyEmails, + UrlInMessage, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "InviteShared", })); -export type JoinConversationError = SlackOpError; -/** Joins an existing conversation. Required scopes -- user: `channels:write`; bot: `channels:join` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_is_limited_access` -- The user has no access to the channel. This is only applicable to private Salesforce record channels. - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `too_many_members` -- The membership in the channel has exceeded our maximum member limit. No more users can join the channel. - `app_cannot_join_channel` -- This app cannot join this channel. See https://docs.slack.dev/reference/methods/conversations.join */ +export type JoinConversationError = + | AppCannotJoinChannel + | ChannelIsLimitedAccess + | ChannelNotFound + | IsArchived + | MethodNotSupportedForChannelType + | MissingScope + | TooManyMembers + | SlackOpError; +/** Joins an existing conversation. Required scopes -- user: `channels:write`; bot: `channels:join` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `channel_is_limited_access` -- The user has no access to the channel. This is only applicable to private Salesforce record channels. - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `too_many_members` -- The membership in the channel has exceeded our maximum member limit. No more users can join the channel. - `app_cannot_join_channel` -- This app cannot join this channel. See https://docs.slack.dev/reference/methods/conversations.join */ export const joinConversation: API.OperationMethod< JoinConversationRequest, JoinConversationResponse, JoinConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(40, __c10, 0) as any as S.Schema, - output: __S(42, __c10, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(92, __c23, 0) as any as S.Schema, + output: __S(94, __c23, 2) as any as S.Schema, + errors: [ + AppCannotJoinChannel, + ChannelIsLimitedAccess, + ChannelNotFound, + IsArchived, + MethodNotSupportedForChannelType, + MissingScope, + TooManyMembers, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "JoinConversation", })); -export type LeaveConversationError = SlackOpError; -/** Leaves a conversation. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `cant_leave_general` -- Authenticated user cannot leave the general channel - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `last_member` -- The last member party to a channel cannot leave the channel. Someone else must join the channel before this user is permitted to exit. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `user_is_restricted` -- Restricted and guest users cannot leave channel See https://docs.slack.dev/reference/methods/conversations.leave */ +export type LeaveConversationError = + | CantLeaveGeneral + | ChannelNotFound + | IsArchived + | LastMember + | MethodNotSupportedForChannelType + | MissingScope + | UserIsRestricted + | SlackOpError; +/** Leaves a conversation. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `cant_leave_general` -- Authenticated user cannot leave the general channel - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `last_member` -- The last member party to a channel cannot leave the channel. Someone else must join the channel before this user is permitted to exit. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `user_is_restricted` -- Restricted and guest users cannot leave channel See https://docs.slack.dev/reference/methods/conversations.leave */ export const leaveConversation: API.OperationMethod< LeaveConversationRequest, LeaveConversationResponse, LeaveConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(44, __c11, 0) as any as S.Schema, - output: __S(45, __c11, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(96, __c24, 0) as any as S.Schema, + output: __S(97, __c24, 1) as any as S.Schema, + errors: [ + CantLeaveGeneral, + ChannelNotFound, + IsArchived, + LastMember, + MethodNotSupportedForChannelType, + MissingScope, + UserIsRestricted, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "LeaveConversation", })); -export type ListConnectInvitesError = SlackOpError; -/** Lists shared channel invites that have been generated or received but have not been approved by all parties Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- An invalid argument was supplied to the method. - `restricted_action` -- A team preference prevents the authenticated user from viewing shared channel invites. See https://docs.slack.dev/reference/methods/conversations.listConnectInvites */ +export type ListConnectInvitesError = InvalidArguments | RestrictedAction | SlackOpError; +/** Lists shared channel invites that have been generated or received but have not been approved by all parties Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- An invalid argument was supplied to the method. - `restricted_action` -- A team preference prevents the authenticated user from viewing shared channel invites. See https://docs.slack.dev/reference/methods/conversations.listConnectInvites */ export const listConnectInvites: API.PaginatedOperationMethod< ListConnectInvitesRequest, ListConnectInvitesResponse, @@ -865,9 +2870,9 @@ export const listConnectInvites: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(48, __c12, 0) as any as S.Schema, - output: __S(49, __c12, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(100, __c25, 0) as any as S.Schema, + output: __S(101, __c25, 1) as any as S.Schema, + errors: [InvalidArguments, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -882,8 +2887,15 @@ export const listConnectInvites: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListConversationsError = SlackOpError; -/** Lists all channels in a Slack team. Required scopes -- bot: `groups:read`, `im:read`, `mpim:read`, `channels:read`; user: `groups:read`, `im:read`, `mpim:read`, `channels:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_limit` -- Value passed for `limit` is not understood. - `invalid_types` -- Value passed for `type` could not be used based on the method's capabilities or the permission scopes granted to the used token. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_argument` -- A required argument is missing. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. See https://docs.slack.dev/reference/methods/conversations.list */ +export type ListConversationsError = + | InvalidCursor + | InvalidLimit + | InvalidTypes + | MethodNotSupportedForChannelType + | MissingArgument + | MissingScope + | SlackOpError; +/** Lists all channels in a Slack team. Required scopes -- bot: `groups:read`, `im:read`, `mpim:read`, `channels:read`; user: `groups:read`, `im:read`, `mpim:read`, `channels:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_limit` -- Value passed for `limit` is not understood. - `invalid_types` -- Value passed for `type` could not be used based on the method's capabilities or the permission scopes granted to the used token. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_argument` -- A required argument is missing. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. See https://docs.slack.dev/reference/methods/conversations.list */ export const listConversations: API.PaginatedOperationMethod< ListConversationsRequest, ListConversationsResponse, @@ -892,9 +2904,18 @@ export const listConversations: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(60, __c15, 0) as any as S.Schema, - output: __S(61, __c15, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(104, __c26, 0) as any as S.Schema, + output: __S(105, __c26, 1) as any as S.Schema, + errors: [ + InvalidCursor, + InvalidLimit, + InvalidTypes, + MethodNotSupportedForChannelType, + MissingArgument, + MissingScope, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -910,8 +2931,12 @@ export const listConversations: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListRequestSharedInviteError = SlackOpError; -/** Lists requests to add external users to channels with ability to filter. Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `restricted_action` -- A team preference prevents the user from listing invitation requests. - `invalid_cursor` -- The provided cursor is not valid. - `internal_error` -- Something unexpected went wrong. - `not_implemented` -- its not implemented! TODO: remove me See https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.list */ +export type ListRequestSharedInviteError = + | InvalidCursor + | NotImplemented + | RestrictedAction + | SlackOpError; +/** Lists requests to add external users to channels with ability to filter. Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `restricted_action` -- A team preference prevents the user from listing invitation requests. - `invalid_cursor` -- The provided cursor is not valid. - `internal_error` -- Something unexpected went wrong. - `not_implemented` -- its not implemented! TODO: remove me See https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.list */ export const listRequestSharedInvite: API.PaginatedOperationMethod< ListRequestSharedInviteRequest, ListRequestSharedInviteResponse, @@ -920,9 +2945,9 @@ export const listRequestSharedInvite: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(64, __c16, 0) as any as S.Schema, - output: __S(65, __c16, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(108, __c27, 0) as any as S.Schema, + output: __S(109, __c27, 1) as any as S.Schema, + errors: [InvalidCursor, NotImplemented, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -938,102 +2963,214 @@ export const listRequestSharedInvite: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type RenameConversationError = SlackOpError; -/** Renames a conversation. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `invalid_name` -- Value passed for `name` was invalid. - `invalid_name_maxlength` -- Value passed for `name` exceeded max length. - `invalid_name_punctuation` -- Value passed for `name` contained only punctuation. - `invalid_name_required` -- Value passed for `name` was empty. - `invalid_name_specials` -- Value passed for `name` contained unallowed special characters or upper case characters. - `is_archived` -- Cannot rename archived channel. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `name_taken` -- New channel name is taken. - `not_authorized` -- Caller cannot rename this channel. - `not_in_channel` -- Caller is not a member of the channel. See https://docs.slack.dev/reference/methods/conversations.rename */ +export type RenameConversationError = + | ChannelNotFound + | InvalidName + | InvalidNameMaxlength + | InvalidNamePunctuation + | InvalidNameRequired + | InvalidNameSpecials + | IsArchived + | MethodNotSupportedForChannelType + | MissingScope + | NameTaken + | NotAuthorized + | NotInChannel + | SlackOpError; +/** Renames a conversation. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `invalid_name` -- Value passed for `name` was invalid. - `invalid_name_maxlength` -- Value passed for `name` exceeded max length. - `invalid_name_punctuation` -- Value passed for `name` contained only punctuation. - `invalid_name_required` -- Value passed for `name` was empty. - `invalid_name_specials` -- Value passed for `name` contained unallowed special characters or upper case characters. - `is_archived` -- Cannot rename archived channel. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `name_taken` -- New channel name is taken. - `not_authorized` -- Caller cannot rename this channel. - `not_in_channel` -- Caller is not a member of the channel. See https://docs.slack.dev/reference/methods/conversations.rename */ export const renameConversation: API.OperationMethod< RenameConversationRequest, RenameConversationResponse, RenameConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(68, __c17, 0) as any as S.Schema, - output: __S(24, __c6, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(112, __c28, 0) as any as S.Schema, + output: __S(76, __c19, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + InvalidName, + InvalidNameMaxlength, + InvalidNamePunctuation, + InvalidNameRequired, + InvalidNameSpecials, + IsArchived, + MethodNotSupportedForChannelType, + MissingScope, + NameTaken, + NotAuthorized, + NotInChannel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RenameConversation", })); -export type RequestSharedInviteDenyError = SlackOpError; -/** Denies a request to invite an external user to a channel Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invite_not_found` -- We couldn't find a Slack Connect channel invite with the ID provided. - `user_not_found` -- We could not find the user who made the invite request. - `team_not_found` -- We could not find the team which made the invite request. - `channel_not_found` -- We could not find the channel where the request was made. - `invite_already_approved` -- This invite was already approved. - `invite_already_denied` -- This invite was already denied. - `invite_expired` -- This invite is expired. - `restricted_action` -- A team preference prevents the invite from being denied. - `internal_error` -- Something unexpected went wrong. - `message_too_long` -- If the passed in deny message is greater than 560 characters. See https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.deny */ +export type RequestSharedInviteDenyError = + | ChannelNotFound + | InviteAlreadyApproved + | InviteAlreadyDenied + | InviteExpired + | InviteNotFound + | MessageTooLong + | RestrictedAction + | TeamNotFound + | UserNotFound + | SlackOpError; +/** Denies a request to invite an external user to a channel Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invite_not_found` -- We couldn't find a Slack Connect channel invite with the ID provided. - `user_not_found` -- We could not find the user who made the invite request. - `team_not_found` -- We could not find the team which made the invite request. - `channel_not_found` -- We could not find the channel where the request was made. - `invite_already_approved` -- This invite was already approved. - `invite_already_denied` -- This invite was already denied. - `invite_expired` -- This invite is expired. - `restricted_action` -- A team preference prevents the invite from being denied. - `internal_error` -- Something unexpected went wrong. - `message_too_long` -- If the passed in deny message is greater than 560 characters. See https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.deny */ export const requestSharedInviteDeny: API.OperationMethod< RequestSharedInviteDenyRequest, RequestSharedInviteDenyResponse, RequestSharedInviteDenyError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(72, __c18, 0) as any as S.Schema, - output: __S(56, __c14, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(116, __c29, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + InviteAlreadyApproved, + InviteAlreadyDenied, + InviteExpired, + InviteNotFound, + MessageTooLong, + RestrictedAction, + TeamNotFound, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RequestSharedInviteDeny", })); -export type SetExternalInvitePermissionsError = SlackOpError; -/** Upgrade or downgrade Slack Connect channel permissions between 'can post only' and 'can post and invite'. Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Cannot find channel - `not_supported` -- Attempting to upgrade a channel that cannot be upgraded - `restricted_action` -- A team preference prevents the user from taking this action. - `invalid_target_team` -- The target team provided is not valid for the channel. - `invalid_action` -- The user did not provide a valid action. Valid actions are 'upgrade' or 'downgrade'. See https://docs.slack.dev/reference/methods/conversations.externalInvitePermissions.set */ +export type SetExternalInvitePermissionsError = + | ChannelNotFound + | InvalidAction + | InvalidTargetTeam + | NotSupported + | RestrictedAction + | SlackOpError; +/** Upgrade or downgrade Slack Connect channel permissions between 'can post only' and 'can post and invite'. Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Cannot find channel - `not_supported` -- Attempting to upgrade a channel that cannot be upgraded - `restricted_action` -- A team preference prevents the user from taking this action. - `invalid_target_team` -- The target team provided is not valid for the channel. - `invalid_action` -- The user did not provide a valid action. Valid actions are 'upgrade' or 'downgrade'. See https://docs.slack.dev/reference/methods/conversations.externalInvitePermissions.set */ export const setExternalInvitePermissions: API.OperationMethod< SetExternalInvitePermissionsRequest, SetExternalInvitePermissionsResponse, SetExternalInvitePermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(76, __c19, 0) as any as S.Schema, - output: __S(56, __c14, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(120, __c30, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + InvalidAction, + InvalidTargetTeam, + NotSupported, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetExternalInvitePermissions", })); -export type SetPurposeError = SlackOpError; -/** Sets the channel description. Required scopes -- bot: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:manage`, `groups:write`, `im:write`, `mpim:write`; user: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:write`, `groups:write`, `im:write`, `mpim:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `method_not_supported_for_channel_type` -- This conversation type cannot be used with this method. - `missing_scope` -- The calling token has not been granted the necessary scopes to complete this operation. - `not_in_channel` -- Authenticated user is not in the channel. - `too_long` -- Description was longer than 250 characters. - `user_is_restricted` -- Setting the channel description is a restricted action. See https://docs.slack.dev/reference/methods/conversations.setPurpose */ +export type SetPurposeError = + | ChannelNotFound + | IsArchived + | MethodNotSupportedForChannelType + | MissingScope + | NotInChannel + | TooLong + | UserIsRestricted + | SlackOpError; +/** Sets the channel description. Required scopes -- bot: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:manage`, `groups:write`, `im:write`, `mpim:write`; user: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:write`, `groups:write`, `im:write`, `mpim:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `method_not_supported_for_channel_type` -- This conversation type cannot be used with this method. - `missing_scope` -- The calling token has not been granted the necessary scopes to complete this operation. - `not_in_channel` -- Authenticated user is not in the channel. - `too_long` -- Description was longer than 250 characters. - `user_is_restricted` -- Setting the channel description is a restricted action. See https://docs.slack.dev/reference/methods/conversations.setPurpose */ export const setPurpose: API.OperationMethod< SetPurposeRequest, SetPurposeResponse, SetPurposeError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(80, __c20, 0) as any as S.Schema, - output: __S(24, __c6, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(124, __c31, 0) as any as S.Schema, + output: __S(76, __c19, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + IsArchived, + MethodNotSupportedForChannelType, + MissingScope, + NotInChannel, + TooLong, + UserIsRestricted, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetPurpose", })); -export type SetTopicError = SlackOpError; -/** Sets the topic for a conversation. Required scopes -- bot: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:manage`, `groups:write`, `im:write`, `mpim:write`; user: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:write`, `groups:write`, `im:write`, `mpim:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_in_channel` -- Authenticated user is not in the channel. - `too_long` -- Topic was longer than 250 characters. - `user_is_restricted` -- Setting the topic is a restricted action. See https://docs.slack.dev/reference/methods/conversations.setTopic */ +export type SetTopicError = + | ChannelNotFound + | IsArchived + | MethodNotSupportedForChannelType + | MissingScope + | NotInChannel + | TooLong + | UserIsRestricted + | SlackOpError; +/** Sets the topic for a conversation. Required scopes -- bot: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:manage`, `groups:write`, `im:write`, `mpim:write`; user: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:write`, `groups:write`, `im:write`, `mpim:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `is_archived` -- Channel has been archived. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_in_channel` -- Authenticated user is not in the channel. - `too_long` -- Topic was longer than 250 characters. - `user_is_restricted` -- Setting the topic is a restricted action. See https://docs.slack.dev/reference/methods/conversations.setTopic */ export const setTopic: API.OperationMethod< SetTopicRequest, SetTopicResponse, SetTopicError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(84, __c21, 0) as any as S.Schema, - output: __S(24, __c6, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(128, __c32, 0) as any as S.Schema, + output: __S(76, __c19, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + IsArchived, + MethodNotSupportedForChannelType, + MissingScope, + NotInChannel, + TooLong, + UserIsRestricted, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetTopic", })); -export type UnarchiveConversationError = SlackOpError; -/** Reverses conversation archival. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_archived` -- Channel is not archived. See https://docs.slack.dev/reference/methods/conversations.unarchive */ +export type UnarchiveConversationError = + | ChannelNotFound + | MethodNotSupportedForChannelType + | MissingScope + | NotArchived + | SlackOpError; +/** Reverses conversation archival. Required scopes -- bot: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`; user: `groups:write`, `im:write`, `mpim:write`, `channels:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. - `not_archived` -- Channel is not archived. See https://docs.slack.dev/reference/methods/conversations.unarchive */ export const unarchiveConversation: API.OperationMethod< UnarchiveConversationRequest, UnarchiveConversationResponse, UnarchiveConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(88, __c22, 0) as any as S.Schema, - output: __S(56, __c14, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(132, __c33, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + MethodNotSupportedForChannelType, + MissingScope, + NotArchived, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -1102,26 +3239,51 @@ function __c2(j: number): any { case 0: return S.suspend(() => S.Struct({ - channel: S.optional(S.NullOr(S.String)), - return_im: S.optional(S.Boolean), - users: S.optional(S.String), - prevent_creation: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/conversations.open", code: 200 })), - ).annotate({ identifier: "ConversationsOpenRequest" }); + invite_id: S.String, + target_team: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/conversations.approveSharedInvite", code: 200 })), + ).annotate({ identifier: "ApproveSharedInviteRequest" }); + } +} +function __c3(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + }), + ).annotate({ identifier: "ApproveSharedInviteResponse" }); + } +} +function __c4(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel: S.String, + }).pipe(T.Http({ method: "POST", uri: "/conversations.archive", code: 200 })), + ).annotate({ identifier: "ArchiveConversationRequest" }); + } +} +function __c5(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel: S.String, + }).pipe(T.Http({ method: "POST", uri: "/conversations.close", code: 200 })), + ).annotate({ identifier: "ConversationsCloseRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, - already_open: S.optional(S.Boolean), + already_closed: S.optional(S.Boolean), no_op: S.optional(S.Boolean), - channel: S.optional(S.Unknown), - app_home: S.optional(S.Unknown), - home_view: S.optional(S.NullOr(S.Unknown)), }), - ).annotate({ identifier: "ConversationsOpenResponse" }); + ).annotate({ identifier: "ConversationsCloseResponse" }); } } -function __c3(j: number): any { +function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1133,71 +3295,242 @@ function __c3(j: number): any { latest: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), oldest: S.optional(S.String.pipe(T.Query())), - ts: S.String.pipe(T.Query()), - }).pipe(T.Http({ method: "GET", uri: "/conversations.replies", code: 200 })), - ).annotate({ identifier: "ConversationsRepliesRequest" }); + }).pipe(T.Http({ method: "GET", uri: "/conversations.history", code: 200 })), + ).annotate({ identifier: "ConversationsHistoryRequest" }); case 1: + return S.suspend(() => + S.Struct({ + latest: S.String, + updated: S.String, + history_invalid: S.String, + }), + ).annotate({ identifier: "ConversationsHistoryResponseMutationTimestamps" }); + case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, - has_more: S.optional(S.Boolean), - messages: __S(104, __c26, 0), - latest_updates: S.optional(__S(108, __c27, 0)), - unchanged_messages: S.optional(__S(112, __c28, 0)), - response_metadata: S.optional(__S(116, __c29, 0)), + messages: __S(40, __c10, 0), + has_more: S.Boolean, + pin_count: S.optional(S.Number), + channel_actions_ts: S.Unknown, + channel_actions_count: S.Number, + response_metadata: S.optional(__S(36, __c9, 0)), + oldest: S.optional(S.String), + is_limited: S.optional(S.Boolean), + latest: S.optional(S.String), + unread_count_display: S.optional(S.Number), + users: S.optional(__S(28, __c7, 0)), + deleted: S.optional(__S(32, __c8, 0)), + mutation_timestamps: S.optional(__S(25, __c6, 1)), + deleted_overflow: S.optional(S.Boolean), + warnings: S.optional(__S(32, __c8, 0)), + next_ts: S.optional(S.Number), + latest_updates: S.optional(__S(28, __c7, 0)), + unchanged_messages: S.optional(__S(32, __c8, 0)), + date_joined: S.optional(S.Number), }), - ).annotate({ identifier: "ConversationsRepliesResponse" }); + ).annotate({ identifier: "ConversationsHistoryResponse" }); } } -function __c4(j: number): any { +function __c7(j: number): any { switch (j) { case 0: - return S.suspend(() => - S.Struct({ - channel_id: S.String, - document_content: S.optional(S.Unknown), - title: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/conversations.canvases.create", code: 200 })), - ).annotate({ identifier: "CreateCanvaseRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - canvas_id: S.String, - }), - ).annotate({ identifier: "CreateCanvaseResponse" }); + return S.Record(S.String, S.Unknown); } } -function __c5(j: number): any { +function __c8(j: number): any { switch (j) { case 0: - return S.suspend(() => - S.Struct({ - is_private: S.optional(S.Boolean), - name: S.String, - team_id: S.optional(S.NullOr(S.String)), - }).pipe(T.Http({ method: "POST", uri: "/conversations.create", code: 200 })), - ).annotate({ identifier: "CreateConversationRequest" }); + return S.Array(S.String); } } -function __c6(j: number): any { +function __c9(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - ok: S.Boolean, - channel: S.Unknown, + next_cursor: S.optional(S.String), }), - ).annotate({ identifier: "CreateConversationResponse" }); + ).annotate({ identifier: "ConversationsHistoryResponseResponseMetadata" }); } } -function __c7(j: number): any { +function __c10(j: number): any { + switch (j) { + case 0: + return S.Array(S.Unknown); + } +} +function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - channel: S.String, - force: S.optional(S.Boolean), + channel: S.String.pipe(T.Query()), + include_locale: S.optional(S.Boolean.pipe(T.Query())), + include_num_members: S.optional(S.Boolean.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/conversations.info", code: 200 })), + ).annotate({ identifier: "ConversationsInfoRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + app_home: S.optional(S.Unknown), + channel: S.Unknown, + home_view: S.optional(S.NullOr(S.Unknown)), + }), + ).annotate({ identifier: "ConversationsInfoResponse" }); + } +} +function __c12(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel: S.String, + user: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/conversations.kick", code: 200 })), + ).annotate({ identifier: "ConversationsKickRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + errors: S.optional(__S(28, __c7, 0)), + }), + ).annotate({ identifier: "ConversationsKickResponse" }); + } +} +function __c13(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel: S.String, + ts: S.String, + }).pipe(T.Http({ method: "POST", uri: "/conversations.mark", code: 200 })), + ).annotate({ identifier: "ConversationsMarkRequest" }); + } +} +function __c14(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel: S.String.pipe(T.Query()), + cursor: S.optional(S.String.pipe(T.Query())), + limit: S.optional(S.Number.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/conversations.members", code: 200 })), + ).annotate({ identifier: "ConversationsMembersRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + members: __S(32, __c8, 0), + response_metadata: S.optional(__S(36, __c9, 0)), + }), + ).annotate({ identifier: "ConversationsMembersResponse" }); + } +} +function __c15(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel: S.optional(S.NullOr(S.String)), + return_im: S.optional(S.Boolean), + users: S.optional(S.String), + prevent_creation: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/conversations.open", code: 200 })), + ).annotate({ identifier: "ConversationsOpenRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + already_open: S.optional(S.Boolean), + no_op: S.optional(S.Boolean), + channel: S.optional(S.Unknown), + app_home: S.optional(S.Unknown), + home_view: S.optional(S.NullOr(S.Unknown)), + }), + ).annotate({ identifier: "ConversationsOpenResponse" }); + } +} +function __c16(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel: S.String.pipe(T.Query()), + cursor: S.optional(S.String.pipe(T.Query())), + include_all_metadata: S.optional(S.Boolean.pipe(T.Query())), + inclusive: S.optional(S.Boolean.pipe(T.Query())), + latest: S.optional(S.String.pipe(T.Query())), + limit: S.optional(S.Number.pipe(T.Query())), + oldest: S.optional(S.String.pipe(T.Query())), + ts: S.String.pipe(T.Query()), + }).pipe(T.Http({ method: "GET", uri: "/conversations.replies", code: 200 })), + ).annotate({ identifier: "ConversationsRepliesRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + has_more: S.optional(S.Boolean), + messages: __S(40, __c10, 0), + latest_updates: S.optional(__S(28, __c7, 0)), + unchanged_messages: S.optional(__S(32, __c8, 0)), + response_metadata: S.optional(__S(36, __c9, 0)), + }), + ).annotate({ identifier: "ConversationsRepliesResponse" }); + } +} +function __c17(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel_id: S.String, + document_content: S.optional(S.Unknown), + title: S.optional(S.String), + }).pipe(T.Http({ method: "POST", uri: "/conversations.canvases.create", code: 200 })), + ).annotate({ identifier: "CreateCanvaseRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + canvas_id: S.String, + }), + ).annotate({ identifier: "CreateCanvaseResponse" }); + } +} +function __c18(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + is_private: S.optional(S.Boolean), + name: S.String, + team_id: S.optional(S.NullOr(S.String)), + }).pipe(T.Http({ method: "POST", uri: "/conversations.create", code: 200 })), + ).annotate({ identifier: "CreateConversationRequest" }); + } +} +function __c19(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + channel: S.Unknown, + }), + ).annotate({ identifier: "CreateConversationResponse" }); + } +} +function __c20(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channel: S.String, + force: S.optional(S.Boolean), users: S.String, }).pipe(T.Http({ method: "POST", uri: "/conversations.invite", code: 200 })), ).annotate({ identifier: "InviteConversationRequest" }); @@ -1207,12 +3540,12 @@ function __c7(j: number): any { ok: S.Boolean, channel: S.optional(S.Unknown), group: S.optional(S.Unknown), - errors: S.optional(__S(104, __c26, 0)), + errors: S.optional(__S(40, __c10, 0)), }), ).annotate({ identifier: "InviteConversationResponse" }); } } -function __c8(j: number): any { +function __c21(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1223,14 +3556,14 @@ function __c8(j: number): any { ).annotate({ identifier: "InviteDeclineSharedRequest" }); } } -function __c9(j: number): any { +function __c22(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ channel: S.String, - emails: S.optional(__S(112, __c28, 0)), - user_ids: S.optional(__S(112, __c28, 0)), + emails: S.optional(__S(32, __c8, 0)), + user_ids: S.optional(__S(32, __c8, 0)), external_limited: S.optional(S.Boolean), }).pipe(T.Http({ method: "POST", uri: "/conversations.inviteShared", code: 200 })), ).annotate({ identifier: "InviteSharedRequest" }); @@ -1246,7 +3579,7 @@ function __c9(j: number): any { ).annotate({ identifier: "InviteSharedResponse" }); } } -function __c10(j: number): any { +function __c23(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1257,7 +3590,7 @@ function __c10(j: number): any { case 1: return S.suspend(() => S.Struct({ - warnings: S.optional(__S(112, __c28, 0)), + warnings: S.optional(__S(32, __c8, 0)), }), ).annotate({ identifier: "JoinConversationResponseResponseMetadata" }); case 2: @@ -1265,12 +3598,12 @@ function __c10(j: number): any { S.Struct({ ok: S.Boolean, channel: S.Unknown, - response_metadata: S.optional(__S(41, __c10, 1)), + response_metadata: S.optional(__S(93, __c23, 1)), }), ).annotate({ identifier: "JoinConversationResponse" }); } } -function __c11(j: number): any { +function __c24(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1287,7 +3620,7 @@ function __c11(j: number): any { ).annotate({ identifier: "LeaveConversationResponse" }); } } -function __c12(j: number): any { +function __c25(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1301,34 +3634,13 @@ function __c12(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - invites: __S(104, __c26, 0), - response_metadata: S.optional(__S(116, __c29, 0)), + invites: __S(40, __c10, 0), + response_metadata: S.optional(__S(36, __c9, 0)), }), ).annotate({ identifier: "ListConnectInvitesResponse" }); } } -function __c13(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - invite_id: S.String, - target_team: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/conversations.approveSharedInvite", code: 200 })), - ).annotate({ identifier: "ApproveSharedInviteRequest" }); - } -} -function __c14(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - }), - ).annotate({ identifier: "ApproveSharedInviteResponse" }); - } -} -function __c15(j: number): any { +function __c26(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1344,13 +3656,13 @@ function __c15(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - channels: __S(104, __c26, 0), - response_metadata: S.optional(__S(116, __c29, 0)), + channels: __S(40, __c10, 0), + response_metadata: S.optional(__S(36, __c9, 0)), }), ).annotate({ identifier: "ListConversationsResponse" }); } } -function __c16(j: number): any { +function __c27(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1359,7 +3671,7 @@ function __c16(j: number): any { include_expired: S.optional(S.Boolean), include_approved: S.optional(S.Boolean), include_denied: S.optional(S.Boolean), - invite_ids: S.optional(__S(112, __c28, 0)), + invite_ids: S.optional(__S(32, __c8, 0)), limit: S.optional(S.Number), cursor: S.optional(S.String), }).pipe( @@ -1370,13 +3682,13 @@ function __c16(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - invite_requests: __S(104, __c26, 0), - response_metadata: S.optional(__S(116, __c29, 0)), + invite_requests: __S(40, __c10, 0), + response_metadata: S.optional(__S(36, __c9, 0)), }), ).annotate({ identifier: "ListRequestSharedInviteResponse" }); } } -function __c17(j: number): any { +function __c28(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1387,7 +3699,7 @@ function __c17(j: number): any { ).annotate({ identifier: "RenameConversationRequest" }); } } -function __c18(j: number): any { +function __c29(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1400,7 +3712,7 @@ function __c18(j: number): any { ).annotate({ identifier: "RequestSharedInviteDenyRequest" }); } } -function __c19(j: number): any { +function __c30(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1419,7 +3731,7 @@ function __c19(j: number): any { ).annotate({ identifier: "SetExternalInvitePermissionsRequest" }); } } -function __c20(j: number): any { +function __c31(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1430,7 +3742,7 @@ function __c20(j: number): any { ).annotate({ identifier: "SetPurposeRequest" }); } } -function __c21(j: number): any { +function __c32(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1441,7 +3753,7 @@ function __c21(j: number): any { ).annotate({ identifier: "SetTopicRequest" }); } } -function __c22(j: number): any { +function __c33(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1451,181 +3763,6 @@ function __c22(j: number): any { ).annotate({ identifier: "UnarchiveConversationRequest" }); } } -function __c23(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channel: S.String, - }).pipe(T.Http({ method: "POST", uri: "/conversations.archive", code: 200 })), - ).annotate({ identifier: "ArchiveConversationRequest" }); - } -} -function __c24(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channel: S.String, - }).pipe(T.Http({ method: "POST", uri: "/conversations.close", code: 200 })), - ).annotate({ identifier: "ConversationsCloseRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - already_closed: S.optional(S.Boolean), - no_op: S.optional(S.Boolean), - }), - ).annotate({ identifier: "ConversationsCloseResponse" }); - } -} -function __c25(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channel: S.String.pipe(T.Query()), - cursor: S.optional(S.String.pipe(T.Query())), - include_all_metadata: S.optional(S.Boolean.pipe(T.Query())), - inclusive: S.optional(S.Boolean.pipe(T.Query())), - latest: S.optional(S.String.pipe(T.Query())), - limit: S.optional(S.Number.pipe(T.Query())), - oldest: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/conversations.history", code: 200 })), - ).annotate({ identifier: "ConversationsHistoryRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - latest: S.String, - updated: S.String, - history_invalid: S.String, - }), - ).annotate({ identifier: "ConversationsHistoryResponseMutationTimestamps" }); - case 2: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - messages: __S(104, __c26, 0), - has_more: S.Boolean, - pin_count: S.optional(S.Number), - channel_actions_ts: S.Unknown, - channel_actions_count: S.Number, - response_metadata: S.optional(__S(116, __c29, 0)), - oldest: S.optional(S.String), - is_limited: S.optional(S.Boolean), - latest: S.optional(S.String), - unread_count_display: S.optional(S.Number), - users: S.optional(__S(108, __c27, 0)), - deleted: S.optional(__S(112, __c28, 0)), - mutation_timestamps: S.optional(__S(101, __c25, 1)), - deleted_overflow: S.optional(S.Boolean), - warnings: S.optional(__S(112, __c28, 0)), - next_ts: S.optional(S.Number), - latest_updates: S.optional(__S(108, __c27, 0)), - unchanged_messages: S.optional(__S(112, __c28, 0)), - date_joined: S.optional(S.Number), - }), - ).annotate({ identifier: "ConversationsHistoryResponse" }); - } -} -function __c26(j: number): any { - switch (j) { - case 0: - return S.Array(S.Unknown); - } -} -function __c27(j: number): any { - switch (j) { - case 0: - return S.Record(S.String, S.Unknown); - } -} -function __c28(j: number): any { - switch (j) { - case 0: - return S.Array(S.String); - } -} -function __c29(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - next_cursor: S.optional(S.String), - }), - ).annotate({ identifier: "ConversationsHistoryResponseResponseMetadata" }); - } -} -function __c30(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channel: S.String.pipe(T.Query()), - include_locale: S.optional(S.Boolean.pipe(T.Query())), - include_num_members: S.optional(S.Boolean.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/conversations.info", code: 200 })), - ).annotate({ identifier: "ConversationsInfoRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - app_home: S.optional(S.Unknown), - channel: S.Unknown, - home_view: S.optional(S.NullOr(S.Unknown)), - }), - ).annotate({ identifier: "ConversationsInfoResponse" }); - } -} -function __c31(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channel: S.String, - user: S.optional(S.String), - }).pipe(T.Http({ method: "POST", uri: "/conversations.kick", code: 200 })), - ).annotate({ identifier: "ConversationsKickRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - errors: S.optional(__S(108, __c27, 0)), - }), - ).annotate({ identifier: "ConversationsKickResponse" }); - } -} -function __c32(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channel: S.String, - ts: S.String, - }).pipe(T.Http({ method: "POST", uri: "/conversations.mark", code: 200 })), - ).annotate({ identifier: "ConversationsMarkRequest" }); - } -} -function __c33(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channel: S.String.pipe(T.Query()), - cursor: S.optional(S.String.pipe(T.Query())), - limit: S.optional(S.Number.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/conversations.members", code: 200 })), - ).annotate({ identifier: "ConversationsMembersRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - members: __S(112, __c28, 0), - response_metadata: S.optional(__S(116, __c29, 0)), - }), - ).annotate({ identifier: "ConversationsMembersResponse" }); - } -} // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); diff --git a/packages/slack/src/services/dialog.ts b/packages/slack/src/services/dialog.ts index 2e678a8ea4..8d57e72b61 100644 --- a/packages/slack/src/services/dialog.ts +++ b/packages/slack/src/services/dialog.ts @@ -24,6 +24,123 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `app_missing_action_url` -- The app associated with the used token doesn't have a Action URL configured in its interactive components settings. */ +export class AppMissingActionUrl + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppMissingActionUrl", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_missing_action_url" } }], + ) {} + +/** `cannot_create_dialog` -- Something exceptional occurred and the dialog could not be created. */ +export class CannotCreateDialog + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotCreateDialog", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_create_dialog" } }], + ) {} + +/** `failed_sending_dialog` -- Something exceptional occurred and the dialog could not be sent. */ +export class FailedSendingDialog + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedSendingDialog", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_sending_dialog" } }], + ) {} + +/** `invalid_trigger` -- The provided `trigger_id` is invalid or cannot be used by this token. */ +export class InvalidTrigger + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTrigger", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_trigger" } }], + ) {} + +/** `missing_dialog` -- No `dialog` argument was presented. */ +export class MissingDialog + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingDialog", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_dialog" } }], + ) {} + +/** `missing_trigger` -- No `trigger_id` argument was presented. */ +export class MissingTrigger + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingTrigger", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_trigger" } }], + ) {} + +/** `trigger_exchanged` -- The provided `trigger_id` has already been exchanged. */ +export class TriggerExchanged + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TriggerExchanged", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "trigger_exchanged" } }], + ) {} + +/** `trigger_expired` -- The provided `trigger_id` was presented after the 3 second limit. */ +export class TriggerExpired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TriggerExpired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "trigger_expired" } }], + ) {} + +/** `validation_errors` -- The provided `dialog` could not be validated. */ +export class ValidationErrors + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ValidationErrors", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "validation_errors" } }], + ) {} + export interface DialogOpenRequest { /** The dialog definition. This must be a JSON-encoded string. */ dialog: string; @@ -34,8 +151,18 @@ export interface DialogOpenResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type DialogOpenError = SlackOpError; -/** Open a dialog with a user Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `app_missing_action_url` -- The app associated with the used token doesn't have a Action URL configured in its interactive components settings. - `cannot_create_dialog` -- Something exceptional occurred and the dialog could not be created. - `failed_sending_dialog` -- Something exceptional occurred and the dialog could not be sent. - `invalid_trigger` -- The provided `trigger_id` is invalid or cannot be used by this token. - `missing_dialog` -- No `dialog` argument was presented. - `missing_trigger` -- No `trigger_id` argument was presented. - `trigger_exchanged` -- The provided `trigger_id` has already been exchanged. - `trigger_expired` -- The provided `trigger_id` was presented after the 3 second limit. - `validation_errors` -- The provided `dialog` could not be validated. See https://docs.slack.dev/reference/methods/dialog.open */ +export type DialogOpenError = + | AppMissingActionUrl + | CannotCreateDialog + | FailedSendingDialog + | InvalidTrigger + | MissingDialog + | MissingTrigger + | TriggerExchanged + | TriggerExpired + | ValidationErrors + | SlackOpError; +/** Open a dialog with a user Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `app_missing_action_url` -- The app associated with the used token doesn't have a Action URL configured in its interactive components settings. - `cannot_create_dialog` -- Something exceptional occurred and the dialog could not be created. - `failed_sending_dialog` -- Something exceptional occurred and the dialog could not be sent. - `invalid_trigger` -- The provided `trigger_id` is invalid or cannot be used by this token. - `missing_dialog` -- No `dialog` argument was presented. - `missing_trigger` -- No `trigger_id` argument was presented. - `trigger_exchanged` -- The provided `trigger_id` has already been exchanged. - `trigger_expired` -- The provided `trigger_id` was presented after the 3 second limit. - `validation_errors` -- The provided `dialog` could not be validated. See https://docs.slack.dev/reference/methods/dialog.open */ export const dialogOpen: API.OperationMethod< DialogOpenRequest, DialogOpenResponse, @@ -44,7 +171,19 @@ export const dialogOpen: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AppMissingActionUrl, + CannotCreateDialog, + FailedSendingDialog, + InvalidTrigger, + MissingDialog, + MissingTrigger, + TriggerExchanged, + TriggerExpired, + ValidationErrors, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/dnd.ts b/packages/slack/src/services/dnd.ts index c4c38919b6..f037e4b7d5 100644 --- a/packages/slack/src/services/dnd.ts +++ b/packages/slack/src/services/dnd.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,110 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `missing_duration` -- No value provided for `num_minutes` */ +export class MissingDuration + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingDuration", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_duration" } }], + ) {} + +/** `not_in_dnd` -- The auth'd user isn't in DND mode. */ +export class NotInDnd + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotInDnd", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_in_dnd" } }], + ) {} + +/** `no_users_provided` -- Must provide more than one user. */ +export class NoUsersProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoUsersProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_users_provided" } }], + ) {} + +/** `snooze_end_failed` -- There was a problem setting the user's Do Not Disturb status */ +export class SnoozeEndFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SnoozeEndFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "snooze_end_failed" } }], + ) {} + +/** `snooze_failed` -- There was a problem setting the user's Do Not Disturb status */ +export class SnoozeFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SnoozeFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "snooze_failed" } }], + ) {} + +/** `too_long` -- The value for `num_minutes` was too large */ +export class TooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_long" } }], + ) {} + +/** `user_not_found` -- Value passed for `user` was invalid. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + +/** `user_not_visible` -- User is not visible for this request. */ +export class UserNotVisible + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotVisible", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_not_visible" } }], + ) {} + export interface DndInfoRequest { /** User to fetch status for (defaults to current user) */ user?: string | undefined; @@ -83,85 +188,85 @@ export interface TeamInfoResponse { ok: boolean; users: TeamInfoResponseUsersMap; } -export type DndInfoError = SlackOpError; -/** Retrieves a user's current Do Not Disturb status. Required scopes -- bot: `dnd:read`; user: `dnd:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `user_not_found` -- Value passed for `user` was invalid. - `user_not_visible` -- User is not visible for this request. See https://docs.slack.dev/reference/methods/dnd.info */ +export type DndInfoError = UserNotFound | UserNotVisible | SlackOpError; +/** Retrieves a user's current Do Not Disturb status. Required scopes -- bot: `dnd:read`; user: `dnd:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `user_not_found` -- Value passed for `user` was invalid. - `user_not_visible` -- User is not visible for this request. See https://docs.slack.dev/reference/methods/dnd.info */ export const dndInfo: API.OperationMethod< DndInfoRequest, DndInfoResponse, DndInfoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(0, __c0, 0) as any as S.Schema, - output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(12, __c3, 0) as any as S.Schema, + output: __S(13, __c3, 1) as any as S.Schema, + errors: [UserNotFound, UserNotVisible, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DndInfo", })); -export type EndDndError = SlackOpError; -/** Ends the current user's Do Not Disturb session immediately. Required scopes -- user: `dnd:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_in_dnd` -- The auth'd user isn't in DND mode. See https://docs.slack.dev/reference/methods/dnd.endDnd */ +export type EndDndError = NotInDnd | SlackOpError; +/** Ends the current user's Do Not Disturb session immediately. Required scopes -- user: `dnd:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `not_in_dnd` -- The auth'd user isn't in DND mode. See https://docs.slack.dev/reference/methods/dnd.endDnd */ export const endDnd: API.OperationMethod< EndDndRequest, EndDndResponse, EndDndError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(4, __c1, 0) as any as S.Schema, - output: __S(5, __c1, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(16, __c4, 0) as any as S.Schema, + output: __S(17, __c4, 1) as any as S.Schema, + errors: [NotInDnd, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "EndDnd", })); -export type EndSnoozeError = SlackOpError; -/** Ends the current user's snooze mode immediately. Required scopes -- user: `dnd:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `snooze_end_failed` -- There was a problem setting the user's Do Not Disturb status See https://docs.slack.dev/reference/methods/dnd.endSnooze */ +export type EndSnoozeError = SnoozeEndFailed | SlackOpError; +/** Ends the current user's snooze mode immediately. Required scopes -- user: `dnd:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `snooze_end_failed` -- There was a problem setting the user's Do Not Disturb status See https://docs.slack.dev/reference/methods/dnd.endSnooze */ export const endSnooze: API.OperationMethod< EndSnoozeRequest, EndSnoozeResponse, EndSnoozeError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(8, __c2, 0) as any as S.Schema, - output: __S(9, __c2, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(0, __c0, 0) as any as S.Schema, + output: __S(1, __c0, 1) as any as S.Schema, + errors: [SnoozeEndFailed, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "EndSnooze", })); -export type SetSnoozeError = SlackOpError; -/** Turns on Do Not Disturb mode for the current user, or changes its duration. Required scopes -- user: `dnd:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_duration` -- No value provided for `num_minutes` - `snooze_failed` -- There was a problem setting the user's Do Not Disturb status - `too_long` -- The value for `num_minutes` was too large See https://docs.slack.dev/reference/methods/dnd.setSnooze */ +export type SetSnoozeError = MissingDuration | SnoozeFailed | TooLong | SlackOpError; +/** Turns on Do Not Disturb mode for the current user, or changes its duration. Required scopes -- user: `dnd:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `missing_duration` -- No value provided for `num_minutes` - `snooze_failed` -- There was a problem setting the user's Do Not Disturb status - `too_long` -- The value for `num_minutes` was too large See https://docs.slack.dev/reference/methods/dnd.setSnooze */ export const setSnooze: API.OperationMethod< SetSnoozeRequest, SetSnoozeResponse, SetSnoozeError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(12, __c3, 0) as any as S.Schema, - output: __S(13, __c3, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(4, __c1, 0) as any as S.Schema, + output: __S(5, __c1, 1) as any as S.Schema, + errors: [MissingDuration, SnoozeFailed, TooLong, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetSnooze", })); -export type TeamInfoError = SlackOpError; -/** Retrieves the Do Not Disturb status for up to 50 users on a team. Required scopes -- bot: `dnd:read`; user: `dnd:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `no_users_provided` -- Must provide more than one user. - `user_not_visible` -- User is not visible for this request. See https://docs.slack.dev/reference/methods/dnd.teamInfo */ +export type TeamInfoError = NoUsersProvided | UserNotVisible | SlackOpError; +/** Retrieves the Do Not Disturb status for up to 50 users on a team. Required scopes -- bot: `dnd:read`; user: `dnd:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `no_users_provided` -- Must provide more than one user. - `user_not_visible` -- User is not visible for this request. See https://docs.slack.dev/reference/methods/dnd.teamInfo */ export const teamInfo: API.OperationMethod< TeamInfoRequest, TeamInfoResponse, TeamInfoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(16, __c4, 0) as any as S.Schema, - output: __S(18, __c4, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(8, __c2, 0) as any as S.Schema, + output: __S(10, __c2, 2) as any as S.Schema, + errors: [NoUsersProvided, UserNotVisible, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -173,60 +278,61 @@ function __c0(j: number): any { switch (j) { case 0: return S.suspend(() => - S.Struct({ - user: S.optional(S.String.pipe(T.Query())), - team_id: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/dnd.info", code: 200 })), - ).annotate({ identifier: "DndInfoRequest" }); + S.Struct({}).pipe(T.Http({ method: "POST", uri: "/dnd.endSnooze", code: 200 })), + ).annotate({ identifier: "EndSnoozeRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, + snooze_enabled: S.Boolean, dnd_enabled: S.Boolean, - next_dnd_start_ts: S.Number, next_dnd_end_ts: S.Number, - snooze_enabled: S.optional(S.Boolean), + next_dnd_start_ts: S.Number, snooze_endtime: S.optional(S.Number), snooze_remaining: S.optional(S.Number), - snooze_is_indefinite: S.optional(S.Boolean), dnd_profile_status: S.optional(S.Unknown), }), - ).annotate({ identifier: "DndInfoResponse" }); + ).annotate({ identifier: "EndSnoozeResponse" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => - S.Struct({}).pipe(T.Http({ method: "POST", uri: "/dnd.endDnd", code: 200 })), - ).annotate({ identifier: "EndDndRequest" }); + S.Struct({ + num_minutes: S.String, + }).pipe(T.Http({ method: "POST", uri: "/dnd.setSnooze", code: 200 })), + ).annotate({ identifier: "SetSnoozeRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, + snooze_endtime: S.optional(S.Number), + snooze_enabled: S.Boolean, + snooze_remaining: S.optional(S.Number), + snooze_is_indefinite: S.optional(S.Boolean), }), - ).annotate({ identifier: "EndDndResponse" }); + ).annotate({ identifier: "SetSnoozeResponse" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => - S.Struct({}).pipe(T.Http({ method: "POST", uri: "/dnd.endSnooze", code: 200 })), - ).annotate({ identifier: "EndSnoozeRequest" }); + S.Struct({ + users: S.String.pipe(T.Query()), + team_id: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/dnd.teamInfo", code: 200 })), + ).annotate({ identifier: "TeamInfoRequest" }); case 1: + return S.Record(S.String, S.Unknown); + case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, - snooze_enabled: S.Boolean, - dnd_enabled: S.Boolean, - next_dnd_end_ts: S.Number, - next_dnd_start_ts: S.Number, - snooze_endtime: S.optional(S.Number), - snooze_remaining: S.optional(S.Number), - dnd_profile_status: S.optional(S.Unknown), + users: __S(9, __c2, 1), }), - ).annotate({ identifier: "EndSnoozeResponse" }); + ).annotate({ identifier: "TeamInfoResponse" }); } } function __c3(j: number): any { @@ -234,39 +340,38 @@ function __c3(j: number): any { case 0: return S.suspend(() => S.Struct({ - num_minutes: S.String, - }).pipe(T.Http({ method: "POST", uri: "/dnd.setSnooze", code: 200 })), - ).annotate({ identifier: "SetSnoozeRequest" }); + user: S.optional(S.String.pipe(T.Query())), + team_id: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/dnd.info", code: 200 })), + ).annotate({ identifier: "DndInfoRequest" }); case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, + dnd_enabled: S.Boolean, + next_dnd_start_ts: S.Number, + next_dnd_end_ts: S.Number, + snooze_enabled: S.optional(S.Boolean), snooze_endtime: S.optional(S.Number), - snooze_enabled: S.Boolean, snooze_remaining: S.optional(S.Number), snooze_is_indefinite: S.optional(S.Boolean), + dnd_profile_status: S.optional(S.Unknown), }), - ).annotate({ identifier: "SetSnoozeResponse" }); + ).annotate({ identifier: "DndInfoResponse" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => - S.Struct({ - users: S.String.pipe(T.Query()), - team_id: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/dnd.teamInfo", code: 200 })), - ).annotate({ identifier: "TeamInfoRequest" }); + S.Struct({}).pipe(T.Http({ method: "POST", uri: "/dnd.endDnd", code: 200 })), + ).annotate({ identifier: "EndDndRequest" }); case 1: - return S.Record(S.String, S.Unknown); - case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, - users: __S(17, __c4, 1), }), - ).annotate({ identifier: "TeamInfoResponse" }); + ).annotate({ identifier: "EndDndResponse" }); } } // Schema table: entry i is schema j of builder f, made on first reach. diff --git a/packages/slack/src/services/emoji.ts b/packages/slack/src/services/emoji.ts index 388a94d649..fe4ffc4543 100644 --- a/packages/slack/src/services/emoji.ts +++ b/packages/slack/src/services/emoji.ts @@ -24,6 +24,32 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `invalid_arguments` -- Invalid API arguments provided */ +export class InvalidArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_arguments" } }], + ) {} + +/** `unable_to_fetch_custom_emojis` -- Unable to fetch custom emojis for team. */ +export class UnableToFetchCustomEmojis + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnableToFetchCustomEmojis", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unable_to_fetch_custom_emojis" } }], + ) {} + export interface ListEmojiRequest { /** Include a list of categories for Unicode emoji and the emoji in each category */ include_categories?: boolean | undefined; @@ -43,8 +69,8 @@ export interface ListEmojiResponse { categories_version?: string | undefined; categories?: ListEmojiResponseCategoriesList | undefined; } -export type ListEmojiError = SlackOpError; -/** Lists custom emoji for a team. Required scopes -- bot: `emoji:read`; user: `emoji:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- Invalid API arguments provided - `unable_to_fetch_custom_emojis` -- Unable to fetch custom emojis for team. See https://docs.slack.dev/reference/methods/emoji.list */ +export type ListEmojiError = InvalidArguments | UnableToFetchCustomEmojis | SlackOpError; +/** Lists custom emoji for a team. Required scopes -- bot: `emoji:read`; user: `emoji:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- Invalid API arguments provided - `unable_to_fetch_custom_emojis` -- Unable to fetch custom emojis for team. See https://docs.slack.dev/reference/methods/emoji.list */ export const listEmoji: API.OperationMethod< ListEmojiRequest, ListEmojiResponse, @@ -53,7 +79,7 @@ export const listEmoji: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(5, __c0, 5) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [InvalidArguments, UnableToFetchCustomEmojis, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/entity.ts b/packages/slack/src/services/entity.ts index 2188871119..a8eb16e800 100644 --- a/packages/slack/src/services/entity.ts +++ b/packages/slack/src/services/entity.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,191 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `entity_metadata_does_not_match_trigger` -- The provided entity's ID does not match the ID of the entity used to initiate the request */ +export class EntityMetadataDoesNotMatchTrigger + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "EntityMetadataDoesNotMatchTrigger", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "entity_metadata_does_not_match_trigger" } }], + ) {} + +/** `feature_not_enabled` -- temporarily gating API */ +export class FeatureNotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FeatureNotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "feature_not_enabled" } }], + ) {} + +/** `invalid_action` -- The comment data does not match the original trigger context (e.g., comment_id or thread_root_id mismatch) */ +export class InvalidAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_action" } }], + ) {} + +/** `invalid_app_id` -- App ID is not a valid format */ +export class InvalidAppId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAppId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_app_id" } }], + ) {} + +/** `invalid_metadata` -- The provided `metadata` argument could not be parsed or understood. */ +export class InvalidMetadata + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidMetadata", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_metadata" } }], + ) {} + +/** `invalid_sender_schema` -- The sender field could not be transformed to a valid user schema */ +export class InvalidSenderSchema + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidSenderSchema", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_sender_schema" } }], + ) {} + +/** `invalid_trigger_id` -- Trigger id is not valid */ +export class InvalidTriggerId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTriggerId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_trigger_id" } }], + ) {} + +/** `method_not_found` -- when the API isn't available to the caller */ +export class MethodNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MethodNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "method_not_found" } }], + ) {} + +/** `missing_comment_data` -- Required comment fields are missing for the given action type */ +export class MissingCommentData + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingCommentData", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_comment_data" } }], + ) {} + +/** `missing_delete_action_id` -- delete_action_id is required when any comment is marked can_delete */ +export class MissingDeleteActionId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingDeleteActionId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_delete_action_id" } }], + ) {} + +/** `missing_interactivity_url` -- App does not have an interactivity URL configured */ +export class MissingInteractivityUrl + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingInteractivityUrl", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_interactivity_url" } }], + ) {} + +/** `missing_options_load_url` -- App does not have an options load URL configured */ +export class MissingOptionsLoadUrl + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingOptionsLoadUrl", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_options_load_url" } }], + ) {} + +/** `not_allowed` -- User is not enrolled in comment syncing */ +export class NotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_allowed" } }], + ) {} + +/** `user_auth_url_missing` -- User auth url is required if user_auth_required is true */ +export class UserAuthUrlMissing + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserAuthUrlMissing", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_auth_url_missing" } }], + ) {} + /** The full comment data. Required for edit and post actions. See the [comment schema](/messaging/work-objects-comments#entity-present-comments-method) for the full list of properties. */ export type AcknowledgeCommentActionRequestCommentMap = { [key: string]: unknown | undefined }; export interface AcknowledgeCommentActionRequest { @@ -86,8 +272,16 @@ export interface PresentDetailsResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type AcknowledgeCommentActionError = SlackOpError; -/** Acknowledge a comment mutation (edit, delete, or post) on a work object entity. Apps call this endpoint to confirm they have processed a comment action, and the backend emits a dedicated RTM event to the user. Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `method_not_found` -- when the API isn't available to the caller - `invalid_trigger_id` -- Trigger id is not valid - `invalid_app_id` -- App ID is not a valid format - `invalid_auth` -- Invalid token provided - `invalid_action` -- The comment data does not match the original trigger context (e.g., comment_id or thread_root_id mismatch) - `missing_comment_data` -- Required comment fields are missing for the given action type - `not_allowed` -- User is not enrolled in comment syncing - `invalid_sender_schema` -- The sender field could not be transformed to a valid user schema See https://docs.slack.dev/reference/methods/entity.acknowledgeCommentAction */ +export type AcknowledgeCommentActionError = + | InvalidAction + | InvalidAppId + | InvalidSenderSchema + | InvalidTriggerId + | MethodNotFound + | MissingCommentData + | NotAllowed + | SlackOpError; +/** Acknowledge a comment mutation (edit, delete, or post) on a work object entity. Apps call this endpoint to confirm they have processed a comment action, and the backend emits a dedicated RTM event to the user. Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `method_not_found` -- when the API isn't available to the caller - `invalid_trigger_id` -- Trigger id is not valid - `invalid_app_id` -- App ID is not a valid format - `invalid_auth` -- Invalid token provided - `invalid_action` -- The comment data does not match the original trigger context (e.g., comment_id or thread_root_id mismatch) - `missing_comment_data` -- Required comment fields are missing for the given action type - `not_allowed` -- User is not enrolled in comment syncing - `invalid_sender_schema` -- The sender field could not be transformed to a valid user schema See https://docs.slack.dev/reference/methods/entity.acknowledgeCommentAction */ export const acknowledgeCommentAction: API.OperationMethod< AcknowledgeCommentActionRequest, AcknowledgeCommentActionResponse, @@ -96,15 +290,31 @@ export const acknowledgeCommentAction: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(8, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + InvalidAction, + InvalidAppId, + InvalidSenderSchema, + InvalidTriggerId, + MethodNotFound, + MissingCommentData, + NotAllowed, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AcknowledgeCommentAction", })); -export type PresentCommentsError = SlackOpError; -/** Provide comments for work objects. Apps call this endpoint to send per-user flexpane comment data to the client. Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `method_not_found` -- when the API isn't available to the caller - `invalid_trigger_id` -- Trigger id is not valid - `invalid_app_id` -- App ID is not a valid format - `invalid_auth` -- Invalid token provided - `user_auth_url_missing` -- User auth url is required if user_auth_required is true - `missing_delete_action_id` -- delete_action_id is required when any comment is marked can_delete See https://docs.slack.dev/reference/methods/entity.presentComments */ +export type PresentCommentsError = + | InvalidAppId + | InvalidTriggerId + | MethodNotFound + | MissingDeleteActionId + | UserAuthUrlMissing + | SlackOpError; +/** Provide comments for work objects. Apps call this endpoint to send per-user flexpane comment data to the client. Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `method_not_found` -- when the API isn't available to the caller - `invalid_trigger_id` -- Trigger id is not valid - `invalid_app_id` -- App ID is not a valid format - `invalid_auth` -- Invalid token provided - `user_auth_url_missing` -- User auth url is required if user_auth_required is true - `missing_delete_action_id` -- delete_action_id is required when any comment is marked can_delete See https://docs.slack.dev/reference/methods/entity.presentComments */ export const presentComments: API.OperationMethod< PresentCommentsRequest, PresentCommentsResponse, @@ -113,15 +323,32 @@ export const presentComments: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(13, __c3, 1) as any as S.Schema, output: __S(15, __c3, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + InvalidAppId, + InvalidTriggerId, + MethodNotFound, + MissingDeleteActionId, + UserAuthUrlMissing, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PresentComments", })); -export type PresentDetailsError = SlackOpError; -/** Provide custom flexpane behavior for Work Objects. Apps call this endpoint to send per-user flexpane metadata to the client. Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_metadata` -- The provided `metadata` argument could not be parsed or understood. - `feature_not_enabled` -- temporarily gating API - `invalid_app_id` -- App ID is not a valid format - `user_auth_url_missing` -- User auth url is required if user_auth_required is true - `invalid_trigger_id` -- Trigger id is not valid - `entity_metadata_does_not_match_trigger` -- The provided entity's ID does not match the ID of the entity used to initiate the request - `missing_interactivity_url` -- App does not have an interactivity URL configured - `missing_options_load_url` -- App does not have an options load URL configured - `invalid_auth` -- Invalid token provided See https://docs.slack.dev/reference/methods/entity.presentDetails */ +export type PresentDetailsError = + | EntityMetadataDoesNotMatchTrigger + | FeatureNotEnabled + | InvalidAppId + | InvalidMetadata + | InvalidTriggerId + | MissingInteractivityUrl + | MissingOptionsLoadUrl + | UserAuthUrlMissing + | SlackOpError; +/** Provide custom flexpane behavior for Work Objects. Apps call this endpoint to send per-user flexpane metadata to the client. Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_metadata` -- The provided `metadata` argument could not be parsed or understood. - `feature_not_enabled` -- temporarily gating API - `invalid_app_id` -- App ID is not a valid format - `user_auth_url_missing` -- User auth url is required if user_auth_required is true - `invalid_trigger_id` -- Trigger id is not valid - `entity_metadata_does_not_match_trigger` -- The provided entity's ID does not match the ID of the entity used to initiate the request - `missing_interactivity_url` -- App does not have an interactivity URL configured - `missing_options_load_url` -- App does not have an options load URL configured - `invalid_auth` -- Invalid token provided See https://docs.slack.dev/reference/methods/entity.presentDetails */ export const presentDetails: API.OperationMethod< PresentDetailsRequest, PresentDetailsResponse, @@ -130,7 +357,18 @@ export const presentDetails: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(16, __c4, 0) as any as S.Schema, output: __S(8, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + EntityMetadataDoesNotMatchTrigger, + FeatureNotEnabled, + InvalidAppId, + InvalidMetadata, + InvalidTriggerId, + MissingInteractivityUrl, + MissingOptionsLoadUrl, + UserAuthUrlMissing, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/files.ts b/packages/slack/src/services/files.ts index c0b1c3c055..f3c08dea1d 100644 --- a/packages/slack/src/services/files.ts +++ b/packages/slack/src/services/files.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,798 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `access_denied` -- User is not the owner of the file. */ +export class AccessDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AccessDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "access_denied" } }], + ) {} + +/** `alt_txt_too_large` -- Description for the image is longer than the limit of 1000 character */ +export class AltTxtTooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AltTxtTooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "alt_txt_too_large" } }], + ) {} + +/** `bad_image` -- The uploaded image could not be processed - try passing a JPG or PNG */ +export class BadImage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadImage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_image" } }], + ) {} + +/** `bad_title` -- The title provided is too long. */ +export class BadTitle + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadTitle", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_title" } }], + ) {} + +/** `blocked_file_type` -- Admin has disabled uploading this type of file */ +export class BlockedFileType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BlockedFileType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "blocked_file_type" } }], + ) {} + +/** `bot_user_required` -- bot user token is required */ +export class BotUserRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BotUserRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bot_user_required" } }], + ) {} + +/** `cant_delete` -- The requested comment could not be deleted. */ +export class CantDelete + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantDelete", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_delete" } }], + ) {} + +/** `cant_delete_file` -- Authenticated user does not have permission to delete this file. */ +export class CantDeleteFile + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CantDeleteFile", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cant_delete_file" } }], + ) {} + +/** `canvas_disabled_file_team` -- Canvas is disabled on file's team */ +export class CanvasDisabledFileTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasDisabledFileTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_disabled_file_team" } }], + ) {} + +/** `canvas_disabled_user_team` -- Canvas is disabled on user's team for connected Channels */ +export class CanvasDisabledUserTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasDisabledUserTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_disabled_user_team" } }], + ) {} + +/** `canvas_globally_disabled` -- Canvas is disabled for this team */ +export class CanvasGloballyDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasGloballyDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_globally_disabled" } }], + ) {} + +/** `channel_not_found` -- Value passed for `channel_id` was invalid. */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `channels_limit_exceeded` -- Exceeded the channel limit. A maximum of 100 channels is allowed per request. */ +export class ChannelsLimitExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelsLimitExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "channels_limit_exceeded" } }], + ) {} + +/** `delete_not_allowed` -- Error returned when the requested file does not support deletion; for example, when attempting to delete a canvas template. */ +export class DeleteNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DeleteNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "delete_not_allowed" } }], + ) {} + +/** `failed_to_unshare` -- The file was either not found or it has been unshared already. */ +export class FailedToUnshare + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToUnshare", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_unshare" } }], + ) {} + +/** `file_deleted` -- The requested file was previously deleted. */ +export class FileDeleted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileDeleted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_deleted" } }], + ) {} + +/** `file_deleting_disabled` -- This functionality is disabled. */ +export class FileDeletingDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileDeletingDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_deleting_disabled" } }], + ) {} + +/** `file_not_found` -- The requested file could not be found. */ +export class FileNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_not_found" } }], + ) {} + +/** `file_type_not_allowed` -- The file type is not permitted based on the team's allowed_file_upload_types preference. */ +export class FileTypeNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileTypeNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_type_not_allowed" } }], + ) {} + +/** `file_under_review` -- File passed is tombstoned for DLP review */ +export class FileUnderReview + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileUnderReview", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_under_review" } }], + ) {} + +/** `file_update_failed` -- Failure occurred when attempting to update the file. */ +export class FileUpdateFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileUpdateFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_update_failed" } }], + ) {} + +/** `file_uploads_disabled` -- Team has disabled all file uploads. */ +export class FileUploadsDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileUploadsDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_uploads_disabled" } }], + ) {} + +/** `file_uploads_except_images_disabled` -- Only image file uploads are permitted for this team. */ +export class FileUploadsExceptImagesDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "FileUploadsExceptImagesDisabled", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "file_uploads_except_images_disabled" } }], + ) {} + +/** `file_upload_size_restricted` -- The size of provided file is too large, as the team has restricted uploads of large files. */ +export class FileUploadSizeRestricted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileUploadSizeRestricted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_upload_size_restricted" } }], + ) {} + +/** `invalid_args` -- Invalid arguments passed to endpoint */ +export class InvalidArgs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArgs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_args" } }], + ) {} + +/** `invalid_blocks` -- Provided blocks are in the incorrect format. */ +export class InvalidBlocks + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidBlocks", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_blocks" } }], + ) {} + +/** `invalid_channel` -- Channel could not be found or channel specified is invalid. */ +export class InvalidChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_channel" } }], + ) {} + +/** `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_external_id` -- The external_id provided is too long (over 255 characters) or contains non-ASCII characters. */ +export class InvalidExternalId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidExternalId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_external_id" } }], + ) {} + +/** `invalid_thread_ts` -- Value passed to thread_ts was invalid */ +export class InvalidThreadTs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidThreadTs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_thread_ts" } }], + ) {} + +/** `invalid_title` -- invalid title provided */ +export class InvalidTitle + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTitle", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_title" } }], + ) {} + +/** `invalid_type` -- invalid type provided */ +export class InvalidType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_type" } }], + ) {} + +/** `invalid_url` -- invalid url provided */ +export class InvalidUrl + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidUrl", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_url" } }], + ) {} + +/** `malware_detected` -- This file may contain a virus or other malware and can't be uploaded to Slack */ +export class MalwareDetected + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MalwareDetected", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "malware_detected" } }], + ) {} + +/** `method_deprecated` -- This API is deprecated. Please refer to https://docs.slack.dev/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay */ +export class MethodDeprecated + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MethodDeprecated", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "method_deprecated" } }], + ) {} + +/** `missing_argument` -- A required argument was not provided. Typically only occurs when the `length` provided is 0. */ +export class MissingArgument + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgument", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_argument" } }], + ) {} + +/** `no_bot_user_for_app` -- Cannot call the Remote Files endpoints unless app has associated bot user */ +export class NoBotUserForApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoBotUserForApp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_bot_user_for_app" } }], + ) {} + +/** `not_allowed` -- Public sharing has been disabled for this team. You may see this error if you are creating an external link from a free or trial workspace. You can either upgrade to a [Paid Plan](https://app.slack.com/plans) or use `file.list` to get a `url_private_download` link, download the file with an application, and re-upload it somewhere it can be shared with users who are not members of your workspace. Be sure to pass the Slack [Bot token](/authentication/tokens#bot) to the request on the headers file when calling `url_private_download`. */ +export class NotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_allowed" } }], + ) {} + +/** `not_in_channel` -- User/bot membership is required for the specified channel. */ +export class NotInChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotInChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_in_channel" } }], + ) {} + +/** `not_visible` -- Do not have permission to view the file */ +export class NotVisible + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotVisible", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_visible" } }], + ) {} + +/** `post_contents_too_large` -- File content is larger than 130kb. */ +export class PostContentsTooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PostContentsTooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "post_contents_too_large" } }], + ) {} + +/** `posting_to_channel_denied` -- User is not authorized to post to channel. */ +export class PostingToChannelDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PostingToChannelDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "posting_to_channel_denied" } }], + ) {} + +/** `posting_to_general_channel_denied` -- An admin has restricted posting to the #general channel. */ +export class PostingToGeneralChannelDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PostingToGeneralChannelDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "posting_to_general_channel_denied" } }], + ) {} + +/** `public_file_type_not_allowed` -- Public sharing has been restricted for this file type. */ +export class PublicFileTypeNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PublicFileTypeNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "public_file_type_not_allowed" } }], + ) {} + +/** `public_video_not_allowed` -- Public sharing of videos is not available. A `Free` instance of Slack may encounter this error because free teams don't have the ability to share video files publicly. */ +export class PublicVideoNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PublicVideoNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "public_video_not_allowed" } }], + ) {} + +/** `slack_connect_blocked_file_type` -- File uploads with certain types are blocked in all Slack Connect communications */ +export class SlackConnectBlockedFileType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SlackConnectBlockedFileType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "slack_connect_blocked_file_type" } }], + ) {} + +/** `slack_connect_canvas_sharing_blocked` -- Admin has disabled sharing of Canvas links in all Slack Connect communications */ +export class SlackConnectCanvasSharingBlocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "SlackConnectCanvasSharingBlocked", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "slack_connect_canvas_sharing_blocked" } }], + ) {} + +/** `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip sharing in Slack Connect channels */ +export class SlackConnectClipSharingBlocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "SlackConnectClipSharingBlocked", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "slack_connect_clip_sharing_blocked" } }], + ) {} + +/** `slack_connect_file_upload_sharing_blocked` -- Admin has disabled File uploads in all Slack Connect communications */ +export class SlackConnectFileUploadSharingBlocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "SlackConnectFileUploadSharingBlocked", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "slack_connect_file_upload_sharing_blocked" } }], + ) {} + +/** `snippet_too_large` -- The provided `length` is too large to create a snippet, which are limited to 1MB. */ +export class SnippetTooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SnippetTooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "snippet_too_large" } }], + ) {} + +/** `storage_limit_reached` -- File storage limit has been reached. This occurs when free teams have uploaded 5GB of files. */ +export class StorageLimitReached + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("StorageLimitReached", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "storage_limit_reached" } }], + ) {} + +/** `template_not_visible` -- Do not have permissions to view this template */ +export class TemplateNotVisible + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TemplateNotVisible", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "template_not_visible" } }], + ) {} + +/** `too_large` -- The uploaded image had excessive dimensions */ +export class TooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_large" } }], + ) {} + +/** `too_many_ids` -- The request specified both an external_id and a file, only one may be specified */ +export class TooManyIds + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyIds", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_ids" } }], + ) {} + +/** `unknown_snippet_type` -- The provided `snippet_type` is not a supported type. */ +export class UnknownSnippetType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownSnippetType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_snippet_type" } }], + ) {} + +/** `unknown_subtype` -- The provided `subtype` is not a supported type. */ +export class UnknownSubtype + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownSubtype", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_subtype" } }], + ) {} + +/** `unknown_type` -- Value passed for `types` was invalid */ +export class UnknownType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_type" } }], + ) {} + +/** `user_is_external_guest` -- External guests cannot upload or share files. */ +export class UserIsExternalGuest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserIsExternalGuest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_is_external_guest" } }], + ) {} + +/** `user_not_found` -- Value passed for `user` was invalid */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + +/** `use_skills_api` -- This file is a Slackbot skill. Use slackbot.skills.delete with skill_id and a user OAuth token carrying skills:write. */ +export class UseSkillsApi + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UseSkillsApi", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "use_skills_api" } }], + ) {} + export interface AddRemoteRequest { /** Creator defined GUID for the file. */ external_id: string; @@ -383,8 +1176,14 @@ export interface UploadFileResponse { ok: boolean; file: RevokePublicURLResponseFile; } -export type AddRemoteError = SlackOpError; -/** Adds a file from a remote service Required scopes -- bot: `remote_files:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_image` -- The uploaded image could not be processed - try passing a JPG or PNG - `bad_title` -- The title provided is too long. - `bot_user_required` -- bot user token is required - `invalid_external_id` -- The external_id provided is too long (over 255 characters) or contains non-ASCII characters. - `too_large` -- The uploaded image had excessive dimensions See https://docs.slack.dev/reference/methods/files.remote.add */ +export type AddRemoteError = + | BadImage + | BadTitle + | BotUserRequired + | InvalidExternalId + | TooLarge + | SlackOpError; +/** Adds a file from a remote service Required scopes -- bot: `remote_files:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `bad_image` -- The uploaded image could not be processed - try passing a JPG or PNG - `bad_title` -- The title provided is too long. - `bot_user_required` -- bot user token is required - `invalid_external_id` -- The external_id provided is too long (over 255 characters) or contains non-ASCII characters. - `too_large` -- The uploaded image had excessive dimensions See https://docs.slack.dev/reference/methods/files.remote.add */ export const addRemote: API.OperationMethod< AddRemoteRequest, AddRemoteResponse, @@ -393,15 +1192,36 @@ export const addRemote: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(3, __c0, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadImage, + BadTitle, + BotUserRequired, + InvalidExternalId, + TooLarge, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddRemote", })); -export type CompleteUploadExternalError = SlackOpError; -/** Finishes an upload started with files.getUploadURLExternal Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- User is not the owner of the file. - `channel_not_found` -- Value passed for `channel_id` was invalid. - `file_not_found` -- Could not find the file from the upload ticket. - `file_update_failed` -- Failure occurred when attempting to update the file. - `invalid_blocks` -- Provided blocks are in the incorrect format. - `invalid_channel` -- Channel could not be found or channel specified is invalid. - `not_in_channel` -- User/bot membership is required for the specified channel. - `posting_to_channel_denied` -- User is not authorized to post to channel. - `channels_limit_exceeded` -- Exceeded the channel limit. A maximum of 100 channels is allowed per request. - `file_type_not_allowed` -- The file type is not permitted based on the team's allowed_file_upload_types preference. - `file_uploads_except_images_disabled` -- Only image file uploads are permitted for this team. - `user_is_external_guest` -- External guests cannot upload or share files. See https://docs.slack.dev/reference/methods/files.completeUploadExternal */ +export type CompleteUploadExternalError = + | AccessDenied + | ChannelNotFound + | ChannelsLimitExceeded + | FileNotFound + | FileTypeNotAllowed + | FileUpdateFailed + | FileUploadsExceptImagesDisabled + | InvalidBlocks + | InvalidChannel + | NotInChannel + | PostingToChannelDenied + | UserIsExternalGuest + | SlackOpError; +/** Finishes an upload started with files.getUploadURLExternal Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `access_denied` -- User is not the owner of the file. - `channel_not_found` -- Value passed for `channel_id` was invalid. - `file_not_found` -- Could not find the file from the upload ticket. - `file_update_failed` -- Failure occurred when attempting to update the file. - `invalid_blocks` -- Provided blocks are in the incorrect format. - `invalid_channel` -- Channel could not be found or channel specified is invalid. - `not_in_channel` -- User/bot membership is required for the specified channel. - `posting_to_channel_denied` -- User is not authorized to post to channel. - `channels_limit_exceeded` -- Exceeded the channel limit. A maximum of 100 channels is allowed per request. - `file_type_not_allowed` -- The file type is not permitted based on the team's allowed_file_upload_types preference. - `file_uploads_except_images_disabled` -- Only image file uploads are permitted for this team. - `user_is_external_guest` -- External guests cannot upload or share files. See https://docs.slack.dev/reference/methods/files.completeUploadExternal */ export const completeUploadExternal: API.OperationMethod< CompleteUploadExternalRequest, CompleteUploadExternalResponse, @@ -410,49 +1230,90 @@ export const completeUploadExternal: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(19, __c2, 3) as any as S.Schema, output: __S(22, __c2, 6) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + ChannelNotFound, + ChannelsLimitExceeded, + FileNotFound, + FileTypeNotAllowed, + FileUpdateFailed, + FileUploadsExceptImagesDisabled, + InvalidBlocks, + InvalidChannel, + NotInChannel, + PostingToChannelDenied, + UserIsExternalGuest, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CompleteUploadExternal", })); -export type DeleteCommentError = SlackOpError; -/** Deletes an existing comment on a file. Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cant_delete` -- The requested comment could not be deleted. - `file_deleted` -- The requested file was previously deleted. - `file_not_found` -- The requested file could not be found. See https://docs.slack.dev/reference/methods/files.comments.delete */ +export type DeleteCommentError = CantDelete | FileDeleted | FileNotFound | SlackOpError; +/** Deletes an existing comment on a file. Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cant_delete` -- The requested comment could not be deleted. - `file_deleted` -- The requested file was previously deleted. - `file_not_found` -- The requested file could not be found. See https://docs.slack.dev/reference/methods/files.comments.delete */ export const deleteComment: API.OperationMethod< DeleteCommentRequest, DeleteCommentResponse, DeleteCommentError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(88, __c11, 0) as any as S.Schema, - output: __S(96, __c12, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(24, __c3, 0) as any as S.Schema, + output: __S(32, __c4, 0) as any as S.Schema, + errors: [CantDelete, FileDeleted, FileNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteComment", })); -export type DeleteFileError = SlackOpError; -/** Deletes a file. Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `cant_delete_file` -- Authenticated user does not have permission to delete this file. - `delete_not_allowed` -- Error returned when the requested file does not support deletion; for example, when attempting to delete a canvas template. - `file_deleted` -- The file has already been deleted. - `file_deleting_disabled` -- This functionality is disabled. - `file_not_found` -- The file does not exist, or is not visible to the calling user. - `use_skills_api` -- This file is a Slackbot skill. Use slackbot.skills.delete with skill_id and a user OAuth token carrying skills:write. See https://docs.slack.dev/reference/methods/files.delete */ +export type DeleteFileError = + | CantDeleteFile + | DeleteNotAllowed + | FileDeleted + | FileDeletingDisabled + | FileNotFound + | UseSkillsApi + | SlackOpError; +/** Deletes a file. Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `cant_delete_file` -- Authenticated user does not have permission to delete this file. - `delete_not_allowed` -- Error returned when the requested file does not support deletion; for example, when attempting to delete a canvas template. - `file_deleted` -- The file has already been deleted. - `file_deleting_disabled` -- This functionality is disabled. - `file_not_found` -- The file does not exist, or is not visible to the calling user. - `use_skills_api` -- This file is a Slackbot skill. Use slackbot.skills.delete with skill_id and a user OAuth token carrying skills:write. See https://docs.slack.dev/reference/methods/files.delete */ export const deleteFile: API.OperationMethod< DeleteFileRequest, DeleteFileResponse, DeleteFileError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(104, __c13, 0) as any as S.Schema, - output: __S(96, __c12, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(40, __c5, 0) as any as S.Schema, + output: __S(32, __c4, 0) as any as S.Schema, + errors: [ + CantDeleteFile, + DeleteNotAllowed, + FileDeleted, + FileDeletingDisabled, + FileNotFound, + UseSkillsApi, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteFile", })); -export type FilesInfoError = SlackOpError; -/** Gets information about a file. Required scopes -- bot: `files:read`; user: `files:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- Unable to access the file (slack connect) - `file_deleted` -- The requested file has been deleted - `file_not_found` -- Value passed for `file` was invalid - `canvas_globally_disabled` -- Canvas is disabled for this team - `canvas_disabled_user_team` -- Canvas is disabled on user's team for connected Channels - `canvas_disabled_file_team` -- Canvas is disabled on file's team - `not_visible` -- Do not have permission to view the file - `template_not_visible` -- Do not have permissions to view this template - `slack_connect_canvas_sharing_blocked` -- Admin has disabled sharing of Canvas links in all Slack Connect communications See https://docs.slack.dev/reference/methods/files.info */ +export type FilesInfoError = + | AccessDenied + | CanvasDisabledFileTeam + | CanvasDisabledUserTeam + | CanvasGloballyDisabled + | FileDeleted + | FileNotFound + | NotVisible + | SlackConnectCanvasSharingBlocked + | TemplateNotVisible + | SlackOpError; +/** Gets information about a file. Required scopes -- bot: `files:read`; user: `files:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `access_denied` -- Unable to access the file (slack connect) - `file_deleted` -- The requested file has been deleted - `file_not_found` -- Value passed for `file` was invalid - `canvas_globally_disabled` -- Canvas is disabled for this team - `canvas_disabled_user_team` -- Canvas is disabled on user's team for connected Channels - `canvas_disabled_file_team` -- Canvas is disabled on file's team - `not_visible` -- Do not have permission to view the file - `template_not_visible` -- Do not have permissions to view this template - `slack_connect_canvas_sharing_blocked` -- Admin has disabled sharing of Canvas links in all Slack Connect communications See https://docs.slack.dev/reference/methods/files.info */ export const filesInfo: API.PaginatedOperationMethod< FilesInfoRequest, FilesInfoResponse, @@ -461,9 +1322,21 @@ export const filesInfo: API.PaginatedOperationMethod< FilesInfoResponseCommentsItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(112, __c14, 0) as any as S.Schema, - output: __S(116, __c14, 4) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(48, __c6, 0) as any as S.Schema, + output: __S(52, __c6, 4) as any as S.Schema, + errors: [ + AccessDenied, + CanvasDisabledFileTeam, + CanvasDisabledUserTeam, + CanvasGloballyDisabled, + FileDeleted, + FileNotFound, + NotVisible, + SlackConnectCanvasSharingBlocked, + TemplateNotVisible, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -479,42 +1352,80 @@ export const filesInfo: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type GetUploadURLExternalError = SlackOpError; -/** Gets a URL for an edge external file upload Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `alt_txt_too_large` -- Description for the image is longer than the limit of 1000 character - `file_upload_size_restricted` -- The size of provided file is too large, as the team has restricted uploads of large files. - `file_uploads_disabled` -- Team has disabled all file uploads. - `missing_argument` -- A required argument was not provided. Typically only occurs when the `length` provided is 0. - `snippet_too_large` -- The provided `length` is too large to create a snippet, which are limited to 1MB. - `storage_limit_reached` -- File storage limit has been reached. This occurs when free teams have uploaded 5GB of files. - `unknown_snippet_type` -- The provided `snippet_type` is not a supported type. - `unknown_subtype` -- The provided `subtype` is not a supported type. - `file_type_not_allowed` -- The file type is not allowed. - `file_uploads_except_images_disabled` -- File uploads except images are disabled. - `user_is_external_guest` -- External guests cannot upload or share files. See https://docs.slack.dev/reference/methods/files.getUploadURLExternal */ +export type GetUploadURLExternalError = + | AltTxtTooLarge + | FileTypeNotAllowed + | FileUploadSizeRestricted + | FileUploadsDisabled + | FileUploadsExceptImagesDisabled + | MissingArgument + | SnippetTooLarge + | StorageLimitReached + | UnknownSnippetType + | UnknownSubtype + | UserIsExternalGuest + | SlackOpError; +/** Gets a URL for an edge external file upload Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `alt_txt_too_large` -- Description for the image is longer than the limit of 1000 character - `file_upload_size_restricted` -- The size of provided file is too large, as the team has restricted uploads of large files. - `file_uploads_disabled` -- Team has disabled all file uploads. - `missing_argument` -- A required argument was not provided. Typically only occurs when the `length` provided is 0. - `snippet_too_large` -- The provided `length` is too large to create a snippet, which are limited to 1MB. - `storage_limit_reached` -- File storage limit has been reached. This occurs when free teams have uploaded 5GB of files. - `unknown_snippet_type` -- The provided `snippet_type` is not a supported type. - `unknown_subtype` -- The provided `subtype` is not a supported type. - `file_type_not_allowed` -- The file type is not allowed. - `file_uploads_except_images_disabled` -- File uploads except images are disabled. - `user_is_external_guest` -- External guests cannot upload or share files. See https://docs.slack.dev/reference/methods/files.getUploadURLExternal */ export const getUploadURLExternal: API.OperationMethod< GetUploadURLExternalRequest, GetUploadURLExternalResponse, GetUploadURLExternalError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(128, __c16, 0) as any as S.Schema, - output: __S(129, __c16, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(64, __c8, 0) as any as S.Schema, + output: __S(65, __c8, 1) as any as S.Schema, + errors: [ + AltTxtTooLarge, + FileTypeNotAllowed, + FileUploadSizeRestricted, + FileUploadsDisabled, + FileUploadsExceptImagesDisabled, + MissingArgument, + SnippetTooLarge, + StorageLimitReached, + UnknownSnippetType, + UnknownSubtype, + UserIsExternalGuest, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetUploadURLExternal", })); -export type ListFilesError = SlackOpError; -/** List files for a team, in a channel, or from a user with applied filters. Required scopes -- bot: `files:read`; user: `files:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled sharing of Canvas links in all Slack Connect communications - `user_not_found` -- Value passed for `user` was invalid - `unknown_type` -- Value passed for `types` was invalid See https://docs.slack.dev/reference/methods/files.list */ +export type ListFilesError = + | MissingArgument + | SlackConnectCanvasSharingBlocked + | UnknownType + | UserNotFound + | SlackOpError; +/** List files for a team, in a channel, or from a user with applied filters. Required scopes -- bot: `files:read`; user: `files:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- A required argument is missing. - `slack_connect_canvas_sharing_blocked` -- Admin has disabled sharing of Canvas links in all Slack Connect communications - `user_not_found` -- Value passed for `user` was invalid - `unknown_type` -- Value passed for `types` was invalid See https://docs.slack.dev/reference/methods/files.list */ export const listFiles: API.OperationMethod< ListFilesRequest, ListFilesResponse, ListFilesError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(138, __c17, 2) as any as S.Schema, - output: __S(141, __c17, 5) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(74, __c9, 2) as any as S.Schema, + output: __S(77, __c9, 5) as any as S.Schema, + errors: [ + MissingArgument, + SlackConnectCanvasSharingBlocked, + UnknownType, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListFiles", })); -export type ListRemoteError = SlackOpError; -/** Retrieve information about a remote file added to Slack Required scopes -- bot: `remote_files:read`; user: `remote_files:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `no_bot_user_for_app` -- Cannot call the Remote Files endpoints unless app has associated bot user See https://docs.slack.dev/reference/methods/files.remote.list */ +export type ListRemoteError = InvalidCursor | NoBotUserForApp | SlackOpError; +/** Retrieve information about a remote file added to Slack Required scopes -- bot: `remote_files:read`; user: `remote_files:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `no_bot_user_for_app` -- Cannot call the Remote Files endpoints unless app has associated bot user See https://docs.slack.dev/reference/methods/files.remote.list */ export const listRemote: API.PaginatedOperationMethod< ListRemoteRequest, ListRemoteResponse, @@ -523,9 +1434,9 @@ export const listRemote: API.PaginatedOperationMethod< ListRemoteResponseFilesItem > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(152, __c19, 0) as any as S.Schema, - output: __S(154, __c19, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(88, __c11, 0) as any as S.Schema, + output: __S(90, __c11, 2) as any as S.Schema, + errors: [InvalidCursor, NoBotUserForApp, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -541,119 +1452,212 @@ export const listRemote: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type RemoteInfoError = SlackOpError; -/** Retrieve information about a remote file added to Slack Required scopes -- bot: `remote_files:read`; user: `remote_files:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `file_not_found` -- Value passed for `file` or `external_id` was invalid - `invalid_args` -- Invalid arguments passed to endpoint - `no_bot_user_for_app` -- Cannot call the Remote Files endpoints unless app has associated bot user - `too_many_ids` -- The request specified both an external_id and a file, only one may be specified See https://docs.slack.dev/reference/methods/files.remote.info */ +export type RemoteInfoError = + | FileNotFound + | InvalidArgs + | NoBotUserForApp + | TooManyIds + | SlackOpError; +/** Retrieve information about a remote file added to Slack Required scopes -- bot: `remote_files:read`; user: `remote_files:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `file_not_found` -- Value passed for `file` or `external_id` was invalid - `invalid_args` -- Invalid arguments passed to endpoint - `no_bot_user_for_app` -- Cannot call the Remote Files endpoints unless app has associated bot user - `too_many_ids` -- The request specified both an external_id and a file, only one may be specified See https://docs.slack.dev/reference/methods/files.remote.info */ export const remoteInfo: API.OperationMethod< RemoteInfoRequest, RemoteInfoResponse, RemoteInfoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(168, __c21, 0) as any as S.Schema, - output: __S(169, __c21, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(104, __c13, 0) as any as S.Schema, + output: __S(105, __c13, 1) as any as S.Schema, + errors: [FileNotFound, InvalidArgs, NoBotUserForApp, TooManyIds, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoteInfo", })); -export type RemoveRemoteError = SlackOpError; -/** Remove a remote file. Required scopes -- bot: `remote_files:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bot_user_required` -- bot user token is required - `file_not_found` -- Value passed for `file` or `external_id` was invalid - `file_under_review` -- File passed is tombstoned for DLP review - `invalid_args` -- Invalid arguments passed to endpoint - `too_many_ids` -- The request specified both an external_id and a file, only one may be specified See https://docs.slack.dev/reference/methods/files.remote.remove */ +export type RemoveRemoteError = + | BotUserRequired + | FileNotFound + | FileUnderReview + | InvalidArgs + | TooManyIds + | SlackOpError; +/** Remove a remote file. Required scopes -- bot: `remote_files:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `bot_user_required` -- bot user token is required - `file_not_found` -- Value passed for `file` or `external_id` was invalid - `file_under_review` -- File passed is tombstoned for DLP review - `invalid_args` -- Invalid arguments passed to endpoint - `too_many_ids` -- The request specified both an external_id and a file, only one may be specified See https://docs.slack.dev/reference/methods/files.remote.remove */ export const removeRemote: API.OperationMethod< RemoveRemoteRequest, RemoveRemoteResponse, RemoveRemoteError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(176, __c22, 0) as any as S.Schema, - output: __S(96, __c12, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(112, __c14, 0) as any as S.Schema, + output: __S(32, __c4, 0) as any as S.Schema, + errors: [ + BotUserRequired, + FileNotFound, + FileUnderReview, + InvalidArgs, + TooManyIds, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveRemote", })); -export type RevokePublicURLError = SlackOpError; -/** Revokes public/external sharing access for a file Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `file_not_found` -- Value passed for `file` was invalid See https://docs.slack.dev/reference/methods/files.revokePublicURL */ +export type RevokePublicURLError = FileNotFound | SlackOpError; +/** Revokes public/external sharing access for a file Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `file_not_found` -- Value passed for `file` was invalid See https://docs.slack.dev/reference/methods/files.revokePublicURL */ export const revokePublicURL: API.OperationMethod< RevokePublicURLRequest, RevokePublicURLResponse, RevokePublicURLError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(24, __c3, 0) as any as S.Schema, - output: __S(40, __c5, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(120, __c15, 0) as any as S.Schema, + output: __S(136, __c17, 0) as any as S.Schema, + errors: [FileNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RevokePublicURL", })); -export type SharedPublicURLError = SlackOpError; -/** Enables a file for public/external sharing. Required scopes -- user: `files:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `file_not_found` -- Value passed for `file` was invalid - `not_allowed` -- Public sharing has been disabled for this team. You may see this error if you are creating an external link from a free or trial workspace. You can either upgrade to a [Paid Plan](https://app.slack.com/plans) or use `file.list` to get a `url_private_download` link, download the file with an application, and re-upload it somewhere it can be shared with users who are not members of your workspace. Be sure to pass the Slack [Bot token](/authentication/tokens#bot) to the request on the headers file when calling `url_private_download`. - `public_video_not_allowed` -- Public sharing of videos is not available. A `Free` instance of Slack may encounter this error because free teams don't have the ability to share video files publicly. - `public_file_type_not_allowed` -- Public sharing has been restricted for this file type. See https://docs.slack.dev/reference/methods/files.sharedPublicURL */ +export type SharedPublicURLError = + | FileNotFound + | NotAllowed + | PublicFileTypeNotAllowed + | PublicVideoNotAllowed + | SlackOpError; +/** Enables a file for public/external sharing. Required scopes -- user: `files:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `file_not_found` -- Value passed for `file` was invalid - `not_allowed` -- Public sharing has been disabled for this team. You may see this error if you are creating an external link from a free or trial workspace. You can either upgrade to a [Paid Plan](https://app.slack.com/plans) or use `file.list` to get a `url_private_download` link, download the file with an application, and re-upload it somewhere it can be shared with users who are not members of your workspace. Be sure to pass the Slack [Bot token](/authentication/tokens#bot) to the request on the headers file when calling `url_private_download`. - `public_video_not_allowed` -- Public sharing of videos is not available. A `Free` instance of Slack may encounter this error because free teams don't have the ability to share video files publicly. - `public_file_type_not_allowed` -- Public sharing has been restricted for this file type. See https://docs.slack.dev/reference/methods/files.sharedPublicURL */ export const sharedPublicURL: API.OperationMethod< SharedPublicURLRequest, SharedPublicURLResponse, SharedPublicURLError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(49, __c6, 1) as any as S.Schema, - output: __S(50, __c6, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(145, __c18, 1) as any as S.Schema, + output: __S(146, __c18, 2) as any as S.Schema, + errors: [ + FileNotFound, + NotAllowed, + PublicFileTypeNotAllowed, + PublicVideoNotAllowed, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SharedPublicURL", })); -export type ShareRemoteError = SlackOpError; -/** Share a remote file into a channel. Required scopes -- bot: `remote_files:share`; user: `remote_files:share` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- At least one of the values passed for `channels` was invalid. - `file_not_found` -- No file with the requested ID found. - `invalid_args` -- Invalid arguments passed to endpoint - `no_bot_user_for_app` -- Cannot call the Remote Files endpoints unless app has associated bot user - `not_in_channel` -- Authenticated user is not in at least one of the the provided channels. See https://docs.slack.dev/reference/methods/files.remote.share */ +export type ShareRemoteError = + | ChannelNotFound + | FileNotFound + | InvalidArgs + | NoBotUserForApp + | NotInChannel + | SlackOpError; +/** Share a remote file into a channel. Required scopes -- bot: `remote_files:share`; user: `remote_files:share` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- At least one of the values passed for `channels` was invalid. - `file_not_found` -- No file with the requested ID found. - `invalid_args` -- Invalid arguments passed to endpoint - `no_bot_user_for_app` -- Cannot call the Remote Files endpoints unless app has associated bot user - `not_in_channel` -- Authenticated user is not in at least one of the the provided channels. See https://docs.slack.dev/reference/methods/files.remote.share */ export const shareRemote: API.OperationMethod< ShareRemoteRequest, ShareRemoteResponse, ShareRemoteError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(56, __c7, 0) as any as S.Schema, - output: __S(64, __c8, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(152, __c19, 0) as any as S.Schema, + output: __S(160, __c20, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + FileNotFound, + InvalidArgs, + NoBotUserForApp, + NotInChannel, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ShareRemote", })); -export type UpdateRemoteError = SlackOpError; -/** Updates an existing remote file. Required scopes -- bot: `remote_files:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_image` -- The uploaded image could not be processed - try passing a JPG or PNG - `bot_user_required` -- bot user token is required - `failed_to_unshare` -- The file was either not found or it has been unshared already. - `file_not_found` -- Could not find the file to update. - `invalid_title` -- invalid title provided - `invalid_type` -- invalid type provided - `invalid_url` -- invalid url provided - `too_large` -- The uploaded image had excessive dimensions See https://docs.slack.dev/reference/methods/files.remote.update */ +export type UpdateRemoteError = + | BadImage + | BotUserRequired + | FailedToUnshare + | FileNotFound + | InvalidTitle + | InvalidType + | InvalidUrl + | TooLarge + | SlackOpError; +/** Updates an existing remote file. Required scopes -- bot: `remote_files:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `bad_image` -- The uploaded image could not be processed - try passing a JPG or PNG - `bot_user_required` -- bot user token is required - `failed_to_unshare` -- The file was either not found or it has been unshared already. - `file_not_found` -- Could not find the file to update. - `invalid_title` -- invalid title provided - `invalid_type` -- invalid type provided - `invalid_url` -- invalid url provided - `too_large` -- The uploaded image had excessive dimensions See https://docs.slack.dev/reference/methods/files.remote.update */ export const updateRemote: API.OperationMethod< UpdateRemoteRequest, UpdateRemoteResponse, UpdateRemoteError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(72, __c9, 0) as any as S.Schema, - output: __S(64, __c8, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(168, __c21, 0) as any as S.Schema, + output: __S(160, __c20, 0) as any as S.Schema, + errors: [ + BadImage, + BotUserRequired, + FailedToUnshare, + FileNotFound, + InvalidTitle, + InvalidType, + InvalidUrl, + TooLarge, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateRemote", })); -export type UploadFileError = SlackOpError; -/** Uploads or creates a file. Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `blocked_file_type` -- Admin has disabled uploading this type of file - `channel_not_found` -- At least one of the values passed for `channels` was invalid. - `invalid_channel` -- One or more channels supplied are invalid - `malware_detected` -- This file may contain a virus or other malware and can't be uploaded to Slack - `not_in_channel` -- Authenticated user is not in the channel. - `post_contents_too_large` -- File content is larger than 130kb. - `posting_to_general_channel_denied` -- An admin has restricted posting to the #general channel. - `slack_connect_blocked_file_type` -- File uploads with certain types are blocked in all Slack Connect communications - `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip sharing in Slack Connect channels - `slack_connect_file_upload_sharing_blocked` -- Admin has disabled File uploads in all Slack Connect communications - `invalid_thread_ts` -- Value passed to thread_ts was invalid - `method_deprecated` -- This API is deprecated. Please refer to https://docs.slack.dev/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay See https://docs.slack.dev/reference/methods/files.upload */ +export type UploadFileError = + | BlockedFileType + | ChannelNotFound + | InvalidChannel + | InvalidThreadTs + | MalwareDetected + | MethodDeprecated + | NotInChannel + | PostContentsTooLarge + | PostingToGeneralChannelDenied + | SlackConnectBlockedFileType + | SlackConnectClipSharingBlocked + | SlackConnectFileUploadSharingBlocked + | SlackOpError; +/** Uploads or creates a file. Required scopes -- bot: `files:write`; user: `files:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `blocked_file_type` -- Admin has disabled uploading this type of file - `channel_not_found` -- At least one of the values passed for `channels` was invalid. - `invalid_channel` -- One or more channels supplied are invalid - `malware_detected` -- This file may contain a virus or other malware and can't be uploaded to Slack - `not_in_channel` -- Authenticated user is not in the channel. - `post_contents_too_large` -- File content is larger than 130kb. - `posting_to_general_channel_denied` -- An admin has restricted posting to the #general channel. - `slack_connect_blocked_file_type` -- File uploads with certain types are blocked in all Slack Connect communications - `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip sharing in Slack Connect channels - `slack_connect_file_upload_sharing_blocked` -- Admin has disabled File uploads in all Slack Connect communications - `invalid_thread_ts` -- Value passed to thread_ts was invalid - `method_deprecated` -- This API is deprecated. Please refer to https://docs.slack.dev/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay See https://docs.slack.dev/reference/methods/files.upload */ export const uploadFile: API.OperationMethod< UploadFileRequest, UploadFileResponse, UploadFileError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(80, __c10, 0) as any as S.Schema, - output: __S(40, __c5, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(176, __c22, 0) as any as S.Schema, + output: __S(136, __c17, 0) as any as S.Schema, + errors: [ + BlockedFileType, + ChannelNotFound, + InvalidChannel, + InvalidThreadTs, + MalwareDetected, + MethodDeprecated, + NotInChannel, + PostContentsTooLarge, + PostingToGeneralChannelDenied, + SlackConnectBlockedFileType, + SlackConnectClipSharingBlocked, + SlackConnectFileUploadSharingBlocked, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -781,130 +1785,6 @@ function __c2(j: number): any { } } function __c3(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - file: S.String, - }).pipe(T.Http({ method: "POST", uri: "/files.revokePublicURL", code: 200 })), - ).annotate({ identifier: "RevokePublicURLRequest" }); - } -} -function __c4(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - id: S.optional(S.String), - created: S.optional(S.Number), - user: S.optional(S.String), - }), - ).annotate({ identifier: "RevokePublicURLResponseFile" }); - } -} -function __c5(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - file: __S(32, __c4, 0), - }), - ).annotate({ identifier: "RevokePublicURLResponse" }); - } -} -function __c6(j: number): any { - switch (j) { - case 0: - return S.Array(__S(8, __c1, 0)); - case 1: - return S.suspend(() => - S.Struct({ - file: S.String, - }).pipe(T.Http({ method: "POST", uri: "/files.sharedPublicURL", code: 200 })), - ).annotate({ identifier: "SharedPublicURLRequest" }); - case 2: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - file: __S(32, __c4, 0), - comment: S.optional(__S(48, __c6, 0)), - paging: S.optional(__S(8, __c1, 0)), - }), - ).annotate({ identifier: "SharedPublicURLResponse" }); - } -} -function __c7(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channels: S.String.pipe(T.Query()), - external_id: S.optional(S.String.pipe(T.Query())), - file: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/files.remote.share", code: 200 })), - ).annotate({ identifier: "ShareRemoteRequest" }); - } -} -function __c8(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - file: S.optional(__S(160, __c20, 0)), - }), - ).annotate({ identifier: "ShareRemoteResponse" }); - } -} -function __c9(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - external_id: S.optional(S.String), - external_url: S.optional(S.String), - file: S.optional(S.String), - filetype: S.optional(S.String), - indexable_file_contents: S.optional(S.Unknown), - preview_image: S.optional(S.Unknown), - title: S.optional(S.String), - }).pipe( - T.Http({ - method: "POST", - uri: "/files.remote.update", - code: 200, - contentType: "form-urlencoded", - }), - ), - ).annotate({ identifier: "UpdateRemoteRequest" }); - } -} -function __c10(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - channels: S.optional(S.String), - content: S.optional(S.String), - file: S.optional(S.Unknown), - filename: S.optional(S.String), - filetype: S.optional(S.String), - initial_comment: S.optional(S.String), - thread_ts: S.optional(S.String), - title: S.optional(S.String), - }).pipe( - T.Http({ - method: "POST", - uri: "/files.upload", - code: 200, - contentType: "form-urlencoded", - }), - ), - ).annotate({ identifier: "UploadFileRequest" }); - } -} -function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -915,7 +1795,7 @@ function __c11(j: number): any { ).annotate({ identifier: "DeleteCommentRequest" }); } } -function __c12(j: number): any { +function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -925,7 +1805,7 @@ function __c12(j: number): any { ).annotate({ identifier: "DeleteCommentResponse" }); } } -function __c13(j: number): any { +function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -935,7 +1815,7 @@ function __c13(j: number): any { ).annotate({ identifier: "DeleteFileRequest" }); } } -function __c14(j: number): any { +function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -965,22 +1845,22 @@ function __c14(j: number): any { }), ).annotate({ identifier: "FilesInfoResponseCommentsItem" }); case 3: - return S.Array(__S(114, __c14, 2)); + return S.Array(__S(50, __c6, 2)); case 4: return S.suspend(() => S.Struct({ ok: S.Boolean, - file: __S(113, __c14, 1), - comments: __S(115, __c14, 3), + file: __S(49, __c6, 1), + comments: __S(51, __c6, 3), content: S.optional(S.String), content_html: S.optional(S.Unknown), content_highlight_html: S.optional(S.Unknown), - response_metadata: S.optional(__S(120, __c15, 0)), + response_metadata: S.optional(__S(56, __c7, 0)), }), ).annotate({ identifier: "FilesInfoResponse" }); } } -function __c15(j: number): any { +function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -990,7 +1870,7 @@ function __c15(j: number): any { ).annotate({ identifier: "FilesInfoResponseResponseMetadata" }); } } -function __c16(j: number): any { +function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1018,7 +1898,7 @@ function __c16(j: number): any { ).annotate({ identifier: "GetUploadURLExternalResponse" }); } } -function __c17(j: number): any { +function __c9(j: number): any { switch (j) { case 0: return S.Unknown.pipe(/*@__PURE__*/ T.UnionCases([[], []])); @@ -1028,8 +1908,8 @@ function __c17(j: number): any { return S.suspend(() => S.Struct({ channel: S.optional(S.String.pipe(T.Query())), - count: S.optional(__S(136, __c17, 0).pipe(T.Query())), - page: S.optional(__S(137, __c17, 1).pipe(T.Query())), + count: S.optional(__S(72, __c9, 0).pipe(T.Query())), + page: S.optional(__S(73, __c9, 1).pipe(T.Query())), show_files_hidden_by_limit: S.optional(S.Boolean.pipe(T.Query())), team_id: S.optional(S.String.pipe(T.Query())), ts_from: S.optional(S.String.pipe(T.Query())), @@ -1039,7 +1919,7 @@ function __c17(j: number): any { }).pipe(T.Http({ method: "GET", uri: "/files.list", code: 200 })), ).annotate({ identifier: "ListFilesRequest" }); case 3: - return S.Array(__S(144, __c18, 0)); + return S.Array(__S(80, __c10, 0)); case 4: return S.suspend(() => S.Struct({ @@ -1053,13 +1933,13 @@ function __c17(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - files: __S(139, __c17, 3), - paging: S.optional(__S(140, __c17, 4)), + files: __S(75, __c9, 3), + paging: S.optional(__S(76, __c9, 4)), }), ).annotate({ identifier: "ListFilesResponse" }); } } -function __c18(j: number): any { +function __c10(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1071,7 +1951,7 @@ function __c18(j: number): any { ).annotate({ identifier: "ListFilesResponseFilesItem" }); } } -function __c19(j: number): any { +function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1084,18 +1964,18 @@ function __c19(j: number): any { }).pipe(T.Http({ method: "GET", uri: "/files.remote.list", code: 200 })), ).annotate({ identifier: "ListRemoteRequest" }); case 1: - return S.Array(__S(160, __c20, 0)); + return S.Array(__S(96, __c12, 0)); case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, - files: __S(153, __c19, 1), - response_metadata: S.optional(__S(120, __c15, 0)), + files: __S(89, __c11, 1), + response_metadata: S.optional(__S(56, __c7, 0)), }), ).annotate({ identifier: "ListRemoteResponse" }); } } -function __c20(j: number): any { +function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1105,7 +1985,7 @@ function __c20(j: number): any { ).annotate({ identifier: "ListRemoteResponseFilesItem" }); } } -function __c21(j: number): any { +function __c13(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1118,12 +1998,12 @@ function __c21(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - file: __S(144, __c18, 0), + file: __S(80, __c10, 0), }), ).annotate({ identifier: "RemoteInfoResponse" }); } } -function __c22(j: number): any { +function __c14(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1141,6 +2021,130 @@ function __c22(j: number): any { ).annotate({ identifier: "RemoveRemoteRequest" }); } } +function __c15(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + file: S.String, + }).pipe(T.Http({ method: "POST", uri: "/files.revokePublicURL", code: 200 })), + ).annotate({ identifier: "RevokePublicURLRequest" }); + } +} +function __c16(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + id: S.optional(S.String), + created: S.optional(S.Number), + user: S.optional(S.String), + }), + ).annotate({ identifier: "RevokePublicURLResponseFile" }); + } +} +function __c17(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + file: __S(128, __c16, 0), + }), + ).annotate({ identifier: "RevokePublicURLResponse" }); + } +} +function __c18(j: number): any { + switch (j) { + case 0: + return S.Array(__S(8, __c1, 0)); + case 1: + return S.suspend(() => + S.Struct({ + file: S.String, + }).pipe(T.Http({ method: "POST", uri: "/files.sharedPublicURL", code: 200 })), + ).annotate({ identifier: "SharedPublicURLRequest" }); + case 2: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + file: __S(128, __c16, 0), + comment: S.optional(__S(144, __c18, 0)), + paging: S.optional(__S(8, __c1, 0)), + }), + ).annotate({ identifier: "SharedPublicURLResponse" }); + } +} +function __c19(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channels: S.String.pipe(T.Query()), + external_id: S.optional(S.String.pipe(T.Query())), + file: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/files.remote.share", code: 200 })), + ).annotate({ identifier: "ShareRemoteRequest" }); + } +} +function __c20(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + file: S.optional(__S(96, __c12, 0)), + }), + ).annotate({ identifier: "ShareRemoteResponse" }); + } +} +function __c21(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + external_id: S.optional(S.String), + external_url: S.optional(S.String), + file: S.optional(S.String), + filetype: S.optional(S.String), + indexable_file_contents: S.optional(S.Unknown), + preview_image: S.optional(S.Unknown), + title: S.optional(S.String), + }).pipe( + T.Http({ + method: "POST", + uri: "/files.remote.update", + code: 200, + contentType: "form-urlencoded", + }), + ), + ).annotate({ identifier: "UpdateRemoteRequest" }); + } +} +function __c22(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + channels: S.optional(S.String), + content: S.optional(S.String), + file: S.optional(S.Unknown), + filename: S.optional(S.String), + filetype: S.optional(S.String), + initial_comment: S.optional(S.String), + thread_ts: S.optional(S.String), + title: S.optional(S.String), + }).pipe( + T.Http({ + method: "POST", + uri: "/files.upload", + code: 200, + contentType: "form-urlencoded", + }), + ), + ).annotate({ identifier: "UploadFileRequest" }); + } +} // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); diff --git a/packages/slack/src/services/functions.ts b/packages/slack/src/services/functions.ts index 2058e1fb72..92d61ca5bc 100644 --- a/packages/slack/src/services/functions.ts +++ b/packages/slack/src/services/functions.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,266 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `access_denied` -- This actor does not have access to this function execution. */ +export class AccessDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AccessDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "access_denied" } }], + ) {} + +/** `app_edit_disabled` -- The app is managed in Salesforce, so access to its functions can't be changed here. */ +export class AppEditDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppEditDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_edit_disabled" } }], + ) {} + +/** `app_not_found` -- This app does not exist. */ +export class AppNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "app_not_found" } }], + ) {} + +/** `cannot_fetch_versions` -- Encountered unexpected error while trying to fetch versions */ +export class CannotFetchVersions + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotFetchVersions", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_fetch_versions" } }], + ) {} + +/** `execution_not_in_running_state` -- The function execution is no longer in a state to be completed. */ +export class ExecutionNotInRunningState + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExecutionNotInRunningState", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "execution_not_in_running_state" } }], + ) {} + +/** `function_execution_not_found` -- The specified function execution cannot be found. */ +export class FunctionExecutionNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FunctionExecutionNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "function_execution_not_found" } }], + ) {} + +/** `function_not_found` -- This function does not exist. */ +export class FunctionNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FunctionNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "function_not_found" } }], + ) {} + +/** `invalid_arguments` -- The arguments passed in are invalid. */ +export class InvalidArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_arguments" } }], + ) {} + +/** `invalid_named_entities` -- One or more of the named entities was not found */ +export class InvalidNamedEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidNamedEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_named_entities" } }], + ) {} + +/** `invalid_permission_type` -- This function requires permission_type to be set as named_entities before adding users. */ +export class InvalidPermissionType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidPermissionType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_permission_type" } }], + ) {} + +/** `missing_step_ids` -- The passed in workflow is missing step IDs */ +export class MissingStepIds + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingStepIds", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_step_ids" } }], + ) {} + +/** `parameter_validation_failed` -- There were problems when validating the outputs against the Function parameters. See API response for more details. */ +export class ParameterValidationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ParameterValidationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "parameter_validation_failed" } }], + ) {} + +/** `permission_type_required` -- `permission_type` is a required input. */ +export class PermissionTypeRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PermissionTypeRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "permission_type_required" } }], + ) {} + +/** `unknown_app_id` -- The passed in workflow_app_id is invalid. */ +export class UnknownAppId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownAppId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_app_id" } }], + ) {} + +/** `unknown_function_id` -- The passed in function_id is invalid. */ +export class UnknownFunctionId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownFunctionId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_function_id" } }], + ) {} + +/** `unknown_method` -- This method does not exist. */ +export class UnknownMethod + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownMethod", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_method" } }], + ) {} + +/** `unknown_step_id` -- The passed in step_id is invalid. */ +export class UnknownStepId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownStepId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_step_id" } }], + ) {} + +/** `unknown_workflow_id` -- The passed in workflow_id is invalid. */ +export class UnknownWorkflowId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownWorkflowId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_workflow_id" } }], + ) {} + +/** `user_not_found` -- One or more of the named entities was not found. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + +/** `workflows_export_csv_not_enabled` -- Downloading form responses is not allowed. Admin pref needs to be enabled. */ +export class WorkflowsExportCsvNotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("WorkflowsExportCsvNotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "workflows_export_csv_not_enabled" } }], + ) {} + /** List of encoded user IDs */ export type AddDistributionsPermissionsRequestUserIdsList = Array; export interface AddDistributionsPermissionsRequest { @@ -215,8 +476,16 @@ export interface SetDistributionsPermissionsResponse { /** List of org IDs allowed with named_entities permission. */ org_ids?: SetDistributionsPermissionsResponseOrgIdsList | undefined; } -export type AddDistributionsPermissionsError = SlackOpError; -/** Grant users access to a custom slack function if its permission_type is set to named_entities Required scopes -- configuration: `app_configurations:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the permissions on this resource. - `function_not_found` -- This function does not exist. - `invalid_permission_type` -- This function requires permission_type to be set as named_entities before adding users. - `user_not_found` -- One or more of the named entities was not found. - `app_not_found` -- This app does not exist. - `app_edit_disabled` -- The app is managed in Salesforce, so access to its functions can't be changed here. See https://docs.slack.dev/reference/methods/functions.distributions.permissions.add */ +export type AddDistributionsPermissionsError = + | AccessDenied + | AppEditDisabled + | AppNotFound + | FunctionNotFound + | InvalidPermissionType + | UnknownMethod + | UserNotFound + | SlackOpError; +/** Grant users access to a custom slack function if its permission_type is set to named_entities Required scopes -- configuration: `app_configurations:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the permissions on this resource. - `function_not_found` -- This function does not exist. - `invalid_permission_type` -- This function requires permission_type to be set as named_entities before adding users. - `user_not_found` -- One or more of the named entities was not found. - `app_not_found` -- This app does not exist. - `app_edit_disabled` -- The app is managed in Salesforce, so access to its functions can't be changed here. See https://docs.slack.dev/reference/methods/functions.distributions.permissions.add */ export const addDistributionsPermissions: API.OperationMethod< AddDistributionsPermissionsRequest, AddDistributionsPermissionsResponse, @@ -225,15 +494,30 @@ export const addDistributionsPermissions: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(8, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppEditDisabled, + AppNotFound, + FunctionNotFound, + InvalidPermissionType, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddDistributionsPermissions", })); -export type CompleteErrorError = SlackOpError; -/** Signal that a function failed to complete Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `unknown_method` -- This method does not exist. - `function_execution_not_found` -- The specified function execution cannot be found. - `access_denied` -- This actor does not have access to this function execution. - `execution_not_in_running_state` -- The function execution is no longer in a state to be completed. See https://docs.slack.dev/reference/methods/functions.completeError */ +export type CompleteErrorError = + | AccessDenied + | ExecutionNotInRunningState + | FunctionExecutionNotFound + | UnknownMethod + | SlackOpError; +/** Signal that a function failed to complete Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `unknown_method` -- This method does not exist. - `function_execution_not_found` -- The specified function execution cannot be found. - `access_denied` -- This actor does not have access to this function execution. - `execution_not_in_running_state` -- The function execution is no longer in a state to be completed. See https://docs.slack.dev/reference/methods/functions.completeError */ export const completeError: API.OperationMethod< CompleteErrorRequest, CompleteErrorResponse, @@ -242,15 +526,28 @@ export const completeError: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(12, __c3, 0) as any as S.Schema, output: __S(16, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + ExecutionNotInRunningState, + FunctionExecutionNotFound, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CompleteError", })); -export type CompleteSuccessError = SlackOpError; -/** Signal the successful completion of a function Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `unknown_method` -- This method does not exist. - `function_execution_not_found` -- The specified function execution cannot be found. - `access_denied` -- This actor does not have access to this function execution. - `execution_not_in_running_state` -- The function execution is no longer in a state to be completed. - `parameter_validation_failed` -- There were problems when validating the outputs against the Function parameters. See API response for more details. See https://docs.slack.dev/reference/methods/functions.completeSuccess */ +export type CompleteSuccessError = + | AccessDenied + | ExecutionNotInRunningState + | FunctionExecutionNotFound + | ParameterValidationFailed + | UnknownMethod + | SlackOpError; +/** Signal the successful completion of a function Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `unknown_method` -- This method does not exist. - `function_execution_not_found` -- The specified function execution cannot be found. - `access_denied` -- This actor does not have access to this function execution. - `execution_not_in_running_state` -- The function execution is no longer in a state to be completed. - `parameter_validation_failed` -- There were problems when validating the outputs against the Function parameters. See API response for more details. See https://docs.slack.dev/reference/methods/functions.completeSuccess */ export const completeSuccess: API.OperationMethod< CompleteSuccessRequest, CompleteSuccessResponse, @@ -259,15 +556,31 @@ export const completeSuccess: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(21, __c5, 1) as any as S.Schema, output: __S(16, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + ExecutionNotInRunningState, + FunctionExecutionNotFound, + ParameterValidationFailed, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CompleteSuccess", })); -export type ExportWorkflowsStepsResponseError = SlackOpError; -/** Download form responses of a workflow Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the functions on this team. - `workflows_export_csv_not_enabled` -- Downloading form responses is not allowed. Admin pref needs to be enabled. - `unknown_workflow_id` -- The passed in workflow_id is invalid. - `unknown_step_id` -- The passed in step_id is invalid. - `invalid_arguments` -- The arguments passed in are invalid. - `unknown_app_id` -- The passed in workflow_app_id is invalid. See https://docs.slack.dev/reference/methods/functions.workflows.steps.responses.export */ +export type ExportWorkflowsStepsResponseError = + | AccessDenied + | InvalidArguments + | UnknownAppId + | UnknownMethod + | UnknownStepId + | UnknownWorkflowId + | WorkflowsExportCsvNotEnabled + | SlackOpError; +/** Download form responses of a workflow Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the functions on this team. - `workflows_export_csv_not_enabled` -- Downloading form responses is not allowed. Admin pref needs to be enabled. - `unknown_workflow_id` -- The passed in workflow_id is invalid. - `unknown_step_id` -- The passed in step_id is invalid. - `invalid_arguments` -- The arguments passed in are invalid. - `unknown_app_id` -- The passed in workflow_app_id is invalid. See https://docs.slack.dev/reference/methods/functions.workflows.steps.responses.export */ export const exportWorkflowsStepsResponse: API.OperationMethod< ExportWorkflowsStepsResponseRequest, ExportWorkflowsStepsResponseResponse, @@ -276,15 +589,31 @@ export const exportWorkflowsStepsResponse: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c6, 0) as any as S.Schema, output: __S(16, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + InvalidArguments, + UnknownAppId, + UnknownMethod, + UnknownStepId, + UnknownWorkflowId, + WorkflowsExportCsvNotEnabled, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ExportWorkflowsStepsResponse", })); -export type ListDistributionsPermissionsError = SlackOpError; -/** List the access type of a custom slack function and include the users, team or org ids with access if its permission_type is set to named_entities Required scopes -- configuration: `app_configurations:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the permissions on this resource. - `function_not_found` -- This function does not exist. - `user_not_found` -- One or more of the named entities was not found. - `app_not_found` -- This app does not exist. See https://docs.slack.dev/reference/methods/functions.distributions.permissions.list */ +export type ListDistributionsPermissionsError = + | AccessDenied + | AppNotFound + | FunctionNotFound + | UnknownMethod + | UserNotFound + | SlackOpError; +/** List the access type of a custom slack function and include the users, team or org ids with access if its permission_type is set to named_entities Required scopes -- configuration: `app_configurations:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the permissions on this resource. - `function_not_found` -- This function does not exist. - `user_not_found` -- One or more of the named entities was not found. - `app_not_found` -- This app does not exist. See https://docs.slack.dev/reference/methods/functions.distributions.permissions.list */ export const listDistributionsPermissions: API.OperationMethod< ListDistributionsPermissionsRequest, ListDistributionsPermissionsResponse, @@ -293,15 +622,32 @@ export const listDistributionsPermissions: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(28, __c7, 0) as any as S.Schema, output: __S(32, __c8, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppNotFound, + FunctionNotFound, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListDistributionsPermissions", })); -export type ListWorkflowsStepsError = SlackOpError; -/** List the steps of a specific function of a workflow's versions Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the functions on this team. - `unknown_workflow_id` -- The passed in workflow_id is invalid. - `unknown_function_id` -- The passed in function_id is invalid. - `invalid_arguments` -- The arguments passed in are invalid. - `unknown_app_id` -- The passed in workflow_app_id is invalid. - `missing_step_ids` -- The passed in workflow is missing step IDs - `cannot_fetch_versions` -- Encountered unexpected error while trying to fetch versions See https://docs.slack.dev/reference/methods/functions.workflows.steps.list */ +export type ListWorkflowsStepsError = + | AccessDenied + | CannotFetchVersions + | InvalidArguments + | MissingStepIds + | UnknownAppId + | UnknownFunctionId + | UnknownMethod + | UnknownWorkflowId + | SlackOpError; +/** List the steps of a specific function of a workflow's versions Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the functions on this team. - `unknown_workflow_id` -- The passed in workflow_id is invalid. - `unknown_function_id` -- The passed in function_id is invalid. - `invalid_arguments` -- The arguments passed in are invalid. - `unknown_app_id` -- The passed in workflow_app_id is invalid. - `missing_step_ids` -- The passed in workflow is missing step IDs - `cannot_fetch_versions` -- Encountered unexpected error while trying to fetch versions See https://docs.slack.dev/reference/methods/functions.workflows.steps.list */ export const listWorkflowsSteps: API.OperationMethod< ListWorkflowsStepsRequest, ListWorkflowsStepsResponse, @@ -310,15 +656,33 @@ export const listWorkflowsSteps: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(36, __c9, 0) as any as S.Schema, output: __S(38, __c9, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + CannotFetchVersions, + InvalidArguments, + MissingStepIds, + UnknownAppId, + UnknownFunctionId, + UnknownMethod, + UnknownWorkflowId, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListWorkflowsSteps", })); -export type RemoveDistributionsPermissionsError = SlackOpError; -/** Revoke user access to a custom slack function if permission_type set to named_entities Required scopes -- configuration: `app_configurations:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the permissions on this resource. - `function_not_found` -- This function does not exist. - `user_not_found` -- One or more of the named entities was not found. - `invalid_permission_type` -- This function requires permission_type to be set as named_entities before adding users. - `app_not_found` -- This app does not exist. See https://docs.slack.dev/reference/methods/functions.distributions.permissions.remove */ +export type RemoveDistributionsPermissionsError = + | AccessDenied + | AppNotFound + | FunctionNotFound + | InvalidPermissionType + | UnknownMethod + | UserNotFound + | SlackOpError; +/** Revoke user access to a custom slack function if permission_type set to named_entities Required scopes -- configuration: `app_configurations:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the permissions on this resource. - `function_not_found` -- This function does not exist. - `user_not_found` -- One or more of the named entities was not found. - `invalid_permission_type` -- This function requires permission_type to be set as named_entities before adding users. - `app_not_found` -- This app does not exist. See https://docs.slack.dev/reference/methods/functions.distributions.permissions.remove */ export const removeDistributionsPermissions: API.OperationMethod< RemoveDistributionsPermissionsRequest, RemoveDistributionsPermissionsResponse, @@ -327,15 +691,34 @@ export const removeDistributionsPermissions: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(40, __c10, 0) as any as S.Schema, output: __S(8, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppNotFound, + FunctionNotFound, + InvalidPermissionType, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveDistributionsPermissions", })); -export type SetDistributionsPermissionsError = SlackOpError; -/** Set the access type of a custom slack function and define the users, team or org ids to be granted access if permission_type is set to named_entities Required scopes -- configuration: `app_configurations:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the permissions on this resource. - `function_not_found` -- This function does not exist. - `invalid_named_entities` -- One or more of the named entities was not found - `invalid_permission_type` -- This function requires permission_type to be set as named_entities before adding users. - `user_not_found` -- One or more of the named entities was not found. - `app_not_found` -- This app does not exist. - `permission_type_required` -- `permission_type` is a required input. - `app_edit_disabled` -- The app is managed in Salesforce, so access to its functions can't be changed here. See https://docs.slack.dev/reference/methods/functions.distributions.permissions.set */ +export type SetDistributionsPermissionsError = + | AccessDenied + | AppEditDisabled + | AppNotFound + | FunctionNotFound + | InvalidNamedEntities + | InvalidPermissionType + | PermissionTypeRequired + | UnknownMethod + | UserNotFound + | SlackOpError; +/** Set the access type of a custom slack function and define the users, team or org ids to be granted access if permission_type is set to named_entities Required scopes -- configuration: `app_configurations:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the permissions on this resource. - `function_not_found` -- This function does not exist. - `invalid_named_entities` -- One or more of the named entities was not found - `invalid_permission_type` -- This function requires permission_type to be set as named_entities before adding users. - `user_not_found` -- One or more of the named entities was not found. - `app_not_found` -- This app does not exist. - `permission_type_required` -- `permission_type` is a required input. - `app_edit_disabled` -- The app is managed in Salesforce, so access to its functions can't be changed here. See https://docs.slack.dev/reference/methods/functions.distributions.permissions.set */ export const setDistributionsPermissions: API.OperationMethod< SetDistributionsPermissionsRequest, SetDistributionsPermissionsResponse, @@ -344,7 +727,19 @@ export const setDistributionsPermissions: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(44, __c11, 0) as any as S.Schema, output: __S(32, __c8, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + AppEditDisabled, + AppNotFound, + FunctionNotFound, + InvalidNamedEntities, + InvalidPermissionType, + PermissionTypeRequired, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/lists.ts b/packages/slack/src/services/lists.ts index 9c6591b8bc..b21a7a413c 100644 --- a/packages/slack/src/services/lists.ts +++ b/packages/slack/src/services/lists.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,711 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `archive_not_supported` -- Archiving is not supported. */ +export class ArchiveNotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ArchiveNotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "archive_not_supported" } }], + ) {} + +/** `channel_not_found` -- A channel could not be found. */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `column_id_not_provided` -- The `column_id` or `column_id_to_create` field must be provided. */ +export class ColumnIdNotProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ColumnIdNotProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "column_id_not_provided" } }], + ) {} + +/** `column_not_found` -- The column was not found. */ +export class ColumnNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ColumnNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "column_not_found" } }], + ) {} + +/** `duplicated_item_not_found` -- The item to duplicate cannot be found. */ +export class DuplicatedItemNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DuplicatedItemNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "duplicated_item_not_found" } }], + ) {} + +/** `failed_to_update_user_ids` -- Failed to update the specified user IDs. */ +export class FailedToUpdateUserIds + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedToUpdateUserIds", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_to_update_user_ids" } }], + ) {} + +/** `file_channel_rename_error` -- Failed to rename file channel based on file title. */ +export class FileChannelRenameError + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileChannelRenameError", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_channel_rename_error" } }], + ) {} + +/** `file_not_found` -- The attachment file could not be found. */ +export class FileNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_not_found" } }], + ) {} + +/** `invalid_args` -- The provided arguments are invalid. */ +export class InvalidArgs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArgs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_args" } }], + ) {} + +/** `invalid_attachment` -- Invalid attachment provided. */ +export class InvalidAttachment + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAttachment", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_attachment" } }], + ) {} + +/** `invalid_blocks` -- Rich text payload supplied is invalid. */ +export class InvalidBlocks + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidBlocks", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_blocks" } }], + ) {} + +/** `invalid_column_id` -- The column ID provided does not exist in the List. */ +export class InvalidColumnId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidColumnId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_column_id" } }], + ) {} + +/** `invalid_column_type` -- Column type not allowed. */ +export class InvalidColumnType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidColumnType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_column_type" } }], + ) {} + +/** `invalid_copy_and_schema_args` -- Cannot provide both `copy_from_list_id` and `schema`. */ +export class InvalidCopyAndSchemaArgs + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCopyAndSchemaArgs", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_copy_and_schema_args" } }], + ) {} + +/** `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_date` -- Date supplied is invalid. */ +export class InvalidDate + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidDate", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_date" } }], + ) {} + +/** `invalid_email` -- Email supplied is invalid. */ +export class InvalidEmail + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEmail", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_email" } }], + ) {} + +/** `invalid_input_type` -- The field value type does not match the column type. */ +export class InvalidInputType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidInputType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_input_type" } }], + ) {} + +/** `invalid_link` -- Message archive link supplied is invalid. */ +export class InvalidLink + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidLink", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_link" } }], + ) {} + +/** `invalid_message` -- Invalid message provided. */ +export class InvalidMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_message" } }], + ) {} + +/** `invalid_option_id` -- Option ID provided does not match column definition. */ +export class InvalidOptionId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidOptionId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_option_id" } }], + ) {} + +/** `invalid_parameters` -- One of `user_ids` or `channel_ids` must be defined, but not both. */ +export class InvalidParameters + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidParameters", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_parameters" } }], + ) {} + +/** `invalid_phone_number` -- Invalid phone number provided. */ +export class InvalidPhoneNumber + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidPhoneNumber", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_phone_number" } }], + ) {} + +/** `invalid_primary_column` -- Missing or more than one primary column. */ +export class InvalidPrimaryColumn + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidPrimaryColumn", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_primary_column" } }], + ) {} + +/** `invalid_reference` -- Invalid reference provided; a reference cell holds one record or message. */ +export class InvalidReference + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidReference", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_reference" } }], + ) {} + +/** `invalid_row_id` -- Invalid row ID for this List. */ +export class InvalidRowId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRowId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_row_id" } }], + ) {} + +/** `invalid_schema` -- The schema was invalid. */ +export class InvalidSchema + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidSchema", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_schema" } }], + ) {} + +/** `invalid_text_block` -- Rich text payload supplied is invalid. */ +export class InvalidTextBlock + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTextBlock", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_text_block" } }], + ) {} + +/** `invalid_timestamp` -- Timestamp supplied is invalid. */ +export class InvalidTimestamp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTimestamp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_timestamp" } }], + ) {} + +/** `invalid_view_metadata` -- A view on the List to copy has settings that cannot be read, so the List cannot be copied. */ +export class InvalidViewMetadata + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidViewMetadata", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_view_metadata" } }], + ) {} + +/** `invalid_vote_value` -- Invalid value provided for a vote column. */ +export class InvalidVoteValue + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidVoteValue", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_vote_value" } }], + ) {} + +/** `job_not_found` -- Could not find an export job matching that ID. */ +export class JobNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("JobNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "job_not_found" } }], + ) {} + +/** `list_editor_upsert_error` -- Failed to upsert List editor. */ +export class ListEditorUpsertError + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ListEditorUpsertError", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "list_editor_upsert_error" } }], + ) {} + +/** `list_edits_update_error` -- Failed to update List metadata. */ +export class ListEditsUpdateError + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ListEditsUpdateError", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "list_edits_update_error" } }], + ) {} + +/** `list_not_found` -- The List you wish to update permissions for is not available. */ +export class ListNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ListNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "list_not_found" } }], + ) {} + +/** `lists_disabled_user_team` -- Lists is disabled on user's team. */ +export class ListsDisabledUserTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ListsDisabledUserTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "lists_disabled_user_team" } }], + ) {} + +/** `missing_arg_copy_from_list_id` -- Missing argument `copy_from_list_id`. */ +export class MissingArgCopyFromListId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgCopyFromListId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_arg_copy_from_list_id" } }], + ) {} + +/** `missing_arguments` -- No arguments were provided to update the List. */ +export class MissingArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_arguments" } }], + ) {} + +/** `over_cell_fields_limit` -- Too many values provided for a single field. */ +export class OverCellFieldsLimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OverCellFieldsLimit", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "over_cell_fields_limit" } }], + ) {} + +/** `over_column_maximum` -- Cannot create List with more than allowed column count. */ +export class OverColumnMaximum + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OverColumnMaximum", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "over_column_maximum" } }], + ) {} + +/** `over_list_file_maximum` -- Cannot create any more List files. */ +export class OverListFileMaximum + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OverListFileMaximum", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "over_list_file_maximum" } }], + ) {} + +/** `over_row_maximum` -- Cannot create more items over the maximum. */ +export class OverRowMaximum + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OverRowMaximum", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "over_row_maximum" } }], + ) {} + +/** `over_title_length_maximum` -- Title can not exceed defined length. */ +export class OverTitleLengthMaximum + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OverTitleLengthMaximum", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "over_title_length_maximum" } }], + ) {} + +/** `permission_denied` -- The user does not have permission to perform this action. */ +export class PermissionDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PermissionDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "permission_denied" } }], + ) {} + +/** `record_deleted` -- The record has been deleted. */ +export class RecordDeleted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RecordDeleted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "record_deleted" } }], + ) {} + +/** `record_not_found` -- The record was not found in the List. */ +export class RecordNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RecordNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "record_not_found" } }], + ) {} + +/** `restricted_action` -- User does not have permission to perform this action. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `row_id_not_provided` -- The `row_id` or `row_id_to_create` field must be provided. */ +export class RowIdNotProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RowIdNotProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "row_id_not_provided" } }], + ) {} + +/** `row_not_found` -- The row was not found. */ +export class RowNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RowNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "row_not_found" } }], + ) {} + +/** `team_not_found` -- The team cannot be found. */ +export class TeamNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "team_not_found" } }], + ) {} + +/** `uneditable_column` -- Initial values provided for an uneditable column. */ +export class UneditableColumn + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UneditableColumn", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "uneditable_column" } }], + ) {} + +/** `unexpected_description_blocks_arg` -- Unexpected description blocks argument. */ +export class UnexpectedDescriptionBlocksArg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "UnexpectedDescriptionBlocksArg", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "unexpected_description_blocks_arg" } }], + ) {} + +/** `unknown_method` -- Feature not enabled for this team. */ +export class UnknownMethod + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownMethod", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_method" } }], + ) {} + +/** `user_not_found` -- A user could not be found. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + /** Initial item data. */ export type CreateItemRequestInitialFieldsList = Array; export interface CreateItemRequest { @@ -249,8 +955,33 @@ export interface UpdateSlackListResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type CreateItemError = SlackOpError; -/** Add a new item to an existing List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `list_not_found` -- The List was not found. - `over_row_maximum` -- Cannot create more items over the maximum. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `duplicated_item_not_found` -- The item to duplicate cannot be found. - `invalid_option_id` -- Option ID provided does not match column definition. - `invalid_args` -- The provided arguments are invalid. - `uneditable_column` -- Initial values provided for an uneditable column. - `invalid_input_type` -- The field value type does not match the column type. - `invalid_column_id` -- The column ID provided does not exist in the List. - `over_cell_fields_limit` -- Too many values provided for a single field. - `file_not_found` -- The attachment file could not be found. - `invalid_vote_value` -- Invalid value provided for a vote column. - `invalid_date` -- Date supplied is invalid. - `invalid_email` -- Email supplied is invalid. - `invalid_phone_number` -- Invalid phone number provided. - `invalid_message` -- Invalid message provided. - `invalid_attachment` -- Invalid attachment provided. - `invalid_text_block` -- Rich text payload supplied is invalid. - `invalid_timestamp` -- Timestamp supplied is invalid. - `invalid_reference` -- Invalid reference provided; a reference cell holds one record or message. - `channel_not_found` -- The channel cannot be found. - `restricted_action` -- A team preference prevents this action. - `permission_denied` -- The user does not have permission to perform this action (for example, frontline members cannot create List items). See https://docs.slack.dev/reference/methods/slackLists.items.create */ +export type CreateItemError = + | ChannelNotFound + | DuplicatedItemNotFound + | FileNotFound + | InvalidArgs + | InvalidAttachment + | InvalidColumnId + | InvalidDate + | InvalidEmail + | InvalidInputType + | InvalidMessage + | InvalidOptionId + | InvalidPhoneNumber + | InvalidReference + | InvalidTextBlock + | InvalidTimestamp + | InvalidVoteValue + | ListNotFound + | OverCellFieldsLimit + | OverRowMaximum + | PermissionDenied + | RestrictedAction + | TeamNotFound + | UneditableColumn + | UserNotFound + | SlackOpError; +/** Add a new item to an existing List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `list_not_found` -- The List was not found. - `over_row_maximum` -- Cannot create more items over the maximum. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `duplicated_item_not_found` -- The item to duplicate cannot be found. - `invalid_option_id` -- Option ID provided does not match column definition. - `invalid_args` -- The provided arguments are invalid. - `uneditable_column` -- Initial values provided for an uneditable column. - `invalid_input_type` -- The field value type does not match the column type. - `invalid_column_id` -- The column ID provided does not exist in the List. - `over_cell_fields_limit` -- Too many values provided for a single field. - `file_not_found` -- The attachment file could not be found. - `invalid_vote_value` -- Invalid value provided for a vote column. - `invalid_date` -- Date supplied is invalid. - `invalid_email` -- Email supplied is invalid. - `invalid_phone_number` -- Invalid phone number provided. - `invalid_message` -- Invalid message provided. - `invalid_attachment` -- Invalid attachment provided. - `invalid_text_block` -- Rich text payload supplied is invalid. - `invalid_timestamp` -- Timestamp supplied is invalid. - `invalid_reference` -- Invalid reference provided; a reference cell holds one record or message. - `channel_not_found` -- The channel cannot be found. - `restricted_action` -- A team preference prevents this action. - `permission_denied` -- The user does not have permission to perform this action (for example, frontline members cannot create List items). See https://docs.slack.dev/reference/methods/slackLists.items.create */ export const createItem: API.OperationMethod< CreateItemRequest, CreateItemResponse, @@ -259,15 +990,56 @@ export const createItem: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + DuplicatedItemNotFound, + FileNotFound, + InvalidArgs, + InvalidAttachment, + InvalidColumnId, + InvalidDate, + InvalidEmail, + InvalidInputType, + InvalidMessage, + InvalidOptionId, + InvalidPhoneNumber, + InvalidReference, + InvalidTextBlock, + InvalidTimestamp, + InvalidVoteValue, + ListNotFound, + OverCellFieldsLimit, + OverRowMaximum, + PermissionDenied, + RestrictedAction, + TeamNotFound, + UneditableColumn, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateItem", })); -export type CreateSlackListError = SlackOpError; -/** Create a List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `permission_denied` -- The user does not have permission to perform this action. - `invalid_schema` -- The schema was invalid. - `invalid_primary_column` -- Missing or more than one primary column. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `over_list_file_maximum` -- Cannot create any more List files. - `over_title_length_maximum` -- Title can not exceed defined length. - `invalid_column_type` -- Column type not allowed. - `missing_arg_copy_from_list_id` -- Missing argument `copy_from_list_id`. - `invalid_copy_and_schema_args` -- Cannot provide both `copy_from_list_id` and `schema`. - `over_column_maximum` -- Cannot create List with more than allowed column count. - `list_not_found` -- The List was not found. - `invalid_view_metadata` -- A view on the List to copy has settings that cannot be read, so the List cannot be copied. See https://docs.slack.dev/reference/methods/slackLists.create */ +export type CreateSlackListError = + | InvalidColumnType + | InvalidCopyAndSchemaArgs + | InvalidPrimaryColumn + | InvalidSchema + | InvalidViewMetadata + | ListNotFound + | MissingArgCopyFromListId + | OverColumnMaximum + | OverListFileMaximum + | OverTitleLengthMaximum + | PermissionDenied + | TeamNotFound + | UserNotFound + | SlackOpError; +/** Create a List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `permission_denied` -- The user does not have permission to perform this action. - `invalid_schema` -- The schema was invalid. - `invalid_primary_column` -- Missing or more than one primary column. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `over_list_file_maximum` -- Cannot create any more List files. - `over_title_length_maximum` -- Title can not exceed defined length. - `invalid_column_type` -- Column type not allowed. - `missing_arg_copy_from_list_id` -- Missing argument `copy_from_list_id`. - `invalid_copy_and_schema_args` -- Cannot provide both `copy_from_list_id` and `schema`. - `over_column_maximum` -- Cannot create List with more than allowed column count. - `list_not_found` -- The List was not found. - `invalid_view_metadata` -- A view on the List to copy has settings that cannot be read, so the List cannot be copied. See https://docs.slack.dev/reference/methods/slackLists.create */ export const createSlackList: API.OperationMethod< CreateSlackListRequest, CreateSlackListResponse, @@ -276,117 +1048,209 @@ export const createSlackList: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c2, 0) as any as S.Schema, output: __S(9, __c2, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + InvalidColumnType, + InvalidCopyAndSchemaArgs, + InvalidPrimaryColumn, + InvalidSchema, + InvalidViewMetadata, + ListNotFound, + MissingArgCopyFromListId, + OverColumnMaximum, + OverListFileMaximum, + OverTitleLengthMaximum, + PermissionDenied, + TeamNotFound, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateSlackList", })); -export type DeleteAccessError = SlackOpError; -/** Revoke access to a List for specified entities. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `lists_disabled_user_team` -- Lists is disabled on user's team. - `list_not_found` -- The List you wish to update permissions for is not available. - `channel_not_found` -- A channel could not be found. - `failed_to_update_user_ids` -- Failed to update the specified user IDs. - `invalid_parameters` -- One of `user_ids` or `channel_ids` must be defined, but not both. - `restricted_action` -- User does not have permission to perform this action. - `user_not_found` -- A user could not be found. See https://docs.slack.dev/reference/methods/slackLists.access.delete */ +export type DeleteAccessError = + | ChannelNotFound + | FailedToUpdateUserIds + | InvalidParameters + | ListNotFound + | ListsDisabledUserTeam + | RestrictedAction + | UserNotFound + | SlackOpError; +/** Revoke access to a List for specified entities. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `lists_disabled_user_team` -- Lists is disabled on user's team. - `list_not_found` -- The List you wish to update permissions for is not available. - `channel_not_found` -- A channel could not be found. - `failed_to_update_user_ids` -- Failed to update the specified user IDs. - `invalid_parameters` -- One of `user_ids` or `channel_ids` must be defined, but not both. - `restricted_action` -- User does not have permission to perform this action. - `user_not_found` -- A user could not be found. See https://docs.slack.dev/reference/methods/slackLists.access.delete */ export const deleteAccess: API.OperationMethod< DeleteAccessRequest, DeleteAccessResponse, DeleteAccessError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(20, __c5, 0) as any as S.Schema, - output: __S(28, __c7, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(12, __c3, 0) as any as S.Schema, + output: __S(20, __c5, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + FailedToUpdateUserIds, + InvalidParameters, + ListNotFound, + ListsDisabledUserTeam, + RestrictedAction, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteAccess", })); -export type DeleteItemError = SlackOpError; -/** Deletes an item from an existing List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `list_not_found` -- The List was not found. - `record_not_found` -- The record was not found in the List. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `permission_denied` -- The user does not have permission to perform this action (for example, frontline members cannot delete List items). See https://docs.slack.dev/reference/methods/slackLists.items.delete */ +export type DeleteItemError = + | ListNotFound + | PermissionDenied + | RecordNotFound + | TeamNotFound + | UserNotFound + | SlackOpError; +/** Deletes an item from an existing List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `list_not_found` -- The List was not found. - `record_not_found` -- The record was not found in the List. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `permission_denied` -- The user does not have permission to perform this action (for example, frontline members cannot delete List items). See https://docs.slack.dev/reference/methods/slackLists.items.delete */ export const deleteItem: API.OperationMethod< DeleteItemRequest, DeleteItemResponse, DeleteItemError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(32, __c8, 0) as any as S.Schema, - output: __S(36, __c9, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(24, __c6, 0) as any as S.Schema, + output: __S(28, __c7, 0) as any as S.Schema, + errors: [ + ListNotFound, + PermissionDenied, + RecordNotFound, + TeamNotFound, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteItem", })); -export type DeleteMultipleError = SlackOpError; -/** Deletes multiple items from an existing List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `list_not_found` -- The List was not found. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `permission_denied` -- The user does not have permission to perform this action (for example, frontline members cannot delete List items). See https://docs.slack.dev/reference/methods/slackLists.items.deleteMultiple */ +export type DeleteMultipleError = + | ListNotFound + | PermissionDenied + | TeamNotFound + | UserNotFound + | SlackOpError; +/** Deletes multiple items from an existing List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `list_not_found` -- The List was not found. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `permission_denied` -- The user does not have permission to perform this action (for example, frontline members cannot delete List items). See https://docs.slack.dev/reference/methods/slackLists.items.deleteMultiple */ export const deleteMultiple: API.OperationMethod< DeleteMultipleRequest, DeleteMultipleResponse, DeleteMultipleError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(40, __c10, 0) as any as S.Schema, - output: __S(36, __c9, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(32, __c8, 0) as any as S.Schema, + output: __S(28, __c7, 0) as any as S.Schema, + errors: [ + ListNotFound, + PermissionDenied, + TeamNotFound, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteMultiple", })); -export type DownloadGetError = SlackOpError; -/** Retrieve List download URL from an export job to download List contents. Required scopes -- bot: `lists:read`; user: `lists:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `list_not_found` -- The List was not found. - `permission_denied` -- The bot does not have permission to perform this action. - `unknown_method` -- Feature not enabled for this team. - `job_not_found` -- Could not find an export job matching that ID. See https://docs.slack.dev/reference/methods/slackLists.download.get */ +export type DownloadGetError = + | JobNotFound + | ListNotFound + | PermissionDenied + | UnknownMethod + | SlackOpError; +/** Retrieve List download URL from an export job to download List contents. Required scopes -- bot: `lists:read`; user: `lists:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `list_not_found` -- The List was not found. - `permission_denied` -- The bot does not have permission to perform this action. - `unknown_method` -- Feature not enabled for this team. - `job_not_found` -- Could not find an export job matching that ID. See https://docs.slack.dev/reference/methods/slackLists.download.get */ export const downloadGet: API.OperationMethod< DownloadGetRequest, DownloadGetResponse, DownloadGetError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(44, __c11, 0) as any as S.Schema, - output: __S(45, __c11, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(36, __c9, 0) as any as S.Schema, + output: __S(37, __c9, 1) as any as S.Schema, + errors: [ + JobNotFound, + ListNotFound, + PermissionDenied, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DownloadGet", })); -export type DownloadStartError = SlackOpError; -/** Initiate a job to export List contents. Required scopes -- bot: `lists:read`; user: `lists:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `list_not_found` -- The List was not found. - `permission_denied` -- The bot does not have permission to perform this action. - `unknown_method` -- Feature not enabled for this team. See https://docs.slack.dev/reference/methods/slackLists.download.start */ +export type DownloadStartError = ListNotFound | PermissionDenied | UnknownMethod | SlackOpError; +/** Initiate a job to export List contents. Required scopes -- bot: `lists:read`; user: `lists:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `list_not_found` -- The List was not found. - `permission_denied` -- The bot does not have permission to perform this action. - `unknown_method` -- Feature not enabled for this team. See https://docs.slack.dev/reference/methods/slackLists.download.start */ export const downloadStart: API.OperationMethod< DownloadStartRequest, DownloadStartResponse, DownloadStartError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(48, __c12, 0) as any as S.Schema, - output: __S(49, __c12, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(40, __c10, 0) as any as S.Schema, + output: __S(41, __c10, 1) as any as S.Schema, + errors: [ListNotFound, PermissionDenied, UnknownMethod, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DownloadStart", })); -export type ItemsInfoError = SlackOpError; -/** Get a row from a List. Required scopes -- bot: `lists:read`; user: `lists:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `list_not_found` -- The List was not found. - `record_not_found` -- The record was not found in the List. - `record_deleted` -- The record has been deleted. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. See https://docs.slack.dev/reference/methods/slackLists.items.info */ +export type ItemsInfoError = + | ListNotFound + | RecordDeleted + | RecordNotFound + | TeamNotFound + | UserNotFound + | SlackOpError; +/** Get a row from a List. Required scopes -- bot: `lists:read`; user: `lists:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `list_not_found` -- The List was not found. - `record_not_found` -- The record was not found in the List. - `record_deleted` -- The record has been deleted. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. See https://docs.slack.dev/reference/methods/slackLists.items.info */ export const itemsInfo: API.OperationMethod< ItemsInfoRequest, ItemsInfoResponse, ItemsInfoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(52, __c13, 0) as any as S.Schema, - output: __S(53, __c13, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(44, __c11, 0) as any as S.Schema, + output: __S(45, __c11, 1) as any as S.Schema, + errors: [ + ListNotFound, + RecordDeleted, + RecordNotFound, + TeamNotFound, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ItemsInfo", })); -export type ListItemsError = SlackOpError; -/** Get records from a List. Required scopes -- bot: `lists:read`; user: `lists:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `list_not_found` -- The List was not found. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `archive_not_supported` -- Archiving is not supported. See https://docs.slack.dev/reference/methods/slackLists.items.list */ +export type ListItemsError = + | ArchiveNotSupported + | InvalidCursor + | ListNotFound + | TeamNotFound + | UserNotFound + | SlackOpError; +/** Get records from a List. Required scopes -- bot: `lists:read`; user: `lists:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `list_not_found` -- The List was not found. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `archive_not_supported` -- Archiving is not supported. See https://docs.slack.dev/reference/methods/slackLists.items.list */ export const listItems: API.PaginatedOperationMethod< ListItemsRequest, ListItemsResponse, @@ -395,9 +1259,17 @@ export const listItems: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(56, __c14, 0) as any as S.Schema, - output: __S(58, __c14, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(48, __c12, 0) as any as S.Schema, + output: __S(50, __c12, 2) as any as S.Schema, + errors: [ + ArchiveNotSupported, + InvalidCursor, + ListNotFound, + TeamNotFound, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -413,51 +1285,147 @@ export const listItems: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type SetAccessError = SlackOpError; -/** Set the access level to a List for specified entities. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `lists_disabled_user_team` -- Lists is disabled on user's team. - `list_not_found` -- The List you wish to update permissions for is not available. - `channel_not_found` -- A channel could not be found. - `failed_to_update_user_ids` -- Failed to update the specified user IDs. - `invalid_parameters` -- One of `user_ids` or `channel_ids` must be defined, but not both. - `restricted_action` -- User does not have permission to perform this action. - `user_not_found` -- A user could not be found. See https://docs.slack.dev/reference/methods/slackLists.access.set */ +export type SetAccessError = + | ChannelNotFound + | FailedToUpdateUserIds + | InvalidParameters + | ListNotFound + | ListsDisabledUserTeam + | RestrictedAction + | UserNotFound + | SlackOpError; +/** Set the access level to a List for specified entities. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `lists_disabled_user_team` -- Lists is disabled on user's team. - `list_not_found` -- The List you wish to update permissions for is not available. - `channel_not_found` -- A channel could not be found. - `failed_to_update_user_ids` -- Failed to update the specified user IDs. - `invalid_parameters` -- One of `user_ids` or `channel_ids` must be defined, but not both. - `restricted_action` -- User does not have permission to perform this action. - `user_not_found` -- A user could not be found. See https://docs.slack.dev/reference/methods/slackLists.access.set */ export const setAccess: API.OperationMethod< SetAccessRequest, SetAccessResponse, SetAccessError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(60, __c15, 0) as any as S.Schema, - output: __S(28, __c7, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(52, __c13, 0) as any as S.Schema, + output: __S(20, __c5, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + FailedToUpdateUserIds, + InvalidParameters, + ListNotFound, + ListsDisabledUserTeam, + RestrictedAction, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetAccess", })); -export type UpdateItemError = SlackOpError; -/** Updates cells in a List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `list_not_found` -- The List was not found. - `row_not_found` -- The row was not found. - `column_not_found` -- The column was not found. - `file_not_found` -- Invalid file ID for this List. - `invalid_input_type` -- Supplied value key or value type is invalid for the given column type. - `invalid_row_id` -- Invalid row ID for this List. - `invalid_column_id` -- Invalid column ID for this List. - `permission_denied` -- The user does not have permission to perform this action. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `channel_not_found` -- The channel cannot be found. - `uneditable_column` -- The column cannot be updated. - `invalid_blocks` -- Rich text payload supplied is invalid. - `invalid_text_block` -- Rich text payload supplied is invalid. - `invalid_email` -- Email supplied is invalid. - `invalid_link` -- Message archive link supplied is invalid. - `invalid_date` -- Date supplied is invalid. - `invalid_option_id` -- Option supplied is invalid. - `row_id_not_provided` -- The `row_id` or `row_id_to_create` field must be provided. - `column_id_not_provided` -- The `column_id` or `column_id_to_create` field must be provided. - `over_cell_fields_limit` -- The supplied cell fields are over the cell field maximum. - `invalid_message` -- Invalid message provided. - `invalid_attachment` -- Invalid attachment provided. - `invalid_phone_number` -- Invalid phone number provided. - `invalid_vote_value` -- Invalid vote value is supplied. See https://docs.slack.dev/reference/methods/slackLists.items.update */ +export type UpdateItemError = + | ChannelNotFound + | ColumnIdNotProvided + | ColumnNotFound + | FileNotFound + | InvalidAttachment + | InvalidBlocks + | InvalidColumnId + | InvalidDate + | InvalidEmail + | InvalidInputType + | InvalidLink + | InvalidMessage + | InvalidOptionId + | InvalidPhoneNumber + | InvalidRowId + | InvalidTextBlock + | InvalidVoteValue + | ListNotFound + | OverCellFieldsLimit + | PermissionDenied + | RowIdNotProvided + | RowNotFound + | TeamNotFound + | UneditableColumn + | UserNotFound + | SlackOpError; +/** Updates cells in a List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `list_not_found` -- The List was not found. - `row_not_found` -- The row was not found. - `column_not_found` -- The column was not found. - `file_not_found` -- Invalid file ID for this List. - `invalid_input_type` -- Supplied value key or value type is invalid for the given column type. - `invalid_row_id` -- Invalid row ID for this List. - `invalid_column_id` -- Invalid column ID for this List. - `permission_denied` -- The user does not have permission to perform this action. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `channel_not_found` -- The channel cannot be found. - `uneditable_column` -- The column cannot be updated. - `invalid_blocks` -- Rich text payload supplied is invalid. - `invalid_text_block` -- Rich text payload supplied is invalid. - `invalid_email` -- Email supplied is invalid. - `invalid_link` -- Message archive link supplied is invalid. - `invalid_date` -- Date supplied is invalid. - `invalid_option_id` -- Option supplied is invalid. - `row_id_not_provided` -- The `row_id` or `row_id_to_create` field must be provided. - `column_id_not_provided` -- The `column_id` or `column_id_to_create` field must be provided. - `over_cell_fields_limit` -- The supplied cell fields are over the cell field maximum. - `invalid_message` -- Invalid message provided. - `invalid_attachment` -- Invalid attachment provided. - `invalid_phone_number` -- Invalid phone number provided. - `invalid_vote_value` -- Invalid vote value is supplied. See https://docs.slack.dev/reference/methods/slackLists.items.update */ export const updateItem: API.OperationMethod< UpdateItemRequest, UpdateItemResponse, UpdateItemError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(12, __c3, 0) as any as S.Schema, - output: __S(36, __c9, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(56, __c14, 0) as any as S.Schema, + output: __S(28, __c7, 0) as any as S.Schema, + errors: [ + ChannelNotFound, + ColumnIdNotProvided, + ColumnNotFound, + FileNotFound, + InvalidAttachment, + InvalidBlocks, + InvalidColumnId, + InvalidDate, + InvalidEmail, + InvalidInputType, + InvalidLink, + InvalidMessage, + InvalidOptionId, + InvalidPhoneNumber, + InvalidRowId, + InvalidTextBlock, + InvalidVoteValue, + ListNotFound, + OverCellFieldsLimit, + PermissionDenied, + RowIdNotProvided, + RowNotFound, + TeamNotFound, + UneditableColumn, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateItem", })); -export type UpdateSlackListError = SlackOpError; -/** Update a List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `list_not_found` -- The List was not found. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `list_edits_update_error` -- Failed to update List metadata. - `list_editor_upsert_error` -- Failed to upsert List editor. - `over_title_length_maximum` -- Title can not exceed defined length. - `file_channel_rename_error` -- Failed to rename file channel based on file title. - `unexpected_description_blocks_arg` -- Unexpected description blocks argument. - `missing_arguments` -- No arguments were provided to update the List. - `permission_denied` -- The user does not have permission to perform this action. See https://docs.slack.dev/reference/methods/slackLists.update */ +export type UpdateSlackListError = + | FileChannelRenameError + | ListEditorUpsertError + | ListEditsUpdateError + | ListNotFound + | MissingArguments + | OverTitleLengthMaximum + | PermissionDenied + | TeamNotFound + | UnexpectedDescriptionBlocksArg + | UserNotFound + | SlackOpError; +/** Update a List. Required scopes -- bot: `lists:write`; user: `lists:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `list_not_found` -- The List was not found. - `team_not_found` -- The team cannot be found. - `user_not_found` -- The user cannot be found. - `list_edits_update_error` -- Failed to update List metadata. - `list_editor_upsert_error` -- Failed to upsert List editor. - `over_title_length_maximum` -- Title can not exceed defined length. - `file_channel_rename_error` -- Failed to rename file channel based on file title. - `unexpected_description_blocks_arg` -- Unexpected description blocks argument. - `missing_arguments` -- No arguments were provided to update the List. - `permission_denied` -- The user does not have permission to perform this action. See https://docs.slack.dev/reference/methods/slackLists.update */ export const updateSlackList: API.OperationMethod< UpdateSlackListRequest, UpdateSlackListResponse, UpdateSlackListError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(16, __c4, 0) as any as S.Schema, - output: __S(36, __c9, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(60, __c15, 0) as any as S.Schema, + output: __S(28, __c7, 0) as any as S.Schema, + errors: [ + FileChannelRenameError, + ListEditorUpsertError, + ListEditsUpdateError, + ListNotFound, + MissingArguments, + OverTitleLengthMaximum, + PermissionDenied, + TeamNotFound, + UnexpectedDescriptionBlocksArg, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -520,55 +1488,31 @@ function __c3(j: number): any { return S.suspend(() => S.Struct({ list_id: S.String, - cells: __S(4, __c1, 0), - }).pipe(T.Http({ method: "POST", uri: "/slackLists.items.update", code: 200 })), - ).annotate({ identifier: "UpdateItemRequest" }); - } -} -function __c4(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - id: S.String, - name: S.optional(S.String), - description_blocks: S.optional(__S(4, __c1, 0)), - todo_mode: S.optional(S.Boolean), - }).pipe(T.Http({ method: "POST", uri: "/slackLists.update", code: 200 })), - ).annotate({ identifier: "UpdateSlackListRequest" }); - } -} -function __c5(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - list_id: S.String, - channel_ids: S.optional(__S(24, __c6, 0)), - user_ids: S.optional(__S(24, __c6, 0)), + channel_ids: S.optional(__S(16, __c4, 0)), + user_ids: S.optional(__S(16, __c4, 0)), }).pipe(T.Http({ method: "POST", uri: "/slackLists.access.delete", code: 200 })), ).annotate({ identifier: "DeleteAccessRequest" }); } } -function __c6(j: number): any { +function __c4(j: number): any { switch (j) { case 0: return S.Array(S.String); } } -function __c7(j: number): any { +function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ ok: S.Boolean, - failed_to_update_channel_ids: S.optional(__S(24, __c6, 0)), - failed_to_update_user_ids: S.optional(__S(24, __c6, 0)), + failed_to_update_channel_ids: S.optional(__S(16, __c4, 0)), + failed_to_update_user_ids: S.optional(__S(16, __c4, 0)), }), ).annotate({ identifier: "DeleteAccessResponse" }); } } -function __c8(j: number): any { +function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -579,7 +1523,7 @@ function __c8(j: number): any { ).annotate({ identifier: "DeleteItemRequest" }); } } -function __c9(j: number): any { +function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -589,18 +1533,18 @@ function __c9(j: number): any { ).annotate({ identifier: "DeleteItemResponse" }); } } -function __c10(j: number): any { +function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ list_id: S.String, - ids: __S(24, __c6, 0), + ids: __S(16, __c4, 0), }).pipe(T.Http({ method: "POST", uri: "/slackLists.items.deleteMultiple", code: 200 })), ).annotate({ identifier: "DeleteMultipleRequest" }); } } -function __c11(j: number): any { +function __c9(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -623,7 +1567,7 @@ function __c11(j: number): any { ).annotate({ identifier: "DownloadGetResponse" }); } } -function __c12(j: number): any { +function __c10(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -644,7 +1588,7 @@ function __c12(j: number): any { ).annotate({ identifier: "DownloadStartResponse" }); } } -function __c13(j: number): any { +function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -666,7 +1610,7 @@ function __c13(j: number): any { ).annotate({ identifier: "ItemsInfoResponse" }); } } -function __c14(j: number): any { +function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -689,25 +1633,49 @@ function __c14(j: number): any { S.Struct({ ok: S.Boolean, items: __S(4, __c1, 0), - response_metadata: S.optional(__S(57, __c14, 1)), + response_metadata: S.optional(__S(49, __c12, 1)), list: S.optional(S.Unknown), }), ).annotate({ identifier: "ListItemsResponse" }); } } -function __c15(j: number): any { +function __c13(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ list_id: S.String, access_level: S.String, - channel_ids: S.optional(__S(24, __c6, 0)), - user_ids: S.optional(__S(24, __c6, 0)), + channel_ids: S.optional(__S(16, __c4, 0)), + user_ids: S.optional(__S(16, __c4, 0)), }).pipe(T.Http({ method: "POST", uri: "/slackLists.access.set", code: 200 })), ).annotate({ identifier: "SetAccessRequest" }); } } +function __c14(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + list_id: S.String, + cells: __S(4, __c1, 0), + }).pipe(T.Http({ method: "POST", uri: "/slackLists.items.update", code: 200 })), + ).annotate({ identifier: "UpdateItemRequest" }); + } +} +function __c15(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + id: S.String, + name: S.optional(S.String), + description_blocks: S.optional(__S(4, __c1, 0)), + todo_mode: S.optional(S.Boolean), + }).pipe(T.Http({ method: "POST", uri: "/slackLists.update", code: 200 })), + ).annotate({ identifier: "UpdateSlackListRequest" }); + } +} // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); diff --git a/packages/slack/src/services/migration.ts b/packages/slack/src/services/migration.ts index 75b1024bcc..2f9599b63b 100644 --- a/packages/slack/src/services/migration.ts +++ b/packages/slack/src/services/migration.ts @@ -24,6 +24,32 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `not_enterprise_team` -- The workspace associated with the token is not part of an Enterprise organization. User IDs have not changed and there is nothing to map. */ +export class NotEnterpriseTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotEnterpriseTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_enterprise_team" } }], + ) {} + +/** `too_many_users` -- Too many user IDs provided in `users`. Up to 400 user IDs are allowed per request. */ +export class TooManyUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_users" } }], + ) {} + export type MigrationExchangeRequestUsersList = Array; export interface MigrationExchangeRequest { /** A comma-separated list of user ids, up to 400 per request */ @@ -43,8 +69,8 @@ export interface MigrationExchangeResponse { user_id_map: MigrationExchangeResponseUserIdMapMap; invalid_user_ids?: MigrationExchangeResponseInvalidUserIdsList | undefined; } -export type MigrationExchangeError = SlackOpError; -/** For Enterprise organization workspaces, map local user IDs to global user IDs Required scopes -- bot: `tokens.basic`; user: `tokens.basic` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_enterprise_team` -- The workspace associated with the token is not part of an Enterprise organization. User IDs have not changed and there is nothing to map. - `too_many_users` -- Too many user IDs provided in `users`. Up to 400 user IDs are allowed per request. See https://docs.slack.dev/reference/methods/migration.exchange */ +export type MigrationExchangeError = NotEnterpriseTeam | TooManyUsers | SlackOpError; +/** For Enterprise organization workspaces, map local user IDs to global user IDs Required scopes -- bot: `tokens.basic`; user: `tokens.basic` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `not_enterprise_team` -- The workspace associated with the token is not part of an Enterprise organization. User IDs have not changed and there is nothing to map. - `too_many_users` -- Too many user IDs provided in `users`. Up to 400 user IDs are allowed per request. See https://docs.slack.dev/reference/methods/migration.exchange */ export const migrationExchange: API.OperationMethod< MigrationExchangeRequest, MigrationExchangeResponse, @@ -53,7 +79,7 @@ export const migrationExchange: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(1, __c0, 1) as any as S.Schema, output: __S(3, __c0, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [NotEnterpriseTeam, TooManyUsers, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/oauth.ts b/packages/slack/src/services/oauth.ts index 2c3836038a..6e4ccf3d1f 100644 --- a/packages/slack/src/services/oauth.ts +++ b/packages/slack/src/services/oauth.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,607 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `app_not_admin_approved` -- The app has not been approved by an org admin, so no tokens can be issued for this user. Ask an org admin to approve the app before requesting a token with the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant. */ +export class AppNotAdminApproved + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotAdminApproved", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_not_admin_approved" } }], + ) {} + +/** `app_not_org_installed` -- The app is not installed at the organization level. Using the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant type requires org level app installs. */ +export class AppNotOrgInstalled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AppNotOrgInstalled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "app_not_org_installed" } }], + ) {} + +/** `authorization_not_found` -- The underlying authorization for this token was revoked or is invalid. */ +export class AuthorizationNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AuthorizationNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "authorization_not_found" } }], + ) {} + +/** `bad_client_secret` -- Value passed for `client_secret` was invalid. */ +export class BadClientSecret + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadClientSecret", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_client_secret" } }], + ) {} + +/** `bad_redirect_uri` -- Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. */ +export class BadRedirectUri + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadRedirectUri", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_redirect_uri" } }], + ) {} + +/** `cannot_install_an_org_installed_app` -- Returned when the the org-installed app cannot be installed on a workspace. */ +export class CannotInstallAnOrgInstalledApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "CannotInstallAnOrgInstalledApp", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "cannot_install_an_org_installed_app" } }], + ) {} + +/** `client_id_mismatch` -- Value passed for `client_id` did not match the `client_id` in the assertion. */ +export class ClientIdMismatch + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ClientIdMismatch", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "client_id_mismatch" } }], + ) {} + +/** `code_already_used` -- Value passed for `code` was already exchanged. */ +export class CodeAlreadyUsed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CodeAlreadyUsed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "code_already_used" } }], + ) {} + +/** `ema_disabled` -- Enterprise-managed auth is disabled. */ +export class EmaDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EmaDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "ema_disabled" } }], + ) {} + +/** `ema_issuer_mismatch` -- The issuer in the assertion did not match the issuer configured for enterprise-managed auth. */ +export class EmaIssuerMismatch + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EmaIssuerMismatch", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "ema_issuer_mismatch" } }], + ) {} + +/** `ema_tenant_mismatch` -- The `aud_tenant` in an assertion without a `sub_id` is missing, or is not the ID of the organization or workspace whose identity provider issued it. */ +export class EmaTenantMismatch + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EmaTenantMismatch", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "ema_tenant_mismatch" } }], + ) {} + +/** `invalid_audience` -- The audience in the assertion is not one this token endpoint supports. */ +export class InvalidAudience + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAudience", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_audience" } }], + ) {} + +/** `invalid_aud_tenant` -- The `aud_tenant` in the assertion is not a string. It must be the ID of the organization or workspace whose identity provider issued the assertion. */ +export class InvalidAudTenant + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidAudTenant", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_aud_tenant" } }], + ) {} + +/** `invalid_client_id` -- Value passed for `client_id` was invalid. */ +export class InvalidClientId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidClientId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_client_id" } }], + ) {} + +/** `invalid_code` -- Value passed for `code` was invalid. */ +export class InvalidCode + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCode", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_code" } }], + ) {} + +/** `invalid_code_verifier` -- The code_verifier is invalid. */ +export class InvalidCodeVerifier + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCodeVerifier", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_code_verifier" } }], + ) {} + +/** `invalid_email` -- The `email` in the assertion is not a string. */ +export class InvalidEmail + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEmail", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_email" } }], + ) {} + +/** `invalid_grant_type` -- Value passed for `grant_type` was invalid. */ +export class InvalidGrantType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidGrantType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_grant_type" } }], + ) {} + +/** `invalid_issuer` -- The `iss` in the assertion is not a string. It must be the issuer URL of the identity provider that issued the assertion. */ +export class InvalidIssuer + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidIssuer", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_issuer" } }], + ) {} + +/** `invalid_jti` -- The `jti` in the assertion is not a string. It must be a unique identifier for the assertion. */ +export class InvalidJti + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidJti", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_jti" } }], + ) {} + +/** `invalid_refresh_token` -- The given refresh token is invalid. */ +export class InvalidRefreshToken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRefreshToken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_refresh_token" } }], + ) {} + +/** `invalid_resource` -- The `resource` in the assertion is malformed, or is not a resource tokens can be issued for. */ +export class InvalidResource + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidResource", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_resource" } }], + ) {} + +/** `invalid_scope` -- The `scope` in the assertion is not a string. It must be a space-delimited list of scopes. */ +export class InvalidScope + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidScope", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_scope" } }], + ) {} + +/** `invalid_sub` -- The `sub` in the assertion is not a string. */ +export class InvalidSub + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidSub", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_sub" } }], + ) {} + +/** `invalid_sub_id_format` -- The `format` of the `sub_id` in the assertion is not a string. The only supported format is `saml-nameid`. */ +export class InvalidSubIdFormat + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidSubIdFormat", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_sub_id_format" } }], + ) {} + +/** `invalid_token` -- Invalid refresh token. */ +export class InvalidToken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidToken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_token" } }], + ) {} + +/** `missing_audience` -- Missing `aud` in the assertion. It must name this token endpoint as an audience. */ +export class MissingAudience + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingAudience", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_audience" } }], + ) {} + +/** `missing_client_id` -- Missing `client_id` in the assertion. It must match the `client_id` of the app requesting the token. */ +export class MissingClientId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingClientId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_client_id" } }], + ) {} + +/** `missing_resource` -- Missing permission resource. */ +export class MissingResource + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingResource", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_resource" } }], + ) {} + +/** `missing_scope` -- Missing `scope` in the assertion. The identity assertion JWT must carry a space-delimited `scope` claim. */ +export class MissingScope + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingScope", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_scope" } }], + ) {} + +/** `no_approved_scopes_requested` -- The app is approved by org admins, but none of the requested scopes are approved ones. Ask an org admin to approve the requested scopes. */ +export class NoApprovedScopesRequested + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoApprovedScopesRequested", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_approved_scopes_requested" } }], + ) {} + +/** `no_app_scopes_requested` -- None of the scopes requested in the identity assertion are configured on the app. Request only scopes the app already declares. */ +export class NoAppScopesRequested + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoAppScopesRequested", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_app_scopes_requested" } }], + ) {} + +/** `no_assertion` -- Missing `assertion` in the request. */ +export class NoAssertion + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoAssertion", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_assertion" } }], + ) {} + +/** `no_idp_config_for_entity_id` -- No Enterprise-Managed Authorization (cross-app access) configuration is bound to the identity provider's SAML EntityID carried in the assertion's `sub_id`. An org admin must configure External Identity / cross-app access for that identity provider before requesting a token with the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant. */ +export class NoIdpConfigForEntityId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoIdpConfigForEntityId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_idp_config_for_entity_id" } }], + ) {} + +/** `no_scopes` -- Missing `scope` in the request. */ +export class NoScopes + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoScopes", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_scopes" } }], + ) {} + +/** `not_implemented` -- Method not yet supported */ +export class NotImplemented + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotImplemented", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_implemented" } }], + ) {} + +/** `no_user_scopes` -- Missing user `scope` in the auth request. */ +export class NoUserScopes + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoUserScopes", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_user_scopes" } }], + ) {} + +/** `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/authorize. */ +export class OauthAuthorizationUrlMismatch + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OauthAuthorizationUrlMismatch", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "oauth_authorization_url_mismatch" } }], + ) {} + +/** `pkce_not_allowed` -- The app is not allowed to use the PKCE flow. */ +export class PkceNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PkceNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "pkce_not_allowed" } }], + ) {} + +/** `preview_feature_not_available` -- Returned when the API method is not yet available on the team in context. */ +export class PreviewFeatureNotAvailable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PreviewFeatureNotAvailable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "preview_feature_not_available" } }], + ) {} + +/** `rotation_not_found` -- No pending rotation was found for this token. Call oauth.v2.beginShortTokenRotation first, or the pending rotation may have expired. */ +export class RotationNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RotationNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "rotation_not_found" } }], + ) {} + +/** `token_already_exchanged` -- This token has already been exchanged for a pair of token credentials. */ +export class TokenAlreadyExchanged + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TokenAlreadyExchanged", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "token_already_exchanged" } }], + ) {} + +/** `token_rotation_not_enabled` -- The app does not have token rotation enabled. */ +export class TokenRotationNotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TokenRotationNotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "token_rotation_not_enabled" } }], + ) {} + +/** `token_too_long` -- This token is not short enough to be rotated. */ +export class TokenTooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TokenTooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "token_too_long" } }], + ) {} + +/** `user_email_unverified` -- The users email is unverified */ +export class UserEmailUnverified + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserEmailUnverified", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_email_unverified" } }], + ) {} + +/** `user_not_authenticated` -- The user has never authenticated via single sign-on. */ +export class UserNotAuthenticated + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotAuthenticated", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_not_authenticated" } }], + ) {} + export interface BeginShortTokenRotationRequest { /** Issued when you created your application. Must be the app the token being rotated was issued to. */ client_id: string; @@ -309,8 +911,13 @@ export interface V2UserAccessResponse { team: V2AccessResponseTeam | null; enterprise: V2AccessResponseEnterprise | null; } -export type BeginShortTokenRotationError = SlackOpError; -/** Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change. Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `invalid_client_id` -- Value passed for `client_id` was invalid, or is not the app the token being rotated was issued to. - `invalid_token` -- This token is invalid. - `internal_error` -- A server-side error occurred. - `token_too_long` -- This token is not short enough to be rotated. See https://docs.slack.dev/reference/methods/oauth.v2.beginShortTokenRotation */ +export type BeginShortTokenRotationError = + | BadClientSecret + | InvalidClientId + | InvalidToken + | TokenTooLong + | SlackOpError; +/** Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change. Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `invalid_client_id` -- Value passed for `client_id` was invalid, or is not the app the token being rotated was issued to. - `invalid_token` -- This token is invalid. - `internal_error` -- A server-side error occurred. - `token_too_long` -- This token is not short enough to be rotated. See https://docs.slack.dev/reference/methods/oauth.v2.beginShortTokenRotation */ export const beginShortTokenRotation: API.OperationMethod< BeginShortTokenRotationRequest, BeginShortTokenRotationResponse, @@ -319,15 +926,28 @@ export const beginShortTokenRotation: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadClientSecret, + InvalidClientId, + InvalidToken, + TokenTooLong, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BeginShortTokenRotation", })); -export type CompleteShortTokenRotationError = SlackOpError; -/** Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process. Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `invalid_client_id` -- Value passed for `client_id` was invalid, or is not the app the token being rotated was issued to. - `invalid_token` -- This token is invalid. - `rotation_not_found` -- No pending rotation was found for this token. Call oauth.v2.beginShortTokenRotation first, or the pending rotation may have expired. - `internal_error` -- A server-side error occurred. - `token_too_long` -- This token is not short enough to be rotated. See https://docs.slack.dev/reference/methods/oauth.v2.completeShortTokenRotation */ +export type CompleteShortTokenRotationError = + | BadClientSecret + | InvalidClientId + | InvalidToken + | RotationNotFound + | TokenTooLong + | SlackOpError; +/** Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process. Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `invalid_client_id` -- Value passed for `client_id` was invalid, or is not the app the token being rotated was issued to. - `invalid_token` -- This token is invalid. - `rotation_not_found` -- No pending rotation was found for this token. Call oauth.v2.beginShortTokenRotation first, or the pending rotation may have expired. - `internal_error` -- A server-side error occurred. - `token_too_long` -- This token is not short enough to be rotated. See https://docs.slack.dev/reference/methods/oauth.v2.completeShortTokenRotation */ export const completeShortTokenRotation: API.OperationMethod< CompleteShortTokenRotationRequest, CompleteShortTokenRotationResponse, @@ -336,15 +956,33 @@ export const completeShortTokenRotation: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(16, __c1, 0) as any as S.Schema, output: __S(17, __c1, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadClientSecret, + InvalidClientId, + InvalidToken, + RotationNotFound, + TokenTooLong, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CompleteShortTokenRotation", })); -export type OauthAccessError = SlackOpError; -/** Exchanges a temporary OAuth verifier code for an access token. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `bad_redirect_uri` -- Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `code_already_used` -- Value passed for `code` was already exchanged. - `internal_error` -- Something went wrong during app installation. - `invalid_client_id` -- Value passed for `client_id` was invalid. - `invalid_code` -- Value passed for `code` was invalid. - `invalid_token` -- Invalid refresh token. - `missing_resource` -- Missing permission resource. - `ratelimited` -- Too many requests made in succession. - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/authorize. - `user_email_unverified` -- The users email is unverified See https://docs.slack.dev/reference/methods/oauth.access */ +export type OauthAccessError = + | BadClientSecret + | BadRedirectUri + | CodeAlreadyUsed + | InvalidClientId + | InvalidCode + | InvalidToken + | MissingResource + | OauthAuthorizationUrlMismatch + | UserEmailUnverified + | SlackOpError; +/** Exchanges a temporary OAuth verifier code for an access token. Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `bad_redirect_uri` -- Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `code_already_used` -- Value passed for `code` was already exchanged. - `internal_error` -- Something went wrong during app installation. - `invalid_client_id` -- Value passed for `client_id` was invalid. - `invalid_code` -- Value passed for `code` was invalid. - `invalid_token` -- Invalid refresh token. - `missing_resource` -- Missing permission resource. - `ratelimited` -- Too many requests made in succession. - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/authorize. - `user_email_unverified` -- The users email is unverified See https://docs.slack.dev/reference/methods/oauth.access */ export const oauthAccess: API.OperationMethod< OauthAccessRequest, OauthAccessResponse, @@ -353,15 +991,41 @@ export const oauthAccess: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c2, 0) as any as S.Schema, output: __S(40, __c2, 8) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadClientSecret, + BadRedirectUri, + CodeAlreadyUsed, + InvalidClientId, + InvalidCode, + InvalidToken, + MissingResource, + OauthAuthorizationUrlMismatch, + UserEmailUnverified, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "OauthAccess", })); -export type V2AccessError = SlackOpError; -/** Exchanges a temporary OAuth verifier code for an access token. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `bad_redirect_uri` -- Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` -- Returned when the the org-installed app cannot be installed on a workspace. - `invalid_client_id` -- Value passed for `client_id` was invalid. - `invalid_code` -- Value passed for `code` was invalid. - `invalid_grant_type` -- Value passed for `grant_type` was invalid. - `invalid_refresh_token` -- The given refresh token is invalid. - `no_scopes` -- Missing `scope` in the request. - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/v2/authorize. - `preview_feature_not_available` -- Returned when the API method is not yet available on the team in context. - `user_email_unverified` -- The users email is unverified. - `pkce_not_allowed` -- The app is not allowed to use the PKCE flow. - `invalid_code_verifier` -- The code_verifier is invalid. See https://docs.slack.dev/reference/methods/oauth.v2.access */ +export type V2AccessError = + | BadClientSecret + | BadRedirectUri + | CannotInstallAnOrgInstalledApp + | InvalidClientId + | InvalidCode + | InvalidCodeVerifier + | InvalidGrantType + | InvalidRefreshToken + | NoScopes + | OauthAuthorizationUrlMismatch + | PkceNotAllowed + | PreviewFeatureNotAvailable + | UserEmailUnverified + | SlackOpError; +/** Exchanges a temporary OAuth verifier code for an access token. Rate limit tier: 5 Method-specific errors (each a typed error named after its slug): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `bad_redirect_uri` -- Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` -- Returned when the the org-installed app cannot be installed on a workspace. - `invalid_client_id` -- Value passed for `client_id` was invalid. - `invalid_code` -- Value passed for `code` was invalid. - `invalid_grant_type` -- Value passed for `grant_type` was invalid. - `invalid_refresh_token` -- The given refresh token is invalid. - `no_scopes` -- Missing `scope` in the request. - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/v2/authorize. - `preview_feature_not_available` -- Returned when the API method is not yet available on the team in context. - `user_email_unverified` -- The users email is unverified. - `pkce_not_allowed` -- The app is not allowed to use the PKCE flow. - `invalid_code_verifier` -- The code_verifier is invalid. See https://docs.slack.dev/reference/methods/oauth.v2.access */ export const v2Access: API.OperationMethod< V2AccessRequest, V2AccessResponse, @@ -370,15 +1034,38 @@ export const v2Access: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c3, 0) as any as S.Schema, output: __S(51, __c3, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadClientSecret, + BadRedirectUri, + CannotInstallAnOrgInstalledApp, + InvalidClientId, + InvalidCode, + InvalidCodeVerifier, + InvalidGrantType, + InvalidRefreshToken, + NoScopes, + OauthAuthorizationUrlMismatch, + PkceNotAllowed, + PreviewFeatureNotAvailable, + UserEmailUnverified, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "V2Access", })); -export type V2ExchangeError = SlackOpError; -/** Exchanges a legacy access token for a new expiring access token and refresh token Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `authorization_not_found` -- The underlying authorization for this token was revoked or is invalid. - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `internal_error` -- A server-side error occurred. - `invalid_client_id` -- Value passed for `client_id` was invalid. - `invalid_token` -- The legacy token provided cannot be exchanged for a new pair of token credentials. - `token_already_exchanged` -- This token has already been exchanged for a pair of token credentials. - `token_rotation_not_enabled` -- The app does not have token rotation enabled. See https://docs.slack.dev/reference/methods/oauth.v2.exchange */ +export type V2ExchangeError = + | AuthorizationNotFound + | BadClientSecret + | InvalidClientId + | InvalidToken + | TokenAlreadyExchanged + | TokenRotationNotEnabled + | SlackOpError; +/** Exchanges a legacy access token for a new expiring access token and refresh token Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `authorization_not_found` -- The underlying authorization for this token was revoked or is invalid. - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `internal_error` -- A server-side error occurred. - `invalid_client_id` -- Value passed for `client_id` was invalid. - `invalid_token` -- The legacy token provided cannot be exchanged for a new pair of token credentials. - `token_already_exchanged` -- This token has already been exchanged for a pair of token credentials. - `token_rotation_not_enabled` -- The app does not have token rotation enabled. See https://docs.slack.dev/reference/methods/oauth.v2.exchange */ export const v2Exchange: API.OperationMethod< V2ExchangeRequest, V2ExchangeResponse, @@ -387,15 +1074,61 @@ export const v2Exchange: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(80, __c5, 0) as any as S.Schema, output: __S(81, __c5, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AuthorizationNotFound, + BadClientSecret, + InvalidClientId, + InvalidToken, + TokenAlreadyExchanged, + TokenRotationNotEnabled, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "V2Exchange", })); -export type V2UserAccessError = SlackOpError; -/** Exchanges a temporary OAuth verifier code for a user access token. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `bad_redirect_uri` -- Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` -- Returned when the the org-installed app cannot be installed on a workspace. - `invalid_client_id` -- Value passed for `client_id` was invalid, or the `client_id` in the assertion is not a string. - `invalid_code` -- Value passed for `code` was invalid. - `invalid_grant_type` -- Value passed for `grant_type` was invalid. - `invalid_refresh_token` -- The given refresh token is invalid. - `invalid_resource` -- The `resource` in the assertion is malformed, or is not a resource tokens can be issued for. - `no_scopes` -- Missing `scope` in the request. - `no_user_scopes` -- Missing user `scope` in the auth request. - `not_implemented` -- Method not yet supported - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/v2/authorize . - `preview_feature_not_available` -- Returned when the API method is not yet available on the team in context. - `user_email_unverified` -- The users email is unverified - `app_not_admin_approved` -- The app has not been approved by an org admin, so no tokens can be issued for this user. Ask an org admin to approve the app before requesting a token with the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant. - `app_not_org_installed` -- The app is not installed at the organization level. Using the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant type requires org level app installs. - `client_id_mismatch` -- Value passed for `client_id` did not match the `client_id` in the assertion. - `ema_disabled` -- Enterprise-managed auth is disabled. - `ema_issuer_mismatch` -- The issuer in the assertion did not match the issuer configured for enterprise-managed auth. - `invalid_audience` -- The audience in the assertion is not one this token endpoint supports. - `missing_scope` -- Missing `scope` in the assertion. The identity assertion JWT must carry a space-delimited `scope` claim. - `no_app_scopes_requested` -- None of the scopes requested in the identity assertion are configured on the app. Request only scopes the app already declares. - `no_approved_scopes_requested` -- The app is approved by org admins, but none of the requested scopes are approved ones. Ask an org admin to approve the requested scopes. - `no_assertion` -- Missing `assertion` in the request. - `user_not_authenticated` -- The user has never authenticated via single sign-on. - `no_idp_config_for_entity_id` -- No Enterprise-Managed Authorization (cross-app access) configuration is bound to the identity provider's SAML EntityID carried in the assertion's `sub_id`. An org admin must configure External Identity / cross-app access for that identity provider before requesting a token with the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant. - `ema_tenant_mismatch` -- The `aud_tenant` in an assertion without a `sub_id` is missing, or is not the ID of the organization or workspace whose identity provider issued it. - `invalid_aud_tenant` -- The `aud_tenant` in the assertion is not a string. It must be the ID of the organization or workspace whose identity provider issued the assertion. - `invalid_email` -- The `email` in the assertion is not a string. - `invalid_issuer` -- The `iss` in the assertion is not a string. It must be the issuer URL of the identity provider that issued the assertion. - `invalid_jti` -- The `jti` in the assertion is not a string. It must be a unique identifier for the assertion. - `invalid_scope` -- The `scope` in the assertion is not a string. It must be a space-delimited list of scopes. - `invalid_sub` -- The `sub` in the assertion is not a string. - `invalid_sub_id_format` -- The `format` of the `sub_id` in the assertion is not a string. The only supported format is `saml-nameid`. - `missing_audience` -- Missing `aud` in the assertion. It must name this token endpoint as an audience. - `missing_client_id` -- Missing `client_id` in the assertion. It must match the `client_id` of the app requesting the token. See https://docs.slack.dev/reference/methods/oauth.v2.user.access */ +export type V2UserAccessError = + | AppNotAdminApproved + | AppNotOrgInstalled + | BadClientSecret + | BadRedirectUri + | CannotInstallAnOrgInstalledApp + | ClientIdMismatch + | EmaDisabled + | EmaIssuerMismatch + | EmaTenantMismatch + | InvalidAudTenant + | InvalidAudience + | InvalidClientId + | InvalidCode + | InvalidEmail + | InvalidGrantType + | InvalidIssuer + | InvalidJti + | InvalidRefreshToken + | InvalidResource + | InvalidScope + | InvalidSub + | InvalidSubIdFormat + | MissingAudience + | MissingClientId + | MissingScope + | NoAppScopesRequested + | NoApprovedScopesRequested + | NoAssertion + | NoIdpConfigForEntityId + | NoScopes + | NoUserScopes + | NotImplemented + | OauthAuthorizationUrlMismatch + | PreviewFeatureNotAvailable + | UserEmailUnverified + | UserNotAuthenticated + | SlackOpError; +/** Exchanges a temporary OAuth verifier code for a user access token. Rate limit tier: 5 Method-specific errors (each a typed error named after its slug): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `bad_redirect_uri` -- Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` -- Returned when the the org-installed app cannot be installed on a workspace. - `invalid_client_id` -- Value passed for `client_id` was invalid, or the `client_id` in the assertion is not a string. - `invalid_code` -- Value passed for `code` was invalid. - `invalid_grant_type` -- Value passed for `grant_type` was invalid. - `invalid_refresh_token` -- The given refresh token is invalid. - `invalid_resource` -- The `resource` in the assertion is malformed, or is not a resource tokens can be issued for. - `no_scopes` -- Missing `scope` in the request. - `no_user_scopes` -- Missing user `scope` in the auth request. - `not_implemented` -- Method not yet supported - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/v2/authorize . - `preview_feature_not_available` -- Returned when the API method is not yet available on the team in context. - `user_email_unverified` -- The users email is unverified - `app_not_admin_approved` -- The app has not been approved by an org admin, so no tokens can be issued for this user. Ask an org admin to approve the app before requesting a token with the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant. - `app_not_org_installed` -- The app is not installed at the organization level. Using the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant type requires org level app installs. - `client_id_mismatch` -- Value passed for `client_id` did not match the `client_id` in the assertion. - `ema_disabled` -- Enterprise-managed auth is disabled. - `ema_issuer_mismatch` -- The issuer in the assertion did not match the issuer configured for enterprise-managed auth. - `invalid_audience` -- The audience in the assertion is not one this token endpoint supports. - `missing_scope` -- Missing `scope` in the assertion. The identity assertion JWT must carry a space-delimited `scope` claim. - `no_app_scopes_requested` -- None of the scopes requested in the identity assertion are configured on the app. Request only scopes the app already declares. - `no_approved_scopes_requested` -- The app is approved by org admins, but none of the requested scopes are approved ones. Ask an org admin to approve the requested scopes. - `no_assertion` -- Missing `assertion` in the request. - `user_not_authenticated` -- The user has never authenticated via single sign-on. - `no_idp_config_for_entity_id` -- No Enterprise-Managed Authorization (cross-app access) configuration is bound to the identity provider's SAML EntityID carried in the assertion's `sub_id`. An org admin must configure External Identity / cross-app access for that identity provider before requesting a token with the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant. - `ema_tenant_mismatch` -- The `aud_tenant` in an assertion without a `sub_id` is missing, or is not the ID of the organization or workspace whose identity provider issued it. - `invalid_aud_tenant` -- The `aud_tenant` in the assertion is not a string. It must be the ID of the organization or workspace whose identity provider issued the assertion. - `invalid_email` -- The `email` in the assertion is not a string. - `invalid_issuer` -- The `iss` in the assertion is not a string. It must be the issuer URL of the identity provider that issued the assertion. - `invalid_jti` -- The `jti` in the assertion is not a string. It must be a unique identifier for the assertion. - `invalid_scope` -- The `scope` in the assertion is not a string. It must be a space-delimited list of scopes. - `invalid_sub` -- The `sub` in the assertion is not a string. - `invalid_sub_id_format` -- The `format` of the `sub_id` in the assertion is not a string. The only supported format is `saml-nameid`. - `missing_audience` -- Missing `aud` in the assertion. It must name this token endpoint as an audience. - `missing_client_id` -- Missing `client_id` in the assertion. It must match the `client_id` of the app requesting the token. See https://docs.slack.dev/reference/methods/oauth.v2.user.access */ export const v2UserAccess: API.OperationMethod< V2UserAccessRequest, V2UserAccessResponse, @@ -404,7 +1137,46 @@ export const v2UserAccess: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(96, __c6, 0) as any as S.Schema, output: __S(97, __c6, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AppNotAdminApproved, + AppNotOrgInstalled, + BadClientSecret, + BadRedirectUri, + CannotInstallAnOrgInstalledApp, + ClientIdMismatch, + EmaDisabled, + EmaIssuerMismatch, + EmaTenantMismatch, + InvalidAudTenant, + InvalidAudience, + InvalidClientId, + InvalidCode, + InvalidEmail, + InvalidGrantType, + InvalidIssuer, + InvalidJti, + InvalidRefreshToken, + InvalidResource, + InvalidScope, + InvalidSub, + InvalidSubIdFormat, + MissingAudience, + MissingClientId, + MissingScope, + NoAppScopesRequested, + NoApprovedScopesRequested, + NoAssertion, + NoIdpConfigForEntityId, + NoScopes, + NoUserScopes, + NotImplemented, + OauthAuthorizationUrlMismatch, + PreviewFeatureNotAvailable, + UserEmailUnverified, + UserNotAuthenticated, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/openid.ts b/packages/slack/src/services/openid.ts index d378d228d6..979c95a689 100644 --- a/packages/slack/src/services/openid.ts +++ b/packages/slack/src/services/openid.ts @@ -25,6 +25,178 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `bad_client_secret` -- The value passed for `client_secret` was invalid. */ +export class BadClientSecret + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadClientSecret", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_client_secret" } }], + ) {} + +/** `bad_redirect_uri` -- The value passed for `redirect_uri` did not match the `redirect_uri` in the original request. */ +export class BadRedirectUri + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadRedirectUri", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_redirect_uri" } }], + ) {} + +/** `cannot_install_an_org_installed_app` -- An org-installed app cannot be installed on a workspace. */ +export class CannotInstallAnOrgInstalledApp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "CannotInstallAnOrgInstalledApp", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "cannot_install_an_org_installed_app" } }], + ) {} + +/** `invalid_client` -- Client authentication failed (unknown `client_id` or bad `client_secret`). */ +export class InvalidClient + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidClient", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_client" } }], + ) {} + +/** `invalid_client_id` -- The value passed for `client_id` was invalid. */ +export class InvalidClientId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidClientId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_client_id" } }], + ) {} + +/** `invalid_code` -- The value passed for `code` was invalid. */ +export class InvalidCode + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCode", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_code" } }], + ) {} + +/** `invalid_grant` -- The authorization code is invalid, expired, revoked, or the PKCE `code_verifier` does not match. */ +export class InvalidGrant + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidGrant", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_grant" } }], + ) {} + +/** `invalid_grant_type` -- The value passed for `grant_type` was invalid. */ +export class InvalidGrantType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidGrantType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_grant_type" } }], + ) {} + +/** `invalid_refresh_token` -- The given refresh token is invalid. */ +export class InvalidRefreshToken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRefreshToken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_refresh_token" } }], + ) {} + +/** `invalid_request` -- The request is missing a required parameter or includes an invalid parameter value. */ +export class InvalidRequest + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRequest", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_request" } }], + ) {} + +/** `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization URL. The flow must be initiated via /openid/connect/authorize . */ +export class OauthAuthorizationUrlMismatch + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OauthAuthorizationUrlMismatch", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "oauth_authorization_url_mismatch" } }], + ) {} + +/** `preview_feature_not_available` -- The API method is not yet available on the team. */ +export class PreviewFeatureNotAvailable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PreviewFeatureNotAvailable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "preview_feature_not_available" } }], + ) {} + +/** `unsupported_grant_type` -- The `grant_type` is not supported by this endpoint. */ +export class UnsupportedGrantType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnsupportedGrantType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unsupported_grant_type" } }], + ) {} + /** The `grant_type` param as described in the OAuth spec. */ export type ConnectTokenRequestGrantType = "authorization_code" | "refresh_token"; export interface ConnectTokenRequest { @@ -92,8 +264,22 @@ export interface UserInfoResponse { https___slack_com_team_image_230?: string | undefined; https___slack_com_team_image_default?: boolean | undefined; } -export type ConnectTokenError = SlackOpError; -/** Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- The value passed for `client_secret` was invalid. - `bad_redirect_uri` -- The value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` -- An org-installed app cannot be installed on a workspace. - `invalid_client` -- Client authentication failed (unknown `client_id` or bad `client_secret`). - `invalid_client_id` -- The value passed for `client_id` was invalid. - `invalid_code` -- The value passed for `code` was invalid. - `invalid_grant` -- The authorization code is invalid, expired, revoked, or the PKCE `code_verifier` does not match. - `invalid_grant_type` -- The value passed for `grant_type` was invalid. - `invalid_refresh_token` -- The given refresh token is invalid. - `invalid_request` -- The request is missing a required parameter or includes an invalid parameter value. - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization URL. The flow must be initiated via /openid/connect/authorize . - `preview_feature_not_available` -- The API method is not yet available on the team. - `unsupported_grant_type` -- The `grant_type` is not supported by this endpoint. See https://docs.slack.dev/reference/methods/openid.connect.token */ +export type ConnectTokenError = + | BadClientSecret + | BadRedirectUri + | CannotInstallAnOrgInstalledApp + | InvalidClient + | InvalidClientId + | InvalidCode + | InvalidGrant + | InvalidGrantType + | InvalidRefreshToken + | InvalidRequest + | OauthAuthorizationUrlMismatch + | PreviewFeatureNotAvailable + | UnsupportedGrantType + | SlackOpError; +/** Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack. Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `bad_client_secret` -- The value passed for `client_secret` was invalid. - `bad_redirect_uri` -- The value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` -- An org-installed app cannot be installed on a workspace. - `invalid_client` -- Client authentication failed (unknown `client_id` or bad `client_secret`). - `invalid_client_id` -- The value passed for `client_id` was invalid. - `invalid_code` -- The value passed for `code` was invalid. - `invalid_grant` -- The authorization code is invalid, expired, revoked, or the PKCE `code_verifier` does not match. - `invalid_grant_type` -- The value passed for `grant_type` was invalid. - `invalid_refresh_token` -- The given refresh token is invalid. - `invalid_request` -- The request is missing a required parameter or includes an invalid parameter value. - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization URL. The flow must be initiated via /openid/connect/authorize . - `preview_feature_not_available` -- The API method is not yet available on the team. - `unsupported_grant_type` -- The `grant_type` is not supported by this endpoint. See https://docs.slack.dev/reference/methods/openid.connect.token */ export const connectToken: API.OperationMethod< ConnectTokenRequest, ConnectTokenResponse, @@ -102,7 +288,23 @@ export const connectToken: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadClientSecret, + BadRedirectUri, + CannotInstallAnOrgInstalledApp, + InvalidClient, + InvalidClientId, + InvalidCode, + InvalidGrant, + InvalidGrantType, + InvalidRefreshToken, + InvalidRequest, + OauthAuthorizationUrlMismatch, + PreviewFeatureNotAvailable, + UnsupportedGrantType, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/pins.ts b/packages/slack/src/services/pins.ts index 61a547a0a7..6938f64382 100644 --- a/packages/slack/src/services/pins.ts +++ b/packages/slack/src/services/pins.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,201 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `already_pinned` -- The specified item is already pinned to the channel. */ +export class AlreadyPinned + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyPinned", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_pinned" } }], + ) {} + +/** `bad_timestamp` -- Value passed for `timestamp` was invalid. */ +export class BadTimestamp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadTimestamp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_timestamp" } }], + ) {} + +/** `channel_not_found` -- The `channel` argument was not specified or was invalid */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `external_channel_migrating` -- Channel is undergoing an active migration. */ +export class ExternalChannelMigrating + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExternalChannelMigrating", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "external_channel_migrating" } }], + ) {} + +/** `file_comment_not_found` -- File comment specified by `file_comment` does not exist. */ +export class FileCommentNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileCommentNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_comment_not_found" } }], + ) {} + +/** `file_not_found` -- File not found. */ +export class FileNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_not_found" } }], + ) {} + +/** `file_not_shared` -- File specified by `file` is not public nor shared to the channel. */ +export class FileNotShared + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileNotShared", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "file_not_shared" } }], + ) {} + +/** `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. */ +export class MessageNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessageNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "message_not_found" } }], + ) {} + +/** `no_item_specified` -- One of `file`, `file_comment`, or `timestamp` was not specified. */ +export class NoItemSpecified + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoItemSpecified", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_item_specified" } }], + ) {} + +/** `no_pin` -- The pin could not be found. */ +export class NoPin + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoPin", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_pin" } }], + ) {} + +/** `not_in_channel` -- Item is not in channel. */ +export class NotInChannel + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotInChannel", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_in_channel" } }], + ) {} + +/** `not_pinnable` -- This message type is not pinnable. */ +export class NotPinnable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotPinnable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_pinnable" } }], + ) {} + +/** `not_pinned` -- The specified item is not pinned to the channel. */ +export class NotPinned + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotPinned", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_pinned" } }], + ) {} + +/** `restricted_action` -- The user does not have permission to add pins to the channel. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `too_many_pins` -- Too many pins in channel. */ +export class TooManyPins + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyPins", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_pins" } }], + ) {} + export interface AddPinRequest { /** Channel to pin the message to. You must also include a `timestamp` when pinning messages. */ channel: string; @@ -65,8 +261,21 @@ export interface RemovePinResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type AddPinError = SlackOpError; -/** Pins an item to a channel. Required scopes -- bot: `pins:write`; user: `pins:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `already_pinned` -- The specified item is already pinned to the channel. - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- The `channel` argument was not specified or was invalid - `external_channel_migrating` -- Channel is undergoing an active migration. - `file_not_found` -- File not found. - `file_not_shared` -- File specified by `file` is not public nor shared to the channel. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- One of `file`, `file_comment`, or `timestamp` was not specified. - `not_in_channel` -- Item is not in channel. - `not_pinnable` -- This message type is not pinnable. - `restricted_action` -- The user does not have permission to add pins to the channel. - `too_many_pins` -- Too many pins in channel. See https://docs.slack.dev/reference/methods/pins.add */ +export type AddPinError = + | AlreadyPinned + | BadTimestamp + | ChannelNotFound + | ExternalChannelMigrating + | FileNotFound + | FileNotShared + | MessageNotFound + | NoItemSpecified + | NotInChannel + | NotPinnable + | RestrictedAction + | TooManyPins + | SlackOpError; +/** Pins an item to a channel. Required scopes -- bot: `pins:write`; user: `pins:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `already_pinned` -- The specified item is already pinned to the channel. - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- The `channel` argument was not specified or was invalid - `external_channel_migrating` -- Channel is undergoing an active migration. - `file_not_found` -- File not found. - `file_not_shared` -- File specified by `file` is not public nor shared to the channel. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- One of `file`, `file_comment`, or `timestamp` was not specified. - `not_in_channel` -- Item is not in channel. - `not_pinnable` -- This message type is not pinnable. - `restricted_action` -- The user does not have permission to add pins to the channel. - `too_many_pins` -- Too many pins in channel. See https://docs.slack.dev/reference/methods/pins.add */ export const addPin: API.OperationMethod< AddPinRequest, AddPinResponse, @@ -75,15 +284,30 @@ export const addPin: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AlreadyPinned, + BadTimestamp, + ChannelNotFound, + ExternalChannelMigrating, + FileNotFound, + FileNotShared, + MessageNotFound, + NoItemSpecified, + NotInChannel, + NotPinnable, + RestrictedAction, + TooManyPins, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddPin", })); -export type ListPinsError = SlackOpError; -/** Lists items pinned to a channel. Required scopes -- bot: `pins:read`; user: `pins:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- Value passed for `channel` was invalid. - `restricted_action` -- The user does not have permission to view the channel. See https://docs.slack.dev/reference/methods/pins.list */ +export type ListPinsError = ChannelNotFound | RestrictedAction | SlackOpError; +/** Lists items pinned to a channel. Required scopes -- bot: `pins:read`; user: `pins:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `channel_not_found` -- Value passed for `channel` was invalid. - `restricted_action` -- The user does not have permission to view the channel. See https://docs.slack.dev/reference/methods/pins.list */ export const listPins: API.OperationMethod< ListPinsRequest, ListPinsResponse, @@ -92,15 +316,26 @@ export const listPins: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c2, 0) as any as S.Schema, output: __S(11, __c2, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ChannelNotFound, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListPins", })); -export type RemovePinError = SlackOpError; -/** Un-pins an item from a channel. Required scopes -- bot: `pins:write`; user: `pins:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- The `channel` argument was not specified or was invalid - `external_channel_migrating` -- Channel is undergoing an active migration. - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- One of `file`, `file_comment`, or `timestamp` was not specified. - `no_pin` -- The pin could not be found. - `not_pinned` -- The specified item is not pinned to the channel. - `restricted_action` -- The user does not have permission to remove pins from the channel. See https://docs.slack.dev/reference/methods/pins.remove */ +export type RemovePinError = + | BadTimestamp + | ChannelNotFound + | ExternalChannelMigrating + | FileCommentNotFound + | FileNotFound + | MessageNotFound + | NoItemSpecified + | NoPin + | NotPinned + | RestrictedAction + | SlackOpError; +/** Un-pins an item from a channel. Required scopes -- bot: `pins:write`; user: `pins:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- The `channel` argument was not specified or was invalid - `external_channel_migrating` -- Channel is undergoing an active migration. - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- One of `file`, `file_comment`, or `timestamp` was not specified. - `no_pin` -- The pin could not be found. - `not_pinned` -- The specified item is not pinned to the channel. - `restricted_action` -- The user does not have permission to remove pins from the channel. See https://docs.slack.dev/reference/methods/pins.remove */ export const removePin: API.OperationMethod< RemovePinRequest, RemovePinResponse, @@ -109,7 +344,20 @@ export const removePin: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(12, __c3, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadTimestamp, + ChannelNotFound, + ExternalChannelMigrating, + FileCommentNotFound, + FileNotFound, + MessageNotFound, + NoItemSpecified, + NoPin, + NotPinned, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/reactions.ts b/packages/slack/src/services/reactions.ts index 5c4c9b0a97..0d5e967db0 100644 --- a/packages/slack/src/services/reactions.ts +++ b/packages/slack/src/services/reactions.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,240 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `already_reacted` -- The specified item already has the user/reaction combination. */ +export class AlreadyReacted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyReacted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_reacted" } }], + ) {} + +/** `bad_timestamp` -- Value passed for `timestamp` was invalid. */ +export class BadTimestamp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadTimestamp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_timestamp" } }], + ) {} + +/** `channel_not_found` -- Value passed for `channel` is invalid. */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `external_channel_migrating` -- The channel is in the process of being migrated. */ +export class ExternalChannelMigrating + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExternalChannelMigrating", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "external_channel_migrating" } }], + ) {} + +/** `file_comment_not_found` -- File comment specified by `file_comment` does not exist. */ +export class FileCommentNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileCommentNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_comment_not_found" } }], + ) {} + +/** `file_not_found` -- File specified by `file` does not exist. */ +export class FileNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_not_found" } }], + ) {} + +/** `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_name` -- Value passed for `name` was invalid. */ +export class InvalidName + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidName", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_name" } }], + ) {} + +/** `is_archived` -- Channel specified has been archived. */ +export class IsArchived + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("IsArchived", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "is_archived" } }], + ) {} + +/** `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. */ +export class MessageNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessageNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "message_not_found" } }], + ) {} + +/** `no_access` -- User does not have access to react to this canvas. */ +export class NoAccess + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoAccess", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_access" } }], + ) {} + +/** `no_item_specified` -- combination of `channel` and `timestamp` was not specified. */ +export class NoItemSpecified + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoItemSpecified", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_item_specified" } }], + ) {} + +/** `no_reaction` -- The specified reaction does not exist, or the requestor is not the original reaction author. */ +export class NoReaction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoReaction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_reaction" } }], + ) {} + +/** `not_reactable` -- Whatever you passed in, like a `file` or `file_comment`, can't be reacted to anymore. Your app can react to messages though. */ +export class NotReactable + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotReactable", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_reactable" } }], + ) {} + +/** `thread_locked` -- Reactions are disabled as the specified message is part of a locked thread. */ +export class ThreadLocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ThreadLocked", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "thread_locked" } }], + ) {} + +/** `too_many_emoji` -- The limit for distinct reactions (i.e emoji) on the item has been reached. */ +export class TooManyEmoji + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyEmoji", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_emoji" } }], + ) {} + +/** `too_many_reactions` -- The limit for reactions a person may add to the item has been reached. */ +export class TooManyReactions + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyReactions", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_reactions" } }], + ) {} + +/** `user_not_found` -- Value passed for `user` was invalid. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + export interface AddReactionRequest { /** Channel where the message to add reaction to was posted. */ channel: string; @@ -103,8 +338,22 @@ export interface RemoveReactionResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type AddReactionError = SlackOpError; -/** Adds a reaction to an item. Required scopes -- bot: `reactions:write`; user: `reactions:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `already_reacted` -- The specified item already has the user/reaction combination. - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Value passed for `channel` is invalid. - `external_channel_migrating` -- The channel is in the process of being migrated. - `invalid_name` -- Value passed for `name` was invalid. - `is_archived` -- Channel specified has been archived. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- combination of `channel` and `timestamp` was not specified. - `not_reactable` -- Whatever you passed in, like a `file` or `file_comment`, can't be reacted to anymore. Your app can react to messages though. - `thread_locked` -- Reactions are disabled as the specified message is part of a locked thread. - `too_many_emoji` -- The limit for distinct reactions (i.e emoji) on the item has been reached. - `too_many_reactions` -- The limit for reactions a person may add to the item has been reached. - `no_access` -- User does not have access to react to this canvas. See https://docs.slack.dev/reference/methods/reactions.add */ +export type AddReactionError = + | AlreadyReacted + | BadTimestamp + | ChannelNotFound + | ExternalChannelMigrating + | InvalidName + | IsArchived + | MessageNotFound + | NoAccess + | NoItemSpecified + | NotReactable + | ThreadLocked + | TooManyEmoji + | TooManyReactions + | SlackOpError; +/** Adds a reaction to an item. Required scopes -- bot: `reactions:write`; user: `reactions:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `already_reacted` -- The specified item already has the user/reaction combination. - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Value passed for `channel` is invalid. - `external_channel_migrating` -- The channel is in the process of being migrated. - `invalid_name` -- Value passed for `name` was invalid. - `is_archived` -- Channel specified has been archived. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- combination of `channel` and `timestamp` was not specified. - `not_reactable` -- Whatever you passed in, like a `file` or `file_comment`, can't be reacted to anymore. Your app can react to messages though. - `thread_locked` -- Reactions are disabled as the specified message is part of a locked thread. - `too_many_emoji` -- The limit for distinct reactions (i.e emoji) on the item has been reached. - `too_many_reactions` -- The limit for reactions a person may add to the item has been reached. - `no_access` -- User does not have access to react to this canvas. See https://docs.slack.dev/reference/methods/reactions.add */ export const addReaction: API.OperationMethod< AddReactionRequest, AddReactionResponse, @@ -113,15 +362,38 @@ export const addReaction: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AlreadyReacted, + BadTimestamp, + ChannelNotFound, + ExternalChannelMigrating, + InvalidName, + IsArchived, + MessageNotFound, + NoAccess, + NoItemSpecified, + NotReactable, + ThreadLocked, + TooManyEmoji, + TooManyReactions, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddReaction", })); -export type GetReactionError = SlackOpError; -/** Gets reactions for an item. Required scopes -- bot: `reactions:read`; user: `reactions:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Value passed for `channel` was invalid. - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. See https://docs.slack.dev/reference/methods/reactions.get */ +export type GetReactionError = + | BadTimestamp + | ChannelNotFound + | FileCommentNotFound + | FileNotFound + | MessageNotFound + | NoItemSpecified + | SlackOpError; +/** Gets reactions for an item. Required scopes -- bot: `reactions:read`; user: `reactions:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Value passed for `channel` was invalid. - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. See https://docs.slack.dev/reference/methods/reactions.get */ export const getReaction: API.OperationMethod< GetReactionRequest, GetReactionResponse, @@ -130,15 +402,24 @@ export const getReaction: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(16, __c2, 0) as any as S.Schema, output: __S(17, __c2, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadTimestamp, + ChannelNotFound, + FileCommentNotFound, + FileNotFound, + MessageNotFound, + NoItemSpecified, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetReaction", })); -export type ListReactionsError = SlackOpError; -/** Lists reactions made by a user. Required scopes -- bot: `reactions:read`; user: `reactions:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `user_not_found` -- Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/reactions.list */ +export type ListReactionsError = InvalidCursor | UserNotFound | SlackOpError; +/** Lists reactions made by a user. Required scopes -- bot: `reactions:read`; user: `reactions:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `user_not_found` -- Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/reactions.list */ export const listReactions: API.PaginatedOperationMethod< ListReactionsRequest, ListReactionsResponse, @@ -149,7 +430,7 @@ export const listReactions: API.PaginatedOperationMethod< () => ({ input: __S(24, __c3, 0) as any as S.Schema, output: __S(28, __c3, 4) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [InvalidCursor, UserNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -165,8 +446,20 @@ export const listReactions: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type RemoveReactionError = SlackOpError; -/** Removes a reaction from an item. Required scopes -- bot: `reactions:write`; user: `reactions:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- The specified channel was not found. - `external_channel_migrating` -- The reaction is in a channel that is being migrated - `file_not_found` -- File specified by `file` does not exist. - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `invalid_name` -- Value passed for `name` was invalid. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. - `no_access` -- The requestor does not have permission to perform this action on the specified item. - `no_reaction` -- The specified reaction does not exist, or the requestor is not the original reaction author. - `thread_locked` -- Reactions are disabled as the specified message is part of a locked thread. See https://docs.slack.dev/reference/methods/reactions.remove */ +export type RemoveReactionError = + | BadTimestamp + | ChannelNotFound + | ExternalChannelMigrating + | FileCommentNotFound + | FileNotFound + | InvalidName + | MessageNotFound + | NoAccess + | NoItemSpecified + | NoReaction + | ThreadLocked + | SlackOpError; +/** Removes a reaction from an item. Required scopes -- bot: `reactions:write`; user: `reactions:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- The specified channel was not found. - `external_channel_migrating` -- The reaction is in a channel that is being migrated - `file_not_found` -- File specified by `file` does not exist. - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `invalid_name` -- Value passed for `name` was invalid. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. - `no_access` -- The requestor does not have permission to perform this action on the specified item. - `no_reaction` -- The specified reaction does not exist, or the requestor is not the original reaction author. - `thread_locked` -- Reactions are disabled as the specified message is part of a locked thread. See https://docs.slack.dev/reference/methods/reactions.remove */ export const removeReaction: API.OperationMethod< RemoveReactionRequest, RemoveReactionResponse, @@ -175,7 +468,21 @@ export const removeReaction: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c4, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadTimestamp, + ChannelNotFound, + ExternalChannelMigrating, + FileCommentNotFound, + FileNotFound, + InvalidName, + MessageNotFound, + NoAccess, + NoItemSpecified, + NoReaction, + ThreadLocked, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/reminders.ts b/packages/slack/src/services/reminders.ts index 9c15161074..8a9a422e00 100644 --- a/packages/slack/src/services/reminders.ts +++ b/packages/slack/src/services/reminders.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,149 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `cannot_add_bot` -- Reminders can't be sent to bots. */ +export class CannotAddBot + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotAddBot", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_add_bot" } }], + ) {} + +/** `cannot_add_others` -- Guests can't set reminders for other team members. */ +export class CannotAddOthers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotAddOthers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_add_others" } }], + ) {} + +/** `cannot_add_others_recurring` -- Recurring reminders can't be set for other team members. */ +export class CannotAddOthersRecurring + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotAddOthersRecurring", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_add_others_recurring" } }], + ) {} + +/** `cannot_add_profile_only_user` -- Reminders can't be sent to profile only users. */ +export class CannotAddProfileOnlyUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotAddProfileOnlyUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_add_profile_only_user" } }], + ) {} + +/** `cannot_add_slackbot` -- Reminders can't be sent to Slackbot. */ +export class CannotAddSlackbot + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotAddSlackbot", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_add_slackbot" } }], + ) {} + +/** `cannot_complete_others` -- Reminders for other team members can't be marked complete. */ +export class CannotCompleteOthers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotCompleteOthers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_complete_others" } }], + ) {} + +/** `cannot_complete_recurring` -- Recurring reminders can't be marked complete. */ +export class CannotCompleteRecurring + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotCompleteRecurring", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_complete_recurring" } }], + ) {} + +/** `cannot_parse` -- The phrasing of the timing for this reminder is unclear. You must include a complete time description. Some examples that work: `1458678068`, `20`, `in 5 minutes`, `tomorrow`, `at 3:30pm`, `on Tuesday`, or `next week`. */ +export class CannotParse + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotParse", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_parse" } }], + ) {} + +/** `missing_argument` -- An argument is missing. */ +export class MissingArgument + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgument", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_argument" } }], + ) {} + +/** `not_found` -- That reminder can't be found. */ +export class NotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "not_found" } }], + ) {} + +/** `user_not_found` -- That user can't be found. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + export interface AddReminderRequest { /** The content of the reminder */ text: string; @@ -82,8 +226,17 @@ export interface RemindersInfoResponse { ok: boolean; reminder: unknown; } -export type AddReminderError = SlackOpError; -/** Creates a reminder. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_add_bot` -- Reminders can't be sent to bots. - `cannot_add_others` -- Guests can't set reminders for other team members. - `cannot_add_others_recurring` -- Recurring reminders can't be set for other team members. - `cannot_add_profile_only_user` -- Reminders can't be sent to profile only users. - `cannot_add_slackbot` -- Reminders can't be sent to Slackbot. - `cannot_parse` -- The phrasing of the timing for this reminder is unclear. You must include a complete time description. Some examples that work: `1458678068`, `20`, `in 5 minutes`, `tomorrow`, `at 3:30pm`, `on Tuesday`, or `next week`. - `missing_argument` -- An argument is missing. - `user_not_found` -- That user can't be found. See https://docs.slack.dev/reference/methods/reminders.add */ +export type AddReminderError = + | CannotAddBot + | CannotAddOthers + | CannotAddOthersRecurring + | CannotAddProfileOnlyUser + | CannotAddSlackbot + | CannotParse + | MissingArgument + | UserNotFound + | SlackOpError; +/** Creates a reminder. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_add_bot` -- Reminders can't be sent to bots. - `cannot_add_others` -- Guests can't set reminders for other team members. - `cannot_add_others_recurring` -- Recurring reminders can't be set for other team members. - `cannot_add_profile_only_user` -- Reminders can't be sent to profile only users. - `cannot_add_slackbot` -- Reminders can't be sent to Slackbot. - `cannot_parse` -- The phrasing of the timing for this reminder is unclear. You must include a complete time description. Some examples that work: `1458678068`, `20`, `in 5 minutes`, `tomorrow`, `at 3:30pm`, `on Tuesday`, or `next week`. - `missing_argument` -- An argument is missing. - `user_not_found` -- That user can't be found. See https://docs.slack.dev/reference/methods/reminders.add */ export const addReminder: API.OperationMethod< AddReminderRequest, AddReminderResponse, @@ -92,15 +245,31 @@ export const addReminder: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotAddBot, + CannotAddOthers, + CannotAddOthersRecurring, + CannotAddProfileOnlyUser, + CannotAddSlackbot, + CannotParse, + MissingArgument, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddReminder", })); -export type CompleteReminderError = SlackOpError; -/** Marks a reminder as complete. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_complete_others` -- Reminders for other team members can't be marked complete. - `cannot_complete_recurring` -- Recurring reminders can't be marked complete. - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.complete */ +export type CompleteReminderError = + | CannotCompleteOthers + | CannotCompleteRecurring + | MissingArgument + | NotFound + | SlackOpError; +/** Marks a reminder as complete. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `cannot_complete_others` -- Reminders for other team members can't be marked complete. - `cannot_complete_recurring` -- Recurring reminders can't be marked complete. - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.complete */ export const completeReminder: API.OperationMethod< CompleteReminderRequest, CompleteReminderResponse, @@ -109,15 +278,22 @@ export const completeReminder: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c2, 0) as any as S.Schema, output: __S(12, __c3, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotCompleteOthers, + CannotCompleteRecurring, + MissingArgument, + NotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CompleteReminder", })); -export type DeleteReminderError = SlackOpError; -/** Deletes a reminder. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.delete */ +export type DeleteReminderError = MissingArgument | NotFound | SlackOpError; +/** Deletes a reminder. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.delete */ export const deleteReminder: API.OperationMethod< DeleteReminderRequest, DeleteReminderResponse, @@ -126,15 +302,15 @@ export const deleteReminder: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(16, __c4, 0) as any as S.Schema, output: __S(12, __c3, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [MissingArgument, NotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteReminder", })); -export type ListRemindersError = SlackOpError; -/** Lists all reminders created by or for a given user. Required scopes -- user: `reminders:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- An argument is missing. See https://docs.slack.dev/reference/methods/reminders.list */ +export type ListRemindersError = MissingArgument | SlackOpError; +/** Lists all reminders created by or for a given user. Required scopes -- user: `reminders:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- An argument is missing. See https://docs.slack.dev/reference/methods/reminders.list */ export const listReminders: API.OperationMethod< ListRemindersRequest, ListRemindersResponse, @@ -143,15 +319,15 @@ export const listReminders: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(20, __c5, 0) as any as S.Schema, output: __S(22, __c5, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [MissingArgument, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListReminders", })); -export type RemindersInfoError = SlackOpError; -/** Gets information about a reminder. Required scopes -- user: `reminders:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.info */ +export type RemindersInfoError = MissingArgument | NotFound | SlackOpError; +/** Gets information about a reminder. Required scopes -- user: `reminders:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.info */ export const remindersInfo: API.OperationMethod< RemindersInfoRequest, RemindersInfoResponse, @@ -160,7 +336,7 @@ export const remindersInfo: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c6, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [MissingArgument, NotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/rtm.ts b/packages/slack/src/services/rtm.ts index ededa90b1b..0af8af1cf2 100644 --- a/packages/slack/src/services/rtm.ts +++ b/packages/slack/src/services/rtm.ts @@ -24,6 +24,45 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `method_deprecated` -- `rtm.start` is deprecated. Please use `rtm.connect` instead of `rtm.start`. Read https://docs.slack.dev/changelog/2021-10-rtm-start-to-stop for more info. */ +export class MethodDeprecated + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MethodDeprecated", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "method_deprecated" } }], + ) {} + +/** `migration_in_progress` -- Team is being migrated between servers. See [the `team_migration_started` event documentation](/reference/events/team_migration_started) for details. */ +export class MigrationInProgress + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MigrationInProgress", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "migration_in_progress" } }], + ) {} + +/** `rtm_connect_required` -- `rtm.start` is deprecated. Please use `rtm.connect` instead of `rtm.start`. Read https://docs.slack.dev/changelog/2021-10-rtm-start-to-stop for more info. */ +export class RtmConnectRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RtmConnectRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "rtm_connect_required" } }], + ) {} + export interface ConnectRtmRequest { /** Batch presence deliveries via subscription. Enabling changes the shape of `presence_change` events. See [batch presence](/apis/web-api/user-presence-and-status#batching). */ batch_presence_aware?: boolean | undefined; @@ -73,8 +112,8 @@ export interface StartRtmResponse { self: ConnectRtmResponseSelf; team: ConnectRtmResponseTeam; } -export type ConnectRtmError = SlackOpError; -/** Starts a Real Time Messaging session. Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `migration_in_progress` -- Team is being migrated between servers. See [the `team_migration_started` event documentation](/reference/events/team_migration_started) for details. See https://docs.slack.dev/reference/methods/rtm.connect */ +export type ConnectRtmError = MigrationInProgress | SlackOpError; +/** Starts a Real Time Messaging session. Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `migration_in_progress` -- Team is being migrated between servers. See [the `team_migration_started` event documentation](/reference/events/team_migration_started) for details. See https://docs.slack.dev/reference/methods/rtm.connect */ export const connectRtm: API.OperationMethod< ConnectRtmRequest, ConnectRtmResponse, @@ -83,15 +122,19 @@ export const connectRtm: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(6, __c1, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [MigrationInProgress, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ConnectRtm", })); -export type StartRtmError = SlackOpError; -/** Deprecated: Starts a Real Time Messaging session. Use rtm.connect instead. Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `method_deprecated` -- `rtm.start` is deprecated. Please use `rtm.connect` instead of `rtm.start`. Read https://docs.slack.dev/changelog/2021-10-rtm-start-to-stop for more info. - `migration_in_progress` -- Workspace is being migrated between servers. See [the `team_migration_started` event documentation](/reference/events/team_migration_started) for details. - `rtm_connect_required` -- `rtm.start` is deprecated. Please use `rtm.connect` instead of `rtm.start`. Read https://docs.slack.dev/changelog/2021-10-rtm-start-to-stop for more info. See https://docs.slack.dev/reference/methods/rtm.start */ +export type StartRtmError = + | MethodDeprecated + | MigrationInProgress + | RtmConnectRequired + | SlackOpError; +/** Deprecated: Starts a Real Time Messaging session. Use rtm.connect instead. Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `method_deprecated` -- `rtm.start` is deprecated. Please use `rtm.connect` instead of `rtm.start`. Read https://docs.slack.dev/changelog/2021-10-rtm-start-to-stop for more info. - `migration_in_progress` -- Workspace is being migrated between servers. See [the `team_migration_started` event documentation](/reference/events/team_migration_started) for details. - `rtm_connect_required` -- `rtm.start` is deprecated. Please use `rtm.connect` instead of `rtm.start`. Read https://docs.slack.dev/changelog/2021-10-rtm-start-to-stop for more info. See https://docs.slack.dev/reference/methods/rtm.start */ export const startRtm: API.OperationMethod< StartRtmRequest, StartRtmResponse, @@ -100,7 +143,7 @@ export const startRtm: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c2, 0) as any as S.Schema, output: __S(6, __c1, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [MethodDeprecated, MigrationInProgress, RtmConnectRequired, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/search.ts b/packages/slack/src/services/search.ts index 33fe50f70f..b3fba3461e 100644 --- a/packages/slack/src/services/search.ts +++ b/packages/slack/src/services/search.ts @@ -24,6 +24,19 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `no_query` -- No query was provided. */ +export class NoQuery + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoQuery", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_query" } }], + ) {} + export type SearchAllRequestSortDir = "asc" | "desc"; export interface SearchAllRequest { count?: number | undefined; @@ -207,8 +220,8 @@ export interface SearchMessagesResponse { /** Pagination metadata. An empty `next_cursor` means the last page. */ response_metadata?: SearchMessagesResponseResponseMetadata | undefined; } -export type SearchAllError = SlackOpError; -/** Searches for messages and files matching a query. Required scopes -- user: `search:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `no_query` -- No query was provided. See https://docs.slack.dev/reference/methods/search.all */ +export type SearchAllError = NoQuery | SlackOpError; +/** Searches for messages and files matching a query. Required scopes -- user: `search:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `no_query` -- No query was provided. See https://docs.slack.dev/reference/methods/search.all */ export const searchAll: API.OperationMethod< SearchAllRequest, SearchAllResponse, @@ -217,15 +230,15 @@ export const searchAll: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [NoQuery, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SearchAll", })); -export type SearchFilesError = SlackOpError; -/** Searches for files matching a query. Required scopes -- user: `search:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `no_query` -- No query was provided. See https://docs.slack.dev/reference/methods/search.files */ +export type SearchFilesError = NoQuery | SlackOpError; +/** Searches for files matching a query. Required scopes -- user: `search:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `no_query` -- No query was provided. See https://docs.slack.dev/reference/methods/search.files */ export const searchFiles: API.OperationMethod< SearchFilesRequest, SearchFilesResponse, @@ -234,15 +247,15 @@ export const searchFiles: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c1, 0) as any as S.Schema, output: __S(11, __c1, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [NoQuery, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SearchFiles", })); -export type SearchMessagesError = SlackOpError; -/** Searches for messages matching a query. Required scopes -- user: `search:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `no_query` -- No query was provided. See https://docs.slack.dev/reference/methods/search.messages */ +export type SearchMessagesError = NoQuery | SlackOpError; +/** Searches for messages matching a query. Required scopes -- user: `search:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `no_query` -- No query was provided. See https://docs.slack.dev/reference/methods/search.messages */ export const searchMessages: API.OperationMethod< SearchMessagesRequest, SearchMessagesResponse, @@ -251,7 +264,7 @@ export const searchMessages: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c3, 0) as any as S.Schema, output: __S(28, __c3, 4) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [NoQuery, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/slackbot.ts b/packages/slack/src/services/slackbot.ts index 7c24070708..650eaaf264 100644 --- a/packages/slack/src/services/slackbot.ts +++ b/packages/slack/src/services/slackbot.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,311 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `already_a_skill` -- The canvas is already a skill. Use `slackbot.skills.update` to change it. */ +export class AlreadyASkill + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyASkill", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_a_skill" } }], + ) {} + +/** `canvas_creation_failed` -- The skill's canvas couldn't be created. */ +export class CanvasCreationFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasCreationFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_creation_failed" } }], + ) {} + +/** `canvas_deleting_disabled` -- Deleting canvases is disabled for the caller's team. */ +export class CanvasDeletingDisabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasDeletingDisabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_deleting_disabled" } }], + ) {} + +/** `canvas_disabled_user_team` -- Canvases are disabled for the caller's team. */ +export class CanvasDisabledUserTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasDisabledUserTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_disabled_user_team" } }], + ) {} + +/** `canvas_editing_failed` -- The skill's instructions or display name couldn't be saved. */ +export class CanvasEditingFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasEditingFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_editing_failed" } }], + ) {} + +/** `canvas_editing_locked` -- Another edit to the canvas is in progress. Retry the request. */ +export class CanvasEditingLocked + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasEditingLocked", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "canvas_editing_locked" } }], + ) {} + +/** `canvas_not_found` -- The canvas doesn't exist or the caller can't see it. */ +export class CanvasNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CanvasNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "canvas_not_found" } }], + ) {} + +/** `description_too_long` -- `description` is longer than 400 characters. */ +export class DescriptionTooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DescriptionTooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "description_too_long" } }], + ) {} + +/** `display_name_too_long` -- `display_name` is longer than 255 characters. */ +export class DisplayNameTooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DisplayNameTooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "display_name_too_long" } }], + ) {} + +/** `example_prompt_too_long` -- `example_prompt` is longer than 200 characters. */ +export class ExamplePromptTooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExamplePromptTooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "example_prompt_too_long" } }], + ) {} + +/** `feature_not_enabled` -- The Skills API isn't enabled for this organization. */ +export class FeatureNotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FeatureNotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "feature_not_enabled" } }], + ) {} + +/** `free_teams_cannot_create_standalone_canvases` -- Free teams can't create standalone canvases. */ +export class FreeTeamsCannotCreateStandaloneCanvases + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "FreeTeamsCannotCreateStandaloneCanvases", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "free_teams_cannot_create_standalone_canvases" } }], + ) {} + +/** `instructions_too_large` -- `instructions` is larger than 500,000 bytes. */ +export class InstructionsTooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InstructionsTooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "instructions_too_large" } }], + ) {} + +/** `invalid_arguments` -- The arguments are invalid, for example both or neither of `instructions` and `canvas_id` were sent. */ +export class InvalidArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_arguments" } }], + ) {} + +/** `invalid_category` -- `category` isn't one of the skill categories. */ +export class InvalidCategory + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCategory", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_category" } }], + ) {} + +/** `invalid_cursor` -- The cursor is malformed, expired, or was issued for a different filter or category. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `is_a_template` -- Canvas templates can't be turned into skills. */ +export class IsATemplate + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("IsATemplate", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "is_a_template" } }], + ) {} + +/** `mcp_server_not_found` -- One or more declared apps don't exist or aren't available to the caller. `invalid_mcp_servers` lists them. */ +export class McpServerNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("McpServerNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "mcp_server_not_found" } }], + ) {} + +/** `method_not_supported_for_skill_type` -- Only canvas skills can be deleted. */ +export class MethodNotSupportedForSkillType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "MethodNotSupportedForSkillType", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "method_not_supported_for_skill_type" } }], + ) {} + +/** `not_canvas_owner` -- Only the canvas owner can turn it into a skill. */ +export class NotCanvasOwner + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotCanvasOwner", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_canvas_owner" } }], + ) {} + +/** `restricted_action` -- The caller isn't allowed to author skills. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `skill_not_found` -- The skill doesn't exist or the caller can't see it. */ +export class SkillNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SkillNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "skill_not_found" } }], + ) {} + +/** `too_many_mcp_servers` -- More apps were declared than the caller can enable at once. */ +export class TooManyMcpServers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyMcpServers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_mcp_servers" } }], + ) {} + export interface AddSkillsLibraryRequest { /** Skill to turn on for the caller. */ skill_id: string; @@ -452,8 +758,12 @@ export interface UpdateSkillResponse { /** A Slackbot skill as returned by the slackbot.skills.* Web API methods. Fields with no value are null. */ skill: UpdateSkillResponseSkill; } -export type AddSkillsLibraryError = SlackOpError; -/** Turns a skill on in the caller's personal library. Required scopes -- bot: `skills:write`; user: `skills:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `skill_not_found` -- The skill doesn't exist or the caller can't see it. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `restricted_action` -- The caller cannot use skills or cannot use this skill in their library. - `internal_error` -- The library could not be updated. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.library.add */ +export type AddSkillsLibraryError = + | FeatureNotEnabled + | RestrictedAction + | SkillNotFound + | SlackOpError; +/** Turns a skill on in the caller's personal library. Required scopes -- bot: `skills:write`; user: `skills:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `skill_not_found` -- The skill doesn't exist or the caller can't see it. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `restricted_action` -- The caller cannot use skills or cannot use this skill in their library. - `internal_error` -- The library could not be updated. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.library.add */ export const addSkillsLibrary: API.OperationMethod< AddSkillsLibraryRequest, AddSkillsLibraryResponse, @@ -462,15 +772,34 @@ export const addSkillsLibrary: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [FeatureNotEnabled, RestrictedAction, SkillNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddSkillsLibrary", })); -export type CreateSkillError = SlackOpError; -/** Creates a skill from markdown instructions, or turns an existing canvas the caller owns into a skill. Required scopes -- bot: `skills:write`; user: `skills:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- The arguments are invalid, for example both or neither of `instructions` and `canvas_id` were sent. - `canvas_not_found` -- The canvas doesn't exist or the caller can't see it. - `not_canvas_owner` -- Only the canvas owner can turn it into a skill. - `is_a_template` -- Canvas templates can't be turned into skills. - `already_a_skill` -- The canvas is already a skill. Use `slackbot.skills.update` to change it. - `invalid_category` -- `category` isn't one of the skill categories. - `display_name_too_long` -- `display_name` is longer than 255 characters. - `description_too_long` -- `description` is longer than 400 characters. - `example_prompt_too_long` -- `example_prompt` is longer than 200 characters. - `instructions_too_large` -- `instructions` is larger than 500,000 bytes. - `too_many_mcp_servers` -- More apps were declared than the caller can enable at once. - `mcp_server_not_found` -- One or more declared apps don't exist or aren't available to the caller. `invalid_mcp_servers` lists them. - `restricted_action` -- The caller isn't allowed to author skills. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `canvas_disabled_user_team` -- Canvases are disabled for the caller's team. - `free_teams_cannot_create_standalone_canvases` -- Free teams can't create standalone canvases. - `canvas_editing_locked` -- Another edit to the canvas is in progress. Retry the request. - `canvas_creation_failed` -- The skill's canvas couldn't be created. - `internal_error` -- The skill couldn't be saved. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.create */ +export type CreateSkillError = + | AlreadyASkill + | CanvasCreationFailed + | CanvasDisabledUserTeam + | CanvasEditingLocked + | CanvasNotFound + | DescriptionTooLong + | DisplayNameTooLong + | ExamplePromptTooLong + | FeatureNotEnabled + | FreeTeamsCannotCreateStandaloneCanvases + | InstructionsTooLarge + | InvalidArguments + | InvalidCategory + | IsATemplate + | McpServerNotFound + | NotCanvasOwner + | RestrictedAction + | TooManyMcpServers + | SlackOpError; +/** Creates a skill from markdown instructions, or turns an existing canvas the caller owns into a skill. Required scopes -- bot: `skills:write`; user: `skills:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- The arguments are invalid, for example both or neither of `instructions` and `canvas_id` were sent. - `canvas_not_found` -- The canvas doesn't exist or the caller can't see it. - `not_canvas_owner` -- Only the canvas owner can turn it into a skill. - `is_a_template` -- Canvas templates can't be turned into skills. - `already_a_skill` -- The canvas is already a skill. Use `slackbot.skills.update` to change it. - `invalid_category` -- `category` isn't one of the skill categories. - `display_name_too_long` -- `display_name` is longer than 255 characters. - `description_too_long` -- `description` is longer than 400 characters. - `example_prompt_too_long` -- `example_prompt` is longer than 200 characters. - `instructions_too_large` -- `instructions` is larger than 500,000 bytes. - `too_many_mcp_servers` -- More apps were declared than the caller can enable at once. - `mcp_server_not_found` -- One or more declared apps don't exist or aren't available to the caller. `invalid_mcp_servers` lists them. - `restricted_action` -- The caller isn't allowed to author skills. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `canvas_disabled_user_team` -- Canvases are disabled for the caller's team. - `free_teams_cannot_create_standalone_canvases` -- Free teams can't create standalone canvases. - `canvas_editing_locked` -- Another edit to the canvas is in progress. Retry the request. - `canvas_creation_failed` -- The skill's canvas couldn't be created. - `internal_error` -- The skill couldn't be saved. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.create */ export const createSkill: API.OperationMethod< CreateSkillRequest, CreateSkillResponse, @@ -479,15 +808,42 @@ export const createSkill: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c2, 0) as any as S.Schema, output: __S(16, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AlreadyASkill, + CanvasCreationFailed, + CanvasDisabledUserTeam, + CanvasEditingLocked, + CanvasNotFound, + DescriptionTooLong, + DisplayNameTooLong, + ExamplePromptTooLong, + FeatureNotEnabled, + FreeTeamsCannotCreateStandaloneCanvases, + InstructionsTooLarge, + InvalidArguments, + InvalidCategory, + IsATemplate, + McpServerNotFound, + NotCanvasOwner, + RestrictedAction, + TooManyMcpServers, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateSkill", })); -export type DeleteSkillError = SlackOpError; -/** Deletes a Slackbot skill and its canvas, and removes it from every library, skill set, and the org catalog. Required scopes -- bot: `skills:write`; user: `skills:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `skill_not_found` -- The skill doesn't exist or the caller can't see it. - `method_not_supported_for_skill_type` -- Only canvas skills can be deleted. - `restricted_action` -- The caller isn't allowed to delete this skill. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `canvas_deleting_disabled` -- Deleting canvases is disabled for the caller's team. - `internal_error` -- The skill couldn't be deleted. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.delete */ +export type DeleteSkillError = + | CanvasDeletingDisabled + | FeatureNotEnabled + | MethodNotSupportedForSkillType + | RestrictedAction + | SkillNotFound + | SlackOpError; +/** Deletes a Slackbot skill and its canvas, and removes it from every library, skill set, and the org catalog. Required scopes -- bot: `skills:write`; user: `skills:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `skill_not_found` -- The skill doesn't exist or the caller can't see it. - `method_not_supported_for_skill_type` -- Only canvas skills can be deleted. - `restricted_action` -- The caller isn't allowed to delete this skill. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `canvas_deleting_disabled` -- Deleting canvases is disabled for the caller's team. - `internal_error` -- The skill couldn't be deleted. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.delete */ export const deleteSkill: API.OperationMethod< DeleteSkillRequest, DeleteSkillResponse, @@ -496,15 +852,28 @@ export const deleteSkill: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c6, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CanvasDeletingDisabled, + FeatureNotEnabled, + MethodNotSupportedForSkillType, + RestrictedAction, + SkillNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteSkill", })); -export type ListSkillsError = SlackOpError; -/** Lists Slackbot skills from the caller's point of view. Instructions are not included. Required scopes -- bot: `skills:read`; user: `skills:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- The cursor is malformed, expired, or was issued for a different filter or category. - `invalid_category` -- The category isn't one of the supported skill categories. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `restricted_action` -- The caller isn't allowed to use skills. - `internal_error` -- A lookup failed, so the page couldn't be built completely. Retry the request with the same cursor. See https://docs.slack.dev/reference/methods/slackbot.skills.list */ +export type ListSkillsError = + | FeatureNotEnabled + | InvalidCategory + | InvalidCursor + | RestrictedAction + | SlackOpError; +/** Lists Slackbot skills from the caller's point of view. Instructions are not included. Required scopes -- bot: `skills:read`; user: `skills:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- The cursor is malformed, expired, or was issued for a different filter or category. - `invalid_category` -- The category isn't one of the supported skill categories. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `restricted_action` -- The caller isn't allowed to use skills. - `internal_error` -- A lookup failed, so the page couldn't be built completely. Retry the request with the same cursor. See https://docs.slack.dev/reference/methods/slackbot.skills.list */ export const listSkills: API.PaginatedOperationMethod< ListSkillsRequest, ListSkillsResponse, @@ -515,7 +884,14 @@ export const listSkills: API.PaginatedOperationMethod< () => ({ input: __S(28, __c7, 0) as any as S.Schema, output: __S(31, __c7, 3) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + FeatureNotEnabled, + InvalidCategory, + InvalidCursor, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -531,8 +907,12 @@ export const listSkills: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type RemoveSkillsLibraryError = SlackOpError; -/** Turns a skill off in the caller's personal library. Required scopes -- bot: `skills:write`; user: `skills:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `skill_not_found` -- The skill doesn't exist or the caller can't see it. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `restricted_action` -- The caller cannot use skills or cannot use this skill in their library. - `internal_error` -- The library could not be updated. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.library.remove */ +export type RemoveSkillsLibraryError = + | FeatureNotEnabled + | RestrictedAction + | SkillNotFound + | SlackOpError; +/** Turns a skill off in the caller's personal library. Required scopes -- bot: `skills:write`; user: `skills:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `skill_not_found` -- The skill doesn't exist or the caller can't see it. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `restricted_action` -- The caller cannot use skills or cannot use this skill in their library. - `internal_error` -- The library could not be updated. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.library.remove */ export const removeSkillsLibrary: API.OperationMethod< RemoveSkillsLibraryRequest, RemoveSkillsLibraryResponse, @@ -541,15 +921,15 @@ export const removeSkillsLibrary: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c8, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [FeatureNotEnabled, RestrictedAction, SkillNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveSkillsLibrary", })); -export type SkillsInfoError = SlackOpError; -/** Returns one Slackbot skill, including its instructions. Required scopes -- bot: `skills:read`; user: `skills:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `skill_not_found` -- The skill doesn't exist or the caller can't see it. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `restricted_action` -- The caller isn't allowed to use skills. - `internal_error` -- The skill's instructions couldn't be read. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.info */ +export type SkillsInfoError = FeatureNotEnabled | RestrictedAction | SkillNotFound | SlackOpError; +/** Returns one Slackbot skill, including its instructions. Required scopes -- bot: `skills:read`; user: `skills:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `skill_not_found` -- The skill doesn't exist or the caller can't see it. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `restricted_action` -- The caller isn't allowed to use skills. - `internal_error` -- The skill's instructions couldn't be read. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.info */ export const skillsInfo: API.OperationMethod< SkillsInfoRequest, SkillsInfoResponse, @@ -558,15 +938,29 @@ export const skillsInfo: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(36, __c9, 0) as any as S.Schema, output: __S(16, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [FeatureNotEnabled, RestrictedAction, SkillNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SkillsInfo", })); -export type UpdateSkillError = SlackOpError; -/** Changes a Slackbot skill's instructions or metadata. Only the inputs you send are changed; a call that changes nothing succeeds without writing. Required scopes -- bot: `skills:write`; user: `skills:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `skill_not_found` -- The skill doesn't exist or the caller can't see it. - `method_not_supported_for_skill_type` -- Only canvas skills can be changed. - `restricted_action` -- The caller isn't allowed to change this skill. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `canvas_editing_locked` -- Another edit to the skill is in progress. Retry the request. - `canvas_editing_failed` -- The skill's instructions or display name couldn't be saved. - `invalid_category` -- `category` isn't one of the skill categories. - `display_name_too_long` -- `display_name` is longer than 255 characters. - `description_too_long` -- `description` is longer than 400 characters. - `example_prompt_too_long` -- `example_prompt` is longer than 200 characters. - `instructions_too_large` -- `instructions` is larger than 500,000 bytes. - `too_many_mcp_servers` -- More apps were declared than the caller can enable at once. - `mcp_server_not_found` -- One or more declared apps don't exist or aren't available to the caller. `invalid_mcp_servers` lists them. - `internal_error` -- The skill's metadata couldn't be saved. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.update */ +export type UpdateSkillError = + | CanvasEditingFailed + | CanvasEditingLocked + | DescriptionTooLong + | DisplayNameTooLong + | ExamplePromptTooLong + | FeatureNotEnabled + | InstructionsTooLarge + | InvalidCategory + | McpServerNotFound + | MethodNotSupportedForSkillType + | RestrictedAction + | SkillNotFound + | TooManyMcpServers + | SlackOpError; +/** Changes a Slackbot skill's instructions or metadata. Only the inputs you send are changed; a call that changes nothing succeeds without writing. Required scopes -- bot: `skills:write`; user: `skills:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `skill_not_found` -- The skill doesn't exist or the caller can't see it. - `method_not_supported_for_skill_type` -- Only canvas skills can be changed. - `restricted_action` -- The caller isn't allowed to change this skill. - `feature_not_enabled` -- The Skills API isn't enabled for this organization. - `canvas_editing_locked` -- Another edit to the skill is in progress. Retry the request. - `canvas_editing_failed` -- The skill's instructions or display name couldn't be saved. - `invalid_category` -- `category` isn't one of the skill categories. - `display_name_too_long` -- `display_name` is longer than 255 characters. - `description_too_long` -- `description` is longer than 400 characters. - `example_prompt_too_long` -- `example_prompt` is longer than 200 characters. - `instructions_too_large` -- `instructions` is larger than 500,000 bytes. - `too_many_mcp_servers` -- More apps were declared than the caller can enable at once. - `mcp_server_not_found` -- One or more declared apps don't exist or aren't available to the caller. `invalid_mcp_servers` lists them. - `internal_error` -- The skill's metadata couldn't be saved. Retry the request. See https://docs.slack.dev/reference/methods/slackbot.skills.update */ export const updateSkill: API.OperationMethod< UpdateSkillRequest, UpdateSkillResponse, @@ -575,7 +969,23 @@ export const updateSkill: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(40, __c10, 0) as any as S.Schema, output: __S(16, __c4, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CanvasEditingFailed, + CanvasEditingLocked, + DescriptionTooLong, + DisplayNameTooLong, + ExamplePromptTooLong, + FeatureNotEnabled, + InstructionsTooLarge, + InvalidCategory, + McpServerNotFound, + MethodNotSupportedForSkillType, + RestrictedAction, + SkillNotFound, + TooManyMcpServers, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/stars.ts b/packages/slack/src/services/stars.ts index 5410f143d7..c64930c80f 100644 --- a/packages/slack/src/services/stars.ts +++ b/packages/slack/src/services/stars.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,136 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `already_starred` -- The specified item has already been starred by the authenticated user. */ +export class AlreadyStarred + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AlreadyStarred", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "already_starred" } }], + ) {} + +/** `bad_timestamp` -- Value passed for `timestamp` was invalid. */ +export class BadTimestamp + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadTimestamp", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_timestamp" } }], + ) {} + +/** `channel_not_found` -- Channel, private group, or DM specified by `channel` does not exist */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `external_channel_migrating` -- Channel is undergoing active migration */ +export class ExternalChannelMigrating + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExternalChannelMigrating", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "external_channel_migrating" } }], + ) {} + +/** `file_comment_not_found` -- File comment specified by `file_comment` does not exist. */ +export class FileCommentNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileCommentNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_comment_not_found" } }], + ) {} + +/** `file_not_found` -- File specified by `file` does not exist. */ +export class FileNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FileNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "file_not_found" } }], + ) {} + +/** `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. */ +export class MessageNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MessageNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "message_not_found" } }], + ) {} + +/** `missing_argument` -- A required argument is missing. */ +export class MissingArgument + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgument", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_argument" } }], + ) {} + +/** `no_item_specified` -- `file`, `file_comment`, `channel` and `timestamp` was not specified. */ +export class NoItemSpecified + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoItemSpecified", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_item_specified" } }], + ) {} + +/** `not_starred` -- The specified item is not currently starred by the authenticated user. */ +export class NotStarred + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotStarred", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_starred" } }], + ) {} + export interface AddStarRequest { /** Channel to add star to, or channel where the message to add star to was posted (used with `timestamp`). */ channel?: string | undefined; @@ -122,8 +253,17 @@ export interface RemoveStarResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type AddStarError = SlackOpError; -/** Save an item for later. Formerly known as adding a star. Required scopes -- user: `stars:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `already_starred` -- The specified item has already been starred by the authenticated user. - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Channel, private group, or DM specified by `channel` does not exist - `external_channel_migrating` -- Channel is undergoing active migration - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, `channel` and `timestamp` was not specified. See https://docs.slack.dev/reference/methods/stars.add */ +export type AddStarError = + | AlreadyStarred + | BadTimestamp + | ChannelNotFound + | ExternalChannelMigrating + | FileCommentNotFound + | FileNotFound + | MessageNotFound + | NoItemSpecified + | SlackOpError; +/** Save an item for later. Formerly known as adding a star. Required scopes -- user: `stars:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `already_starred` -- The specified item has already been starred by the authenticated user. - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Channel, private group, or DM specified by `channel` does not exist - `external_channel_migrating` -- Channel is undergoing active migration - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, `channel` and `timestamp` was not specified. See https://docs.slack.dev/reference/methods/stars.add */ export const addStar: API.OperationMethod< AddStarRequest, AddStarResponse, @@ -132,15 +272,26 @@ export const addStar: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AlreadyStarred, + BadTimestamp, + ChannelNotFound, + ExternalChannelMigrating, + FileCommentNotFound, + FileNotFound, + MessageNotFound, + NoItemSpecified, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddStar", })); -export type ListStarsError = SlackOpError; -/** (Deprecated) Listed a user's saved items, formerly known as stars. Required scopes -- user: `stars:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. See https://docs.slack.dev/reference/methods/stars.list */ +export type ListStarsError = MissingArgument | SlackOpError; +/** (Deprecated) Listed a user's saved items, formerly known as stars. Required scopes -- user: `stars:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- A required argument is missing. See https://docs.slack.dev/reference/methods/stars.list */ export const listStars: API.PaginatedOperationMethod< ListStarsRequest, ListStarsResponse, @@ -151,7 +302,7 @@ export const listStars: API.PaginatedOperationMethod< () => ({ input: __S(16, __c2, 0) as any as S.Schema, output: __S(20, __c2, 4) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [MissingArgument, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -167,8 +318,16 @@ export const listStars: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type RemoveStarError = SlackOpError; -/** Removes a saved item (star) from an item. Required scopes -- user: `stars:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Channel, private group, or DM specified by `channel` does not exist - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, `channel` and `timestamp` was not specified. - `not_starred` -- The specified item is not currently starred by the authenticated user. See https://docs.slack.dev/reference/methods/stars.remove */ +export type RemoveStarError = + | BadTimestamp + | ChannelNotFound + | FileCommentNotFound + | FileNotFound + | MessageNotFound + | NoItemSpecified + | NotStarred + | SlackOpError; +/** Removes a saved item (star) from an item. Required scopes -- user: `stars:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Channel, private group, or DM specified by `channel` does not exist - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, `channel` and `timestamp` was not specified. - `not_starred` -- The specified item is not currently starred by the authenticated user. See https://docs.slack.dev/reference/methods/stars.remove */ export const removeStar: API.OperationMethod< RemoveStarRequest, RemoveStarResponse, @@ -177,7 +336,17 @@ export const removeStar: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c3, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadTimestamp, + ChannelNotFound, + FileCommentNotFound, + FileNotFound, + MessageNotFound, + NoItemSpecified, + NotStarred, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/team.ts b/packages/slack/src/services/team.ts index 669ba14a55..4f58f90c47 100644 --- a/packages/slack/src/services/team.ts +++ b/packages/slack/src/services/team.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,295 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `enterprise_not_found` -- The `enterprise` was not found. */ +export class EnterpriseNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EnterpriseNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "enterprise_not_found" } }], + ) {} + +/** `fail_to_get_teams_for_restricted_user` -- Failed to get teams for restricted user. */ +export class FailToGetTeamsForRestrictedUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "FailToGetTeamsForRestrictedUser", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "fail_to_get_teams_for_restricted_user" } }], + ) {} + +/** `invalid_arguments` -- One or more of the API arguments are invalid. */ +export class InvalidArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_arguments" } }], + ) {} + +/** `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_limit` -- The value passed for `limit` was not valid. */ +export class InvalidLimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidLimit", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_limit" } }], + ) {} + +/** `invalid_target_team` -- target team is invalid */ +export class InvalidTargetTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTargetTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_target_team" } }], + ) {} + +/** `invalid_team` -- Cannot find a team associated with the authed token. */ +export class InvalidTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_team" } }], + ) {} + +/** `invalid_team_id` -- The value passed for `team_id` is not valid given the token context. */ +export class InvalidTeamId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTeamId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_team_id" } }], + ) {} + +/** `invalid_workspace_filter` -- The specified workspace is not valid. */ +export class InvalidWorkspaceFilter + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidWorkspaceFilter", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_workspace_filter" } }], + ) {} + +/** `missing_argument` -- A required argument is missing. */ +export class MissingArgument + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgument", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_argument" } }], + ) {} + +/** `missing_scope` -- The provided token hasn't obtained the necessary scopes to use this method. */ +export class MissingScope + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingScope", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_scope" } }], + ) {} + +/** `missing_user` -- The `user` was not found. */ +export class MissingUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_user" } }], + ) {} + +/** `not_allowed` -- The user is not allowed to perform the action. */ +export class NotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_allowed" } }], + ) {} + +/** `not_allowed_token_type` -- Method was called with an invalid token type */ +export class NotAllowedTokenType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAllowedTokenType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_allowed_token_type" } }], + ) {} + +/** `org_not_found` -- The `org` was not found. */ +export class OrgNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OrgNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "org_not_found" } }], + ) {} + +/** `over_pagination_limit` -- It is not possible to request more than 1000 items per page or more than 100 pages. */ +export class OverPaginationLimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OverPaginationLimit", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "over_pagination_limit" } }], + ) {} + +/** `paid_only` -- This is only available to paid teams. */ +export class PaidOnly + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PaidOnly", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "paid_only" } }], + ) {} + +/** `restricted_action` -- The actor is restricted from archiving or disconnecting. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `team_not_found` -- The `team` was not found. */ +export class TeamNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "team_not_found" } }], + ) {} + +/** `team_not_on_enterprise` -- Cannot query team by domain because team is not on an enterprise. */ +export class TeamNotOnEnterprise + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamNotOnEnterprise", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "team_not_on_enterprise" } }], + ) {} + +/** `user_cannot_manage_workspace` -- The calling user cannot manage the workspace passed in the workspace filter. */ +export class UserCannotManageWorkspace + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserCannotManageWorkspace", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_cannot_manage_workspace" } }], + ) {} + +/** `user_not_found` -- Unable to find the requested user. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + export type AccessLogsRequestBeforeCase0 = "now"; export type AccessLogsRequestBefore = AccessLogsRequestBeforeCase0 | (string & {}) | string; export interface AccessLogsRequest { @@ -283,8 +573,17 @@ export interface TeamInfoResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type AccessLogsError = SlackOpError; -/** Gets the access logs for the current team. Required scopes -- user: `admin` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `missing_scope` -- The provided token hasn't obtained the necessary scopes to use this method. - `not_allowed_token_type` -- Method was called with an invalid token type - `over_pagination_limit` -- It is not possible to request more than 1000 items per page or more than 100 pages. - `paid_only` -- This is only available to paid teams. - `token_revoked` -- token revoked (generated) - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_limit` -- The value passed for `limit` was not valid. - `invalid_team_id` -- The value passed for `team_id` is not valid given the token context. See https://docs.slack.dev/reference/methods/team.accessLogs */ +export type AccessLogsError = + | InvalidCursor + | InvalidLimit + | InvalidTeamId + | MissingArgument + | MissingScope + | NotAllowedTokenType + | OverPaginationLimit + | PaidOnly + | SlackOpError; +/** Gets the access logs for the current team. Required scopes -- user: `admin` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- A required argument is missing. - `missing_scope` -- The provided token hasn't obtained the necessary scopes to use this method. - `not_allowed_token_type` -- Method was called with an invalid token type - `over_pagination_limit` -- It is not possible to request more than 1000 items per page or more than 100 pages. - `paid_only` -- This is only available to paid teams. - `token_revoked` -- token revoked (generated) - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_limit` -- The value passed for `limit` was not valid. - `invalid_team_id` -- The value passed for `team_id` is not valid given the token context. See https://docs.slack.dev/reference/methods/team.accessLogs */ export const accessLogs: API.PaginatedOperationMethod< AccessLogsRequest, AccessLogsResponse, @@ -295,7 +594,18 @@ export const accessLogs: API.PaginatedOperationMethod< () => ({ input: __S(1, __c0, 1) as any as S.Schema, output: __S(5, __c0, 5) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + InvalidCursor, + InvalidLimit, + InvalidTeamId, + MissingArgument, + MissingScope, + NotAllowedTokenType, + OverPaginationLimit, + PaidOnly, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -311,8 +621,8 @@ export const accessLogs: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type BillableInfoError = SlackOpError; -/** Gets billable users information for the current team. Required scopes -- user: `admin` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `fatal_error` -- The server could not complete your operation(s) without encountering a catastrophic error. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `user_not_found` -- Unable to find the requested user. See https://docs.slack.dev/reference/methods/team.billableInfo */ +export type BillableInfoError = InvalidCursor | UserNotFound | SlackOpError; +/** Gets billable users information for the current team. Required scopes -- user: `admin` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `fatal_error` -- The server could not complete your operation(s) without encountering a catastrophic error. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `user_not_found` -- Unable to find the requested user. See https://docs.slack.dev/reference/methods/team.billableInfo */ export const billableInfo: API.OperationMethod< BillableInfoRequest, BillableInfoResponse, @@ -321,15 +631,15 @@ export const billableInfo: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c2, 0) as any as S.Schema, output: __S(33, __c2, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [InvalidCursor, UserNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BillableInfo", })); -export type BillingInfoError = SlackOpError; -/** Reads a workspace's billing plan information. Required scopes -- bot: `team.billing:read`; user: `team.billing:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_auth` -- Invalid token provided. - `invalid_team` -- Cannot find a team associated with the authed token. See https://docs.slack.dev/reference/methods/team.billing.info */ +export type BillingInfoError = InvalidTeam | SlackOpError; +/** Reads a workspace's billing plan information. Required scopes -- bot: `team.billing:read`; user: `team.billing:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_auth` -- Invalid token provided. - `invalid_team` -- Cannot find a team associated with the authed token. See https://docs.slack.dev/reference/methods/team.billing.info */ export const billingInfo: API.OperationMethod< BillingInfoRequest, BillingInfoResponse, @@ -338,15 +648,19 @@ export const billingInfo: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(64, __c4, 0) as any as S.Schema, output: __S(65, __c4, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [InvalidTeam, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "BillingInfo", })); -export type DisconnectExternalTeamError = SlackOpError; -/** Disconnect an external organization. Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `restricted_action` -- The actor is restricted from archiving or disconnecting. - `invalid_target_team` -- target team is invalid See https://docs.slack.dev/reference/methods/team.externalTeams.disconnect */ +export type DisconnectExternalTeamError = + | InvalidTargetTeam + | MissingArgument + | RestrictedAction + | SlackOpError; +/** Disconnect an external organization. Required scopes -- bot: `conversations.connect:manage` Rate limit tier: 1 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- A required argument is missing. - `restricted_action` -- The actor is restricted from archiving or disconnecting. - `invalid_target_team` -- target team is invalid See https://docs.slack.dev/reference/methods/team.externalTeams.disconnect */ export const disconnectExternalTeam: API.OperationMethod< DisconnectExternalTeamRequest, DisconnectExternalTeamResponse, @@ -355,7 +669,7 @@ export const disconnectExternalTeam: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(80, __c5, 0) as any as S.Schema, output: __S(81, __c5, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [InvalidTargetTeam, MissingArgument, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -379,8 +693,8 @@ export const getProfile: API.OperationMethod< span: "GetProfile", })); -export type IntegrationLogsError = SlackOpError; -/** Gets the integration logs for the current team. Required scopes -- user: `admin` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Internal Error - `missing_argument` -- A required argument is missing. See https://docs.slack.dev/reference/methods/team.integrationLogs */ +export type IntegrationLogsError = MissingArgument | SlackOpError; +/** Gets the integration logs for the current team. Required scopes -- user: `admin` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `internal_error` -- Internal Error - `missing_argument` -- A required argument is missing. See https://docs.slack.dev/reference/methods/team.integrationLogs */ export const integrationLogs: API.OperationMethod< IntegrationLogsRequest, IntegrationLogsResponse, @@ -389,15 +703,21 @@ export const integrationLogs: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(112, __c7, 0) as any as S.Schema, output: __S(114, __c7, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [MissingArgument, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "IntegrationLogs", })); -export type ListExternalTeamsError = SlackOpError; -/** Returns a list of all the external teams connected and details about the connection. Required scopes -- bot: `conversations.connect:manage`, `team:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` -- One or more of the API arguments are invalid. - `not_allowed` -- The user is not allowed to perform the action. - `restricted_action` -- The user does not have permission to perform the action. - `internal_error` -- There was an internal error processing this request. - `invalid_workspace_filter` -- The specified workspace is not valid. - `user_cannot_manage_workspace` -- The calling user cannot manage the workspace passed in the workspace filter. See https://docs.slack.dev/reference/methods/team.externalTeams.list */ +export type ListExternalTeamsError = + | InvalidArguments + | InvalidWorkspaceFilter + | NotAllowed + | RestrictedAction + | UserCannotManageWorkspace + | SlackOpError; +/** Returns a list of all the external teams connected and details about the connection. Required scopes -- bot: `conversations.connect:manage`, `team:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_arguments` -- One or more of the API arguments are invalid. - `not_allowed` -- The user is not allowed to perform the action. - `restricted_action` -- The user does not have permission to perform the action. - `internal_error` -- There was an internal error processing this request. - `invalid_workspace_filter` -- The specified workspace is not valid. - `user_cannot_manage_workspace` -- The calling user cannot manage the workspace passed in the workspace filter. See https://docs.slack.dev/reference/methods/team.externalTeams.list */ export const listExternalTeams: API.PaginatedOperationMethod< ListExternalTeamsRequest, ListExternalTeamsResponse, @@ -408,7 +728,15 @@ export const listExternalTeams: API.PaginatedOperationMethod< () => ({ input: __S(130, __c8, 2) as any as S.Schema, output: __S(138, __c8, 10) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + InvalidArguments, + InvalidWorkspaceFilter, + NotAllowed, + RestrictedAction, + UserCannotManageWorkspace, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -424,8 +752,8 @@ export const listExternalTeams: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type ListPreferencesError = SlackOpError; -/** Retrieve a list of a workspace's team preferences. Required scopes -- bot: `team.preferences:read`; user: `team.preferences:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_auth` -- Invalid token provided. - `invalid_team` -- Cannot find a workspace associated with the presented token. See https://docs.slack.dev/reference/methods/team.preferences.list */ +export type ListPreferencesError = InvalidTeam | SlackOpError; +/** Retrieve a list of a workspace's team preferences. Required scopes -- bot: `team.preferences:read`; user: `team.preferences:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_auth` -- Invalid token provided. - `invalid_team` -- Cannot find a workspace associated with the presented token. See https://docs.slack.dev/reference/methods/team.preferences.list */ export const listPreferences: API.OperationMethod< ListPreferencesRequest, ListPreferencesResponse, @@ -434,15 +762,23 @@ export const listPreferences: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(144, __c9, 0) as any as S.Schema, output: __S(145, __c9, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [InvalidTeam, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListPreferences", })); -export type TeamInfoError = SlackOpError; -/** Gets information about the current team. Required scopes -- bot: `team:read`; user: `team:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `enterprise_not_found` -- The `enterprise` was not found. - `fail_to_get_teams_for_restricted_user` -- Failed to get teams for restricted user. - `missing_user` -- The `user` was not found. - `org_not_found` -- The `org` was not found. - `team_not_found` -- The `team` was not found. - `team_not_on_enterprise` -- Cannot query team by domain because team is not on an enterprise. - `user_not_found` -- The `user` was not found. See https://docs.slack.dev/reference/methods/team.info */ +export type TeamInfoError = + | EnterpriseNotFound + | FailToGetTeamsForRestrictedUser + | MissingUser + | OrgNotFound + | TeamNotFound + | TeamNotOnEnterprise + | UserNotFound + | SlackOpError; +/** Gets information about the current team. Required scopes -- bot: `team:read`; user: `team:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `enterprise_not_found` -- The `enterprise` was not found. - `fail_to_get_teams_for_restricted_user` -- Failed to get teams for restricted user. - `missing_user` -- The `user` was not found. - `org_not_found` -- The `org` was not found. - `team_not_found` -- The `team` was not found. - `team_not_on_enterprise` -- Cannot query team by domain because team is not on an enterprise. - `user_not_found` -- The `user` was not found. See https://docs.slack.dev/reference/methods/team.info */ export const teamInfo: API.OperationMethod< TeamInfoRequest, TeamInfoResponse, @@ -451,7 +787,17 @@ export const teamInfo: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(160, __c10, 0) as any as S.Schema, output: __S(161, __c10, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + EnterpriseNotFound, + FailToGetTeamsForRestrictedUser, + MissingUser, + OrgNotFound, + TeamNotFound, + TeamNotOnEnterprise, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/tooling.ts b/packages/slack/src/services/tooling.ts index a97d5751f5..bf191ac707 100644 --- a/packages/slack/src/services/tooling.ts +++ b/packages/slack/src/services/tooling.ts @@ -25,6 +25,32 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `invalid_refresh_token` -- The given refresh token is invalid. */ +export class InvalidRefreshToken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidRefreshToken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_refresh_token" } }], + ) {} + +/** `unknown_error` -- Temporary error for dev only restriction */ +export class UnknownError + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownError", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_error" } }], + ) {} + export interface RotateTokenRequest { /** The `xoxe` refresh token that was issued along with the old app configuration token. */ refresh_token: string | Redacted.Redacted; @@ -33,7 +59,7 @@ export interface RotateTokenResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; /** The app configuration token used to access App Manifest APIs */ - token: string; + token: string | Redacted.Redacted; /** Refresh token for this credential */ refresh_token: string | Redacted.Redacted; /** ID of the team associated with the access token. */ @@ -45,8 +71,8 @@ export interface RotateTokenResponse { /** Issued at (iat) identifies the time at which the token was issued. */ iat: number; } -export type RotateTokenError = SlackOpError; -/** Exchanges a refresh token for a new app configuration token. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Internal error - `invalid_refresh_token` -- The given refresh token is invalid. - `unknown_error` -- Temporary error for dev only restriction See https://docs.slack.dev/reference/methods/tooling.tokens.rotate */ +export type RotateTokenError = InvalidRefreshToken | UnknownError | SlackOpError; +/** Exchanges a refresh token for a new app configuration token. Rate limit tier: 5 Method-specific errors (each a typed error named after its slug): - `internal_error` -- Internal error - `invalid_refresh_token` -- The given refresh token is invalid. - `unknown_error` -- Temporary error for dev only restriction See https://docs.slack.dev/reference/methods/tooling.tokens.rotate */ export const rotateToken: API.OperationMethod< RotateTokenRequest, RotateTokenResponse, @@ -55,7 +81,7 @@ export const rotateToken: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [InvalidRefreshToken, UnknownError, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -82,7 +108,7 @@ function __c0(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - token: S.String, + token: S.String.pipe(T.SensitiveValue({})), refresh_token: S.String.pipe(T.SensitiveValue({})), team_id: S.String, user_id: S.String, diff --git a/packages/slack/src/services/usergroups.ts b/packages/slack/src/services/usergroups.ts index f2f4861976..4374a82ff4 100644 --- a/packages/slack/src/services/usergroups.ts +++ b/packages/slack/src/services/usergroups.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,347 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `bad_handle` -- Handle is invalid */ +export class BadHandle + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadHandle", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_handle" } }], + ) {} + +/** `cannot_modify_role_admin` -- The user does not have permission to modify the roles admin role. */ +export class CannotModifyRoleAdmin + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotModifyRoleAdmin", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_modify_role_admin" } }], + ) {} + +/** `description_too_long` -- Given usergroup description is too long */ +export class DescriptionTooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DescriptionTooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "description_too_long" } }], + ) {} + +/** `failed_for_some_users` -- User(s) are not in the workspace where this usergroup exists */ +export class FailedForSomeUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("FailedForSomeUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "failed_for_some_users" } }], + ) {} + +/** `forbidden_handle` -- Handle is invalid */ +export class ForbiddenHandle + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ForbiddenHandle", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "forbidden_handle" } }], + ) {} + +/** `handle_already_exists` -- Handle is already in use on this workspace */ +export class HandleAlreadyExists + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("HandleAlreadyExists", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "handle_already_exists" } }], + ) {} + +/** `invalid_channel_provided` -- An invalid channel ID was provided */ +export class InvalidChannelProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidChannelProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_channel_provided" } }], + ) {} + +/** `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_group_provided` -- An invalid group ID was provided */ +export class InvalidGroupProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidGroupProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_group_provided" } }], + ) {} + +/** `invalid_team` -- Cannot find subteam team. */ +export class InvalidTeam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTeam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_team" } }], + ) {} + +/** `invalid_users` -- Value passed for `users` was empty or invalid. */ +export class InvalidUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_users" } }], + ) {} + +/** `missing_argument` -- A required argument is missing. */ +export class MissingArgument + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgument", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_argument" } }], + ) {} + +/** `missing_subteam_name` -- Subteam name is required */ +export class MissingSubteamName + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingSubteamName", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_subteam_name" } }], + ) {} + +/** `name_already_exists` -- Name is already in use on this workspace */ +export class NameAlreadyExists + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NameAlreadyExists", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "name_already_exists" } }], + ) {} + +/** `name_too_long` -- Name too long. */ +export class NameTooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NameTooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "name_too_long" } }], + ) {} + +/** `no_such_subteam` -- No usergroup found with the given ID. */ +export class NoSuchSubteam + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoSuchSubteam", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_such_subteam" } }], + ) {} + +/** `no_users_provided` -- Either the `users` field wasn't provided or an empty value was passed. */ +export class NoUsersProvided + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoUsersProvided", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_users_provided" } }], + ) {} + +/** `paid_teams_only` -- Usergroups can only be used on paid Slack teams */ +export class PaidTeamsOnly + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PaidTeamsOnly", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "paid_teams_only" } }], + ) {} + +/** `permission_denied` -- The user does not have permission to create a User Group. */ +export class PermissionDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PermissionDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "permission_denied" } }], + ) {} + +/** `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. */ +export class PlanUpgradeRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PlanUpgradeRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "plan_upgrade_required" } }], + ) {} + +/** `subteam_max_users_exceeded` -- Exceeds maximum supported number of users per subteam. */ +export class SubteamMaxUsersExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SubteamMaxUsersExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "subteam_max_users_exceeded" } }], + ) {} + +/** `target_team_must_be_specified_in_org_context` -- No target team was specified but the team in context is an org */ +export class TargetTeamMustBeSpecifiedInOrgContext + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "TargetTeamMustBeSpecifiedInOrgContext", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "target_team_must_be_specified_in_org_context" } }], + ) {} + +/** `target_team_not_on_org` -- Target team specified is not on the org in context */ +export class TargetTeamNotOnOrg + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TargetTeamNotOnOrg", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "target_team_not_on_org" } }], + ) {} + +/** `too_many_linked_channels` -- This request exceeds the number of channels we supporting linking to a single usergroup. */ +export class TooManyLinkedChannels + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyLinkedChannels", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_linked_channels" } }], + ) {} + +/** `user_channel_limit_exceeded` -- Adding these channels would cause one or more members to exceed their channel limit. */ +export class UserChannelLimitExceeded + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserChannelLimitExceeded", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_channel_limit_exceeded" } }], + ) {} + +/** `users_not_found` -- Cannot find users on subteam. */ +export class UsersNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UsersNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "users_not_found" } }], + ) {} + /** A comma separated string of encoded channel IDs for which the User Group uses as a default. */ export type CreateUsergroupRequestChannelsList = Array; /** A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too. */ @@ -163,8 +505,24 @@ export interface UpdateUsergroupResponse { /** List of user IDs who would exceed their channel limit */ channel_limit_user_ids?: UpdateUsergroupResponseChannelLimitUserIdsList | undefined; } -export type CreateUsergroupError = SlackOpError; -/** Create a User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_handle` -- Handle is invalid - `description_too_long` -- Given usergroup description is too long - `forbidden_handle` -- Handle is invalid - `handle_already_exists` -- Handle is already in use on this workspace - `invalid_channel_provided` -- An invalid channel ID was provided - `invalid_group_provided` -- An invalid group ID was provided - `missing_argument` -- A required argument is missing. - `missing_subteam_name` -- Subteam name is required - `name_already_exists` -- Name is already in use on this workspace - `name_too_long` -- Name too long. - `paid_teams_only` -- Usergroups can only be used on paid Slack teams - `permission_denied` -- The user does not have permission to create a User Group. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `target_team_not_on_org` -- Target team specified is not on the org in context - `target_team_must_be_specified_in_org_context` -- No target team was specified but the team in context is an org See https://docs.slack.dev/reference/methods/usergroups.create */ +export type CreateUsergroupError = + | BadHandle + | DescriptionTooLong + | ForbiddenHandle + | HandleAlreadyExists + | InvalidChannelProvided + | InvalidGroupProvided + | MissingArgument + | MissingSubteamName + | NameAlreadyExists + | NameTooLong + | PaidTeamsOnly + | PermissionDenied + | PlanUpgradeRequired + | TargetTeamMustBeSpecifiedInOrgContext + | TargetTeamNotOnOrg + | SlackOpError; +/** Create a User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `bad_handle` -- Handle is invalid - `description_too_long` -- Given usergroup description is too long - `forbidden_handle` -- Handle is invalid - `handle_already_exists` -- Handle is already in use on this workspace - `invalid_channel_provided` -- An invalid channel ID was provided - `invalid_group_provided` -- An invalid group ID was provided - `missing_argument` -- A required argument is missing. - `missing_subteam_name` -- Subteam name is required - `name_already_exists` -- Name is already in use on this workspace - `name_too_long` -- Name too long. - `paid_teams_only` -- Usergroups can only be used on paid Slack teams - `permission_denied` -- The user does not have permission to create a User Group. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `target_team_not_on_org` -- Target team specified is not on the org in context - `target_team_must_be_specified_in_org_context` -- No target team was specified but the team in context is an org See https://docs.slack.dev/reference/methods/usergroups.create */ export const createUsergroup: API.OperationMethod< CreateUsergroupRequest, CreateUsergroupResponse, @@ -173,15 +531,39 @@ export const createUsergroup: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + BadHandle, + DescriptionTooLong, + ForbiddenHandle, + HandleAlreadyExists, + InvalidChannelProvided, + InvalidGroupProvided, + MissingArgument, + MissingSubteamName, + NameAlreadyExists, + NameTooLong, + PaidTeamsOnly, + PermissionDenied, + PlanUpgradeRequired, + TargetTeamMustBeSpecifiedInOrgContext, + TargetTeamNotOnOrg, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateUsergroup", })); -export type DisableUsergroupError = SlackOpError; -/** Disable an existing User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `permission_denied` -- The user does not have permission to disable the User Group. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `target_team_not_on_org` -- Target team specified is not on the org in context - `target_team_must_be_specified_in_org_context` -- No target team was specified but the team in context is an org See https://docs.slack.dev/reference/methods/usergroups.disable */ +export type DisableUsergroupError = + | MissingArgument + | PermissionDenied + | PlanUpgradeRequired + | TargetTeamMustBeSpecifiedInOrgContext + | TargetTeamNotOnOrg + | SlackOpError; +/** Disable an existing User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- A required argument is missing. - `permission_denied` -- The user does not have permission to disable the User Group. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `target_team_not_on_org` -- Target team specified is not on the org in context - `target_team_must_be_specified_in_org_context` -- No target team was specified but the team in context is an org See https://docs.slack.dev/reference/methods/usergroups.disable */ export const disableUsergroup: API.OperationMethod< DisableUsergroupRequest, DisableUsergroupResponse, @@ -190,15 +572,27 @@ export const disableUsergroup: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(6, __c3, 0) as any as S.Schema, output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + MissingArgument, + PermissionDenied, + PlanUpgradeRequired, + TargetTeamMustBeSpecifiedInOrgContext, + TargetTeamNotOnOrg, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DisableUsergroup", })); -export type EnableUsergroupError = SlackOpError; -/** Enable a User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `permission_denied` -- The user does not have permission to enables the User Group. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. See https://docs.slack.dev/reference/methods/usergroups.enable */ +export type EnableUsergroupError = + | MissingArgument + | PermissionDenied + | PlanUpgradeRequired + | SlackOpError; +/** Enable a User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- A required argument is missing. - `permission_denied` -- The user does not have permission to enables the User Group. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. See https://docs.slack.dev/reference/methods/usergroups.enable */ export const enableUsergroup: API.OperationMethod< EnableUsergroupRequest, EnableUsergroupResponse, @@ -207,15 +601,21 @@ export const enableUsergroup: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c4, 0) as any as S.Schema, output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [MissingArgument, PermissionDenied, PlanUpgradeRequired, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "EnableUsergroup", })); -export type ListUsergroupsError = SlackOpError; -/** List all User Groups for a team. Required scopes -- bot: `usergroups:read`; user: `usergroups:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `users_not_found` -- Cannot find users on subteam. - `invalid_team` -- Cannot find subteam team. See https://docs.slack.dev/reference/methods/usergroups.list */ +export type ListUsergroupsError = + | InvalidCursor + | InvalidTeam + | MissingArgument + | PlanUpgradeRequired + | UsersNotFound + | SlackOpError; +/** List all User Groups for a team. Required scopes -- bot: `usergroups:read`; user: `usergroups:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- A required argument is missing. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `users_not_found` -- Cannot find users on subteam. - `invalid_team` -- Cannot find subteam team. See https://docs.slack.dev/reference/methods/usergroups.list */ export const listUsergroups: API.OperationMethod< ListUsergroupsRequest, ListUsergroupsResponse, @@ -224,15 +624,23 @@ export const listUsergroups: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(10, __c5, 0) as any as S.Schema, output: __S(11, __c5, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + InvalidCursor, + InvalidTeam, + MissingArgument, + PlanUpgradeRequired, + UsersNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListUsergroups", })); -export type ListUsersError = SlackOpError; -/** List all users in a User Group. Required scopes -- bot: `usergroups:read`; user: `usergroups:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `no_such_subteam` -- No usergroup found with the given ID. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. See https://docs.slack.dev/reference/methods/usergroups.users.list */ +export type ListUsersError = InvalidCursor | NoSuchSubteam | PlanUpgradeRequired | SlackOpError; +/** List all users in a User Group. Required scopes -- bot: `usergroups:read`; user: `usergroups:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `no_such_subteam` -- No usergroup found with the given ID. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. See https://docs.slack.dev/reference/methods/usergroups.users.list */ export const listUsers: API.OperationMethod< ListUsersRequest, ListUsersResponse, @@ -241,15 +649,24 @@ export const listUsers: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(14, __c7, 0) as any as S.Schema, output: __S(15, __c7, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [InvalidCursor, NoSuchSubteam, PlanUpgradeRequired, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListUsers", })); -export type UpdateUserError = SlackOpError; -/** Update the list of users for a user group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_users` -- Value passed for `users` was empty or invalid. - `failed_for_some_users` -- User(s) are not in the workspace where this usergroup exists - `missing_argument` -- A required argument is missing. - `no_users_provided` -- Either the `users` field wasn't provided or an empty value was passed. - `permission_denied` -- The user does not have permission to update the list of users for a user group. Check workspace settings to confirm whether the calling user has permission. - `plan_upgrade_required` -- This workspace does not have access to user groups, as that feature is only available on Standard and above plans. - `subteam_max_users_exceeded` -- Exceeds maximum supported number of users per subteam. - `cannot_modify_role_admin` -- The user does not have permission to modify the roles admin role. See https://docs.slack.dev/reference/methods/usergroups.users.update */ +export type UpdateUserError = + | CannotModifyRoleAdmin + | FailedForSomeUsers + | InvalidUsers + | MissingArgument + | NoUsersProvided + | PermissionDenied + | PlanUpgradeRequired + | SubteamMaxUsersExceeded + | SlackOpError; +/** Update the list of users for a user group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_users` -- Value passed for `users` was empty or invalid. - `failed_for_some_users` -- User(s) are not in the workspace where this usergroup exists - `missing_argument` -- A required argument is missing. - `no_users_provided` -- Either the `users` field wasn't provided or an empty value was passed. - `permission_denied` -- The user does not have permission to update the list of users for a user group. Check workspace settings to confirm whether the calling user has permission. - `plan_upgrade_required` -- This workspace does not have access to user groups, as that feature is only available on Standard and above plans. - `subteam_max_users_exceeded` -- Exceeds maximum supported number of users per subteam. - `cannot_modify_role_admin` -- The user does not have permission to modify the roles admin role. See https://docs.slack.dev/reference/methods/usergroups.users.update */ export const updateUser: API.OperationMethod< UpdateUserRequest, UpdateUserResponse, @@ -258,15 +675,32 @@ export const updateUser: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(16, __c8, 0) as any as S.Schema, output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + CannotModifyRoleAdmin, + FailedForSomeUsers, + InvalidUsers, + MissingArgument, + NoUsersProvided, + PermissionDenied, + PlanUpgradeRequired, + SubteamMaxUsersExceeded, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateUser", })); -export type UpdateUsergroupError = SlackOpError; -/** Update an existing User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `paid_teams_only` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `permission_denied` -- The user does not have permission to update the User Group. - `too_many_linked_channels` -- This request exceeds the number of channels we supporting linking to a single usergroup. - `user_channel_limit_exceeded` -- Adding these channels would cause one or more members to exceed their channel limit. See https://docs.slack.dev/reference/methods/usergroups.update */ +export type UpdateUsergroupError = + | MissingArgument + | PaidTeamsOnly + | PermissionDenied + | TooManyLinkedChannels + | UserChannelLimitExceeded + | SlackOpError; +/** Update an existing User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `missing_argument` -- A required argument is missing. - `paid_teams_only` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `permission_denied` -- The user does not have permission to update the User Group. - `too_many_linked_channels` -- This request exceeds the number of channels we supporting linking to a single usergroup. - `user_channel_limit_exceeded` -- Adding these channels would cause one or more members to exceed their channel limit. See https://docs.slack.dev/reference/methods/usergroups.update */ export const updateUsergroup: API.OperationMethod< UpdateUsergroupRequest, UpdateUsergroupResponse, @@ -275,7 +709,15 @@ export const updateUsergroup: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(18, __c9, 0) as any as S.Schema, output: __S(19, __c9, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + MissingArgument, + PaidTeamsOnly, + PermissionDenied, + TooManyLinkedChannels, + UserChannelLimitExceeded, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/users.ts b/packages/slack/src/services/users.ts index d61cf439ee..93258998e9 100644 --- a/packages/slack/src/services/users.ts +++ b/packages/slack/src/services/users.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -25,6 +26,535 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `bad_image` -- The uploaded image could not be processed - try passing a JPEG, GIF or PNG */ +export class BadImage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("BadImage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "bad_image" } }], + ) {} + +/** `cannot_update_admin_user` -- Only a primary owner can update the profile of an admin. */ +export class CannotUpdateAdminUser + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("CannotUpdateAdminUser", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "cannot_update_admin_user" } }], + ) {} + +/** `email_not_verified` -- user email has not been verified */ +export class EmailNotVerified + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EmailNotVerified", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "email_not_verified" } }], + ) {} + +/** `email_taken` -- email taken */ +export class EmailTaken + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EmailTaken", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withAlreadyExistsError), + [{ body: { "/error": "email_taken" } }], + ) {} + +/** `enterprise_is_restricted` -- This method was called with an inappropriate enterprise-level token. */ +export class EnterpriseIsRestricted + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("EnterpriseIsRestricted", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "enterprise_is_restricted" } }], + ) {} + +/** `frontline_member_username_change_not_allowed` -- Frontline members cannot change their own username. Only an admin can change it. */ +export class FrontlineMemberUsernameChangeNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "FrontlineMemberUsernameChangeNotAllowed", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "frontline_member_username_change_not_allowed" } }], + ) {} + +/** `invalid_arguments` -- Invalid arguments (including exceeding character count) */ +export class InvalidArguments + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidArguments", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_arguments" } }], + ) {} + +/** `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. */ +export class InvalidCursor + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidCursor", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_cursor" } }], + ) {} + +/** `invalid_emoji_not_allowed` -- Invalid emoji not allowed. */ +export class InvalidEmojiNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidEmojiNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_emoji_not_allowed" } }], + ) {} + +/** `invalid_limit` -- Value passed for `limit` is not understood. */ +export class InvalidLimit + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidLimit", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_limit" } }], + ) {} + +/** `invalid_ooo_message` -- Invalid Out of Office message. */ +export class InvalidOooMessage + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidOooMessage", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_ooo_message" } }], + ) {} + +/** `invalid_presence` -- Value passed for `presence` was invalid. */ +export class InvalidPresence + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidPresence", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_presence" } }], + ) {} + +/** `invalid_profile` -- Profile object passed in is not valid JSON (make sure it is URL encoded!). */ +export class InvalidProfile + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidProfile", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_profile" } }], + ) {} + +/** `invalid_starts_with_at` -- Name cannot start with @. */ +export class InvalidStartsWithAt + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidStartsWithAt", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_starts_with_at" } }], + ) {} + +/** `invalid_types` -- Value passed for `type` could not be used based on the method's capabilities or the permission scopes granted to the used token. */ +export class InvalidTypes + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTypes", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_types" } }], + ) {} + +/** `invalid_user_id` -- Invalid user id provided */ +export class InvalidUserId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidUserId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_user_id" } }], + ) {} + +/** `limit_required` -- For large teams a limit is required. */ +export class LimitRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("LimitRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "limit_required" } }], + ) {} + +/** `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. */ +export class MethodNotSupportedForChannelType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "MethodNotSupportedForChannelType", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "method_not_supported_for_channel_type" } }], + ) {} + +/** `missing_argument` -- A required argument is missing. */ +export class MissingArgument + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingArgument", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_argument" } }], + ) {} + +/** `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. */ +export class MissingScope + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingScope", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_scope" } }], + ) {} + +/** `must_clear_both_status_text_and_status_emoji` -- Clearing the status requires setting both `status_text` and `status_emoji` to ''. */ +export class MustClearBothStatusTextAndStatusEmoji + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()( + "MustClearBothStatusTextAndStatusEmoji", + { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }, + ), + [{ body: { "/error": "must_clear_both_status_text_and_status_emoji" } }], + ) {} + +/** `name_not_allowed` -- name cannot contain URL. */ +export class NameNotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NameNotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "name_not_allowed" } }], + ) {} + +/** `not_admin` -- Only admins can update the profile of another user. Some fields, like `email` may only be updated by an admin. */ +export class NotAdmin + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAdmin", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_admin" } }], + ) {} + +/** `not_allowed` -- user is not allowed to call this API */ +export class NotAllowed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAllowed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_allowed" } }], + ) {} + +/** `not_an_enterprise` -- The token does not belong to an enterprise. */ +export class NotAnEnterprise + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAnEnterprise", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_an_enterprise" } }], + ) {} + +/** `not_app_admin` -- Only team owners and selected members can update the profile of a bot user. */ +export class NotAppAdmin + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAppAdmin", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_app_admin" } }], + ) {} + +/** `partial_profile_set_failed` -- Failed to set user profile. */ +export class PartialProfileSetFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PartialProfileSetFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "partial_profile_set_failed" } }], + ) {} + +/** `permission_denied` -- Permission denied. */ +export class PermissionDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PermissionDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "permission_denied" } }], + ) {} + +/** `profile_set_failed` -- Failed to set user profile. */ +export class ProfileSetFailed + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ProfileSetFailed", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "profile_set_failed" } }], + ) {} + +/** `reserved_name` -- First or last name are reserved. */ +export class ReservedName + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ReservedName", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "reserved_name" } }], + ) {} + +/** `restricted_action` -- user is restricted from calling this API */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `sudo_required` -- Request requires sudo session. */ +export class SudoRequired + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SudoRequired", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "sudo_required" } }], + ) {} + +/** `too_large` -- The uploaded image had excessive dimensions */ +export class TooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_large" } }], + ) {} + +/** `too_long` -- You attempted to set a custom status but it was longer than the maximum allowed, 100. */ +export class TooLong + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooLong", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_long" } }], + ) {} + +/** `too_many_frames` -- An animated GIF with too many frames was uploaded */ +export class TooManyFrames + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyFrames", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_frames" } }], + ) {} + +/** `too_many_users` -- Too many users. */ +export class TooManyUsers + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyUsers", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_users" } }], + ) {} + +/** `username_same` -- Username is the same as the current username. */ +export class UsernameSame + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UsernameSame", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "username_same" } }], + ) {} + +/** `user_not_found` -- Value passed for `user` was invalid. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + +/** `user_not_visible` -- The requested user is not visible to the calling user */ +export class UserNotVisible + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotVisible", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "user_not_visible" } }], + ) {} + +/** `users_not_found` -- Value passed for `user` was invalid. */ +export class UsersNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UsersNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "users_not_found" } }], + ) {} + export interface DeletePhotoRequest {} export interface DeletePhotoResponse { /** Always `true` (a failed call raises a typed error instead). */ @@ -190,7 +720,7 @@ export interface UsersInfoResponse { users?: UsersInfoResponseUsersList | undefined; } export type DeletePhotoError = SlackOpError; -/** Delete the user profile photo Required scopes -- user: `users.profile:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- An unexpected error occurred. See https://docs.slack.dev/reference/methods/users.deletePhoto */ +/** Delete the user profile photo Required scopes -- user: `users.profile:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `internal_error` -- An unexpected error occurred. See https://docs.slack.dev/reference/methods/users.deletePhoto */ export const deletePhoto: API.OperationMethod< DeletePhotoRequest, DeletePhotoResponse, @@ -223,25 +753,25 @@ export const getPresence: API.OperationMethod< span: "GetPresence", })); -export type GetProfileError = SlackOpError; -/** Retrieve a user's profile information, including their custom status. Required scopes -- bot: `users.profile:read`; user: `users.profile:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `user_not_found` -- Value passed for `user` was invalid. - `token_revoked` -- The token being used is not valid. - `ratelimited` -- You are attempting to call this method too frequently. See https://docs.slack.dev/reference/methods/users.profile.get */ +export type GetProfileError = UserNotFound | SlackOpError; +/** Retrieve a user's profile information, including their custom status. Required scopes -- bot: `users.profile:read`; user: `users.profile:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `user_not_found` -- Value passed for `user` was invalid. - `token_revoked` -- The token being used is not valid. - `ratelimited` -- You are attempting to call this method too frequently. See https://docs.slack.dev/reference/methods/users.profile.get */ export const getProfile: API.OperationMethod< GetProfileRequest, GetProfileResponse, GetProfileError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(24, __c6, 0) as any as S.Schema, - output: __S(25, __c6, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(12, __c3, 0) as any as S.Schema, + output: __S(13, __c3, 1) as any as S.Schema, + errors: [UserNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetProfile", })); -export type ListUsersError = SlackOpError; -/** Lists all users in a Slack team. Required scopes -- bot: `users:read`; user: `users:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `limit_required` -- For large teams a limit is required. - `missing_argument` -- A required argument is missing. See https://docs.slack.dev/reference/methods/users.list */ +export type ListUsersError = InvalidCursor | LimitRequired | MissingArgument | SlackOpError; +/** Lists all users in a Slack team. Required scopes -- bot: `users:read`; user: `users:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `limit_required` -- For large teams a limit is required. - `missing_argument` -- A required argument is missing. See https://docs.slack.dev/reference/methods/users.list */ export const listUsers: API.PaginatedOperationMethod< ListUsersRequest, ListUsersResponse, @@ -250,9 +780,9 @@ export const listUsers: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(28, __c7, 0) as any as S.Schema, - output: __S(29, __c7, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(16, __c4, 0) as any as S.Schema, + output: __S(17, __c4, 1) as any as S.Schema, + errors: [InvalidCursor, LimitRequired, MissingArgument, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -268,34 +798,46 @@ export const listUsers: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type LookupByEmailError = SlackOpError; -/** Find a user with an email address. Required scopes -- bot: `users:read.email`; user: `users:read.email` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `enterprise_is_restricted` -- This method was called with an inappropriate enterprise-level token. - `users_not_found` -- Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/users.lookupByEmail */ +export type LookupByEmailError = EnterpriseIsRestricted | UsersNotFound | SlackOpError; +/** Find a user with an email address. Required scopes -- bot: `users:read.email`; user: `users:read.email` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `enterprise_is_restricted` -- This method was called with an inappropriate enterprise-level token. - `users_not_found` -- Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/users.lookupByEmail */ export const lookupByEmail: API.OperationMethod< LookupByEmailRequest, LookupByEmailResponse, LookupByEmailError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(40, __c10, 0) as any as S.Schema, - output: __S(41, __c10, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(28, __c7, 0) as any as S.Schema, + output: __S(29, __c7, 1) as any as S.Schema, + errors: [EnterpriseIsRestricted, UsersNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "LookupByEmail", })); -export type LookupDiscoverableContactError = SlackOpError; -/** Look up an email address to see if someone is discoverable on Slack Required scopes -- bot: `conversations.connect:manage`, `team:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_allowed` -- user is not allowed to call this API - `ratelimited` -- too many attempts - `invalid_arguments` -- Invalid arguments (including exceeding character count) - `restricted_action` -- user is restricted from calling this API - `not_an_enterprise` -- The token does not belong to an enterprise. See https://docs.slack.dev/reference/methods/users.discoverableContacts.lookup */ +export type LookupDiscoverableContactError = + | InvalidArguments + | NotAllowed + | NotAnEnterprise + | RestrictedAction + | SlackOpError; +/** Look up an email address to see if someone is discoverable on Slack Required scopes -- bot: `conversations.connect:manage`, `team:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `not_allowed` -- user is not allowed to call this API - `ratelimited` -- too many attempts - `invalid_arguments` -- Invalid arguments (including exceeding character count) - `restricted_action` -- user is restricted from calling this API - `not_an_enterprise` -- The token does not belong to an enterprise. See https://docs.slack.dev/reference/methods/users.discoverableContacts.lookup */ export const lookupDiscoverableContact: API.OperationMethod< LookupDiscoverableContactRequest, LookupDiscoverableContactResponse, LookupDiscoverableContactError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(44, __c11, 0) as any as S.Schema, - output: __S(45, __c11, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(32, __c8, 0) as any as S.Schema, + output: __S(33, __c8, 1) as any as S.Schema, + errors: [ + InvalidArguments, + NotAllowed, + NotAnEnterprise, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -310,7 +852,7 @@ export const setActive: API.OperationMethod< SetActiveError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(48, __c12, 0) as any as S.Schema, + input: __S(36, __c9, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, errors: [SlackError, SlackRateLimited], protocol: SlackProtocol, @@ -319,59 +861,106 @@ export const setActive: API.OperationMethod< span: "SetActive", })); -export type SetPhotoError = SlackOpError; -/** Set the user profile photo Required scopes -- user: `users.profile:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_image` -- The uploaded image could not be processed - try passing a JPEG, GIF or PNG - `internal_error` -- An unexpected error occurred. - `too_large` -- The uploaded image had excessive dimensions - `too_many_frames` -- An animated GIF with too many frames was uploaded See https://docs.slack.dev/reference/methods/users.setPhoto */ +export type SetPhotoError = BadImage | TooLarge | TooManyFrames | SlackOpError; +/** Set the user profile photo Required scopes -- user: `users.profile:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `bad_image` -- The uploaded image could not be processed - try passing a JPEG, GIF or PNG - `internal_error` -- An unexpected error occurred. - `too_large` -- The uploaded image had excessive dimensions - `too_many_frames` -- An animated GIF with too many frames was uploaded See https://docs.slack.dev/reference/methods/users.setPhoto */ export const setPhoto: API.OperationMethod< SetPhotoRequest, SetPhotoResponse, SetPhotoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(52, __c13, 0) as any as S.Schema, - output: __S(54, __c13, 2) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(40, __c10, 0) as any as S.Schema, + output: __S(42, __c10, 2) as any as S.Schema, + errors: [BadImage, TooLarge, TooManyFrames, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetPhoto", })); -export type SetPresenceError = SlackOpError; -/** Manually sets user presence. Required scopes -- bot: `users:write`; user: `users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_presence` -- Value passed for `presence` was invalid. See https://docs.slack.dev/reference/methods/users.setPresence */ +export type SetPresenceError = InvalidPresence | SlackOpError; +/** Manually sets user presence. Required scopes -- bot: `users:write`; user: `users:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `invalid_presence` -- Value passed for `presence` was invalid. See https://docs.slack.dev/reference/methods/users.setPresence */ export const setPresence: API.OperationMethod< SetPresenceRequest, SetPresenceResponse, SetPresenceError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(56, __c14, 0) as any as S.Schema, + input: __S(44, __c11, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [InvalidPresence, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetPresence", })); -export type SetProfileError = SlackOpError; -/** Set a user's profile information, including custom status. Required scopes -- user: `users.profile:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `cannot_update_admin_user` -- Only a primary owner can update the profile of an admin. - `email_taken` -- email taken - `invalid_profile` -- Profile object passed in is not valid JSON (make sure it is URL encoded!). - `must_clear_both_status_text_and_status_emoji` -- Clearing the status requires setting both `status_text` and `status_emoji` to ''. - `name_not_allowed` -- name cannot contain URL. - `not_admin` -- Only admins can update the profile of another user. Some fields, like `email` may only be updated by an admin. - `not_app_admin` -- Only team owners and selected members can update the profile of a bot user. - `partial_profile_set_failed` -- Failed to set user profile. - `profile_set_failed` -- Failed to set user profile. - `reserved_name` -- First or last name are reserved. - `sudo_required` -- Request requires sudo session. - `too_long` -- You attempted to set a custom status but it was longer than the maximum allowed, 100. - `permission_denied` -- Permission denied. - `username_same` -- Username is the same as the current username. - `invalid_emoji_not_allowed` -- Invalid emoji not allowed. - `invalid_ooo_message` -- Invalid Out of Office message. - `invalid_starts_with_at` -- Name cannot start with @. - `frontline_member_username_change_not_allowed` -- Frontline members cannot change their own username. Only an admin can change it. See https://docs.slack.dev/reference/methods/users.profile.set */ +export type SetProfileError = + | CannotUpdateAdminUser + | EmailTaken + | FrontlineMemberUsernameChangeNotAllowed + | InvalidEmojiNotAllowed + | InvalidOooMessage + | InvalidProfile + | InvalidStartsWithAt + | MustClearBothStatusTextAndStatusEmoji + | NameNotAllowed + | NotAdmin + | NotAppAdmin + | PartialProfileSetFailed + | PermissionDenied + | ProfileSetFailed + | ReservedName + | SudoRequired + | TooLong + | UsernameSame + | SlackOpError; +/** Set a user's profile information, including custom status. Required scopes -- user: `users.profile:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `cannot_update_admin_user` -- Only a primary owner can update the profile of an admin. - `email_taken` -- email taken - `invalid_profile` -- Profile object passed in is not valid JSON (make sure it is URL encoded!). - `must_clear_both_status_text_and_status_emoji` -- Clearing the status requires setting both `status_text` and `status_emoji` to ''. - `name_not_allowed` -- name cannot contain URL. - `not_admin` -- Only admins can update the profile of another user. Some fields, like `email` may only be updated by an admin. - `not_app_admin` -- Only team owners and selected members can update the profile of a bot user. - `partial_profile_set_failed` -- Failed to set user profile. - `profile_set_failed` -- Failed to set user profile. - `reserved_name` -- First or last name are reserved. - `sudo_required` -- Request requires sudo session. - `too_long` -- You attempted to set a custom status but it was longer than the maximum allowed, 100. - `permission_denied` -- Permission denied. - `username_same` -- Username is the same as the current username. - `invalid_emoji_not_allowed` -- Invalid emoji not allowed. - `invalid_ooo_message` -- Invalid Out of Office message. - `invalid_starts_with_at` -- Name cannot start with @. - `frontline_member_username_change_not_allowed` -- Frontline members cannot change their own username. Only an admin can change it. See https://docs.slack.dev/reference/methods/users.profile.set */ export const setProfile: API.OperationMethod< SetProfileRequest, SetProfileResponse, SetProfileError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(60, __c15, 0) as any as S.Schema, - output: __S(61, __c15, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(48, __c12, 0) as any as S.Schema, + output: __S(49, __c12, 1) as any as S.Schema, + errors: [ + CannotUpdateAdminUser, + EmailTaken, + FrontlineMemberUsernameChangeNotAllowed, + InvalidEmojiNotAllowed, + InvalidOooMessage, + InvalidProfile, + InvalidStartsWithAt, + MustClearBothStatusTextAndStatusEmoji, + NameNotAllowed, + NotAdmin, + NotAppAdmin, + PartialProfileSetFailed, + PermissionDenied, + ProfileSetFailed, + ReservedName, + SudoRequired, + TooLong, + UsernameSame, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetProfile", })); -export type UsersConversationsError = SlackOpError; -/** List conversations the calling user is a member of. Required scopes -- bot: `groups:read`, `im:read`, `mpim:read`, `channels:read`; user: `groups:read`, `im:read`, `mpim:read`, `channels:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_limit` -- Value passed for `limit` is not understood. - `invalid_types` -- Value passed for `type` could not be used based on the method's capabilities or the permission scopes granted to the used token. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_argument` -- A required argument is missing. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. See https://docs.slack.dev/reference/methods/users.conversations */ +export type UsersConversationsError = + | InvalidCursor + | InvalidLimit + | InvalidTypes + | MethodNotSupportedForChannelType + | MissingArgument + | MissingScope + | SlackOpError; +/** List conversations the calling user is a member of. Required scopes -- bot: `groups:read`, `im:read`, `mpim:read`, `channels:read`; user: `groups:read`, `im:read`, `mpim:read`, `channels:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_limit` -- Value passed for `limit` is not understood. - `invalid_types` -- Value passed for `type` could not be used based on the method's capabilities or the permission scopes granted to the used token. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_argument` -- A required argument is missing. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. See https://docs.slack.dev/reference/methods/users.conversations */ export const usersConversations: API.PaginatedOperationMethod< UsersConversationsRequest, UsersConversationsResponse, @@ -380,9 +969,18 @@ export const usersConversations: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(12, __c3, 0) as any as S.Schema, - output: __S(13, __c3, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(52, __c13, 0) as any as S.Schema, + output: __S(53, __c13, 1) as any as S.Schema, + errors: [ + InvalidCursor, + InvalidLimit, + InvalidTypes, + MethodNotSupportedForChannelType, + MissingArgument, + MissingScope, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -398,34 +996,34 @@ export const usersConversations: API.PaginatedOperationMethod< slackPaginate, ) as any; -export type UsersIdentityError = SlackOpError; -/** Get a user's identity. Required scopes -- user: `identity:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Internal error - `invalid_user_id` -- Invalid user id provided - `email_not_verified` -- user email has not been verified See https://docs.slack.dev/reference/methods/users.identity */ +export type UsersIdentityError = EmailNotVerified | InvalidUserId | SlackOpError; +/** Get a user's identity. Required scopes -- user: `identity:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `internal_error` -- Internal error - `invalid_user_id` -- Invalid user id provided - `email_not_verified` -- user email has not been verified See https://docs.slack.dev/reference/methods/users.identity */ export const usersIdentity: API.OperationMethod< UsersIdentityRequest, UsersIdentityResponse, UsersIdentityError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(16, __c4, 0) as any as S.Schema, + input: __S(56, __c14, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [EmailNotVerified, InvalidUserId, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UsersIdentity", })); -export type UsersInfoError = SlackOpError; -/** Gets information about a user. Required scopes -- bot: `users:read`; user: `users:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `too_many_users` -- Too many users. - `user_not_found` -- Value passed for `user` was invalid. - `user_not_visible` -- The requested user is not visible to the calling user See https://docs.slack.dev/reference/methods/users.info */ +export type UsersInfoError = TooManyUsers | UserNotFound | UserNotVisible | SlackOpError; +/** Gets information about a user. Required scopes -- bot: `users:read`; user: `users:read` Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `too_many_users` -- Too many users. - `user_not_found` -- Value passed for `user` was invalid. - `user_not_visible` -- The requested user is not visible to the calling user See https://docs.slack.dev/reference/methods/users.info */ export const usersInfo: API.OperationMethod< UsersInfoRequest, UsersInfoResponse, UsersInfoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(20, __c5, 0) as any as S.Schema, - output: __S(21, __c5, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + input: __S(60, __c15, 0) as any as S.Schema, + output: __S(61, __c15, 1) as any as S.Schema, + errors: [TooManyUsers, UserNotFound, UserNotVisible, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, @@ -474,57 +1072,6 @@ function __c2(j: number): any { } } function __c3(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - cursor: S.optional(S.String.pipe(T.Query())), - exclude_archived: S.optional(S.Boolean.pipe(T.Query())), - exclude_muted: S.optional(S.Boolean.pipe(T.Query())), - limit: S.optional(S.Number.pipe(T.Query())), - team_id: S.optional(S.String.pipe(T.Query())), - types: S.optional(S.String.pipe(T.Query())), - user: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/users.conversations", code: 200 })), - ).annotate({ identifier: "UsersConversationsRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - channels: __S(36, __c9, 0), - response_metadata: S.optional(__S(32, __c8, 0)), - }), - ).annotate({ identifier: "UsersConversationsResponse" }); - } -} -function __c4(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({}).pipe(T.Http({ method: "GET", uri: "/users.identity", code: 200 })), - ).annotate({ identifier: "UsersIdentityRequest" }); - } -} -function __c5(j: number): any { - switch (j) { - case 0: - return S.suspend(() => - S.Struct({ - include_locale: S.optional(S.Boolean.pipe(T.Query())), - user: S.optional(S.String.pipe(T.Query())), - }).pipe(T.Http({ method: "GET", uri: "/users.info", code: 200 })), - ).annotate({ identifier: "UsersInfoRequest" }); - case 1: - return S.suspend(() => - S.Struct({ - ok: S.Boolean, - user: S.optional(S.Unknown), - users: S.optional(__S(36, __c9, 0)), - }), - ).annotate({ identifier: "UsersInfoResponse" }); - } -} -function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -542,7 +1089,7 @@ function __c6(j: number): any { ).annotate({ identifier: "GetProfileResponse" }); } } -function __c7(j: number): any { +function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -557,15 +1104,15 @@ function __c7(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - members: __S(36, __c9, 0), + members: __S(24, __c6, 0), cache_ts: S.Number, - response_metadata: S.optional(__S(32, __c8, 0)), + response_metadata: S.optional(__S(20, __c5, 0)), offset: S.optional(S.String), }), ).annotate({ identifier: "ListUsersResponse" }); } } -function __c8(j: number): any { +function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -575,13 +1122,13 @@ function __c8(j: number): any { ).annotate({ identifier: "ListUsersResponseResponseMetadata" }); } } -function __c9(j: number): any { +function __c6(j: number): any { switch (j) { case 0: return S.Array(S.Unknown); } } -function __c10(j: number): any { +function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -598,7 +1145,7 @@ function __c10(j: number): any { ).annotate({ identifier: "LookupByEmailResponse" }); } } -function __c11(j: number): any { +function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -615,7 +1162,7 @@ function __c11(j: number): any { ).annotate({ identifier: "LookupDiscoverableContactResponse" }); } } -function __c12(j: number): any { +function __c9(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -623,7 +1170,7 @@ function __c12(j: number): any { ).annotate({ identifier: "SetActiveRequest" }); } } -function __c13(j: number): any { +function __c10(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -647,12 +1194,12 @@ function __c13(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - profile: __S(53, __c13, 1), + profile: __S(41, __c10, 1), }), ).annotate({ identifier: "SetPhotoResponse" }); } } -function __c14(j: number): any { +function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -662,7 +1209,7 @@ function __c14(j: number): any { ).annotate({ identifier: "SetPresenceRequest" }); } } -function __c15(j: number): any { +function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -684,6 +1231,57 @@ function __c15(j: number): any { ).annotate({ identifier: "SetProfileResponse" }); } } +function __c13(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + cursor: S.optional(S.String.pipe(T.Query())), + exclude_archived: S.optional(S.Boolean.pipe(T.Query())), + exclude_muted: S.optional(S.Boolean.pipe(T.Query())), + limit: S.optional(S.Number.pipe(T.Query())), + team_id: S.optional(S.String.pipe(T.Query())), + types: S.optional(S.String.pipe(T.Query())), + user: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/users.conversations", code: 200 })), + ).annotate({ identifier: "UsersConversationsRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + channels: __S(24, __c6, 0), + response_metadata: S.optional(__S(20, __c5, 0)), + }), + ).annotate({ identifier: "UsersConversationsResponse" }); + } +} +function __c14(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({}).pipe(T.Http({ method: "GET", uri: "/users.identity", code: 200 })), + ).annotate({ identifier: "UsersIdentityRequest" }); + } +} +function __c15(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + include_locale: S.optional(S.Boolean.pipe(T.Query())), + user: S.optional(S.String.pipe(T.Query())), + }).pipe(T.Http({ method: "GET", uri: "/users.info", code: 200 })), + ).annotate({ identifier: "UsersInfoRequest" }); + case 1: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + user: S.optional(S.Unknown), + users: S.optional(__S(24, __c6, 0)), + }), + ).annotate({ identifier: "UsersInfoResponse" }); + } +} // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); diff --git a/packages/slack/src/services/views.ts b/packages/slack/src/services/views.ts index 69fe3a6f61..cd0b1af3da 100644 --- a/packages/slack/src/services/views.ts +++ b/packages/slack/src/services/views.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,162 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `duplicate_external_id` -- Error returned when the given `external_id` has already be used. */ +export class DuplicateExternalId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("DuplicateExternalId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "duplicate_external_id" } }], + ) {} + +/** `exchanged_trigger_id` -- The trigger_id was already exchanged in a previous call. */ +export class ExchangedTriggerId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExchangedTriggerId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "exchanged_trigger_id" } }], + ) {} + +/** `expired_trigger_id` -- The trigger_id is expired. */ +export class ExpiredTriggerId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExpiredTriggerId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "expired_trigger_id" } }], + ) {} + +/** `hash_conflict` -- Error returned when the provided `hash` doesn't match the current stored value. */ +export class HashConflict + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("HashConflict", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "hash_conflict" } }], + ) {} + +/** `invalid_trigger_id` -- The trigger_id is invalid. The expected format for the trigger_id argument is "132456.7890123.abcdef". */ +export class InvalidTriggerId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidTriggerId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_trigger_id" } }], + ) {} + +/** `missing_profile_id` -- A profile id was not provided when trying to publish a view of type profile. */ +export class MissingProfileId + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MissingProfileId", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "missing_profile_id" } }], + ) {} + +/** `not_allowed_token_type` -- The type of token your app used when requesting this method is not allowed. */ +export class NotAllowedTokenType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotAllowedTokenType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_allowed_token_type" } }], + ) {} + +/** `not_enabled` -- Error returned if a `home` view is published but the Home tab isn't enabled for the app. */ +export class NotEnabled + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotEnabled", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_enabled" } }], + ) {} + +/** `not_found` -- Error returned when the requested view can't be found. */ +export class NotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "not_found" } }], + ) {} + +/** `not_implemented` -- The profile view experiment is not enabled for this user. */ +export class NotImplemented + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NotImplemented", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "not_implemented" } }], + ) {} + +/** `push_limit_reached` -- Error returned when the max push limit has been reached for views. Currently the limit is 3. */ +export class PushLimitReached + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("PushLimitReached", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "push_limit_reached" } }], + ) {} + +/** `view_too_large` -- Error returned if the provided view is greater than 250kb. */ +export class ViewTooLarge + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ViewTooLarge", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "view_too_large" } }], + ) {} + export interface PublishViewRequest { /** `id` of the user you want publish a view to. */ user_id: string; @@ -80,8 +237,16 @@ export interface ViewsPushResponse { ok: boolean; view: unknown; } -export type PublishViewError = SlackOpError; -/** Publish a static view for a User. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `hash_conflict` -- Error returned when the provided `hash` doesn't match the current stored value. - `missing_profile_id` -- A profile id was not provided when trying to publish a view of type profile. - `not_allowed_token_type` -- The type of token your app used when requesting this method is not allowed. - `not_enabled` -- Error returned if a `home` view is published but the Home tab isn't enabled for the app. - `not_implemented` -- The profile view experiment is not enabled for this user. - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.publish */ +export type PublishViewError = + | DuplicateExternalId + | HashConflict + | MissingProfileId + | NotAllowedTokenType + | NotEnabled + | NotImplemented + | ViewTooLarge + | SlackOpError; +/** Publish a static view for a User. Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `hash_conflict` -- Error returned when the provided `hash` doesn't match the current stored value. - `missing_profile_id` -- A profile id was not provided when trying to publish a view of type profile. - `not_allowed_token_type` -- The type of token your app used when requesting this method is not allowed. - `not_enabled` -- Error returned if a `home` view is published but the Home tab isn't enabled for the app. - `not_implemented` -- The profile view experiment is not enabled for this user. - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.publish */ export const publishView: API.OperationMethod< PublishViewRequest, PublishViewResponse, @@ -90,15 +255,30 @@ export const publishView: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + DuplicateExternalId, + HashConflict, + MissingProfileId, + NotAllowedTokenType, + NotEnabled, + NotImplemented, + ViewTooLarge, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PublishView", })); -export type UpdateViewError = SlackOpError; -/** Update an existing view. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `hash_conflict` -- Error returned when the provided `hash` doesn't match the current stored value. - `not_found` -- Error returned when the given `view_id` or `external_id` doesn't exist. - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.update */ +export type UpdateViewError = + | DuplicateExternalId + | HashConflict + | NotFound + | ViewTooLarge + | SlackOpError; +/** Update an existing view. Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `hash_conflict` -- Error returned when the provided `hash` doesn't match the current stored value. - `not_found` -- Error returned when the given `view_id` or `external_id` doesn't exist. - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.update */ export const updateView: API.OperationMethod< UpdateViewRequest, UpdateViewResponse, @@ -107,15 +287,21 @@ export const updateView: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(4, __c2, 0) as any as S.Schema, output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [DuplicateExternalId, HashConflict, NotFound, ViewTooLarge, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateView", })); -export type ViewsOpenError = SlackOpError; -/** Open a view for a user. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `exchanged_trigger_id` -- The trigger_id was already exchanged in a previous call. - `expired_trigger_id` -- The trigger_id is expired. - `invalid_trigger_id` -- The trigger_id is invalid. The expected format for the trigger_id argument is "132456.7890123.abcdef". - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.open */ +export type ViewsOpenError = + | DuplicateExternalId + | ExchangedTriggerId + | ExpiredTriggerId + | InvalidTriggerId + | ViewTooLarge + | SlackOpError; +/** Open a view for a user. Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `exchanged_trigger_id` -- The trigger_id was already exchanged in a previous call. - `expired_trigger_id` -- The trigger_id is expired. - `invalid_trigger_id` -- The trigger_id is invalid. The expected format for the trigger_id argument is "132456.7890123.abcdef". - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.open */ export const viewsOpen: API.OperationMethod< ViewsOpenRequest, ViewsOpenResponse, @@ -124,15 +310,31 @@ export const viewsOpen: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(7, __c3, 1) as any as S.Schema, output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + DuplicateExternalId, + ExchangedTriggerId, + ExpiredTriggerId, + InvalidTriggerId, + ViewTooLarge, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ViewsOpen", })); -export type ViewsPushError = SlackOpError; -/** Push a view onto the stack of a root view. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `exchanged_trigger_id` -- The trigger_id was already exchanged in a previous call. - `expired_trigger_id` -- The trigger_id is expired. - `invalid_trigger_id` -- The trigger_id is invalid. The expected format for the trigger_id argument is "132456.7890123.abcdef". - `not_found` -- Error returned when the requested view can't be found. - `push_limit_reached` -- Error returned when the max push limit has been reached for views. Currently the limit is 3. - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.push */ +export type ViewsPushError = + | DuplicateExternalId + | ExchangedTriggerId + | ExpiredTriggerId + | InvalidTriggerId + | NotFound + | PushLimitReached + | ViewTooLarge + | SlackOpError; +/** Push a view onto the stack of a root view. Rate limit tier: 4 Method-specific errors (each a typed error named after its slug): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `exchanged_trigger_id` -- The trigger_id was already exchanged in a previous call. - `expired_trigger_id` -- The trigger_id is expired. - `invalid_trigger_id` -- The trigger_id is invalid. The expected format for the trigger_id argument is "132456.7890123.abcdef". - `not_found` -- Error returned when the requested view can't be found. - `push_limit_reached` -- Error returned when the max push limit has been reached for views. Currently the limit is 3. - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.push */ export const viewsPush: API.OperationMethod< ViewsPushRequest, ViewsPushResponse, @@ -141,7 +343,17 @@ export const viewsPush: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c4, 0) as any as S.Schema, output: __S(2, __c1, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + DuplicateExternalId, + ExchangedTriggerId, + ExpiredTriggerId, + InvalidTriggerId, + NotFound, + PushLimitReached, + ViewTooLarge, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, diff --git a/packages/slack/src/services/workflows.ts b/packages/slack/src/services/workflows.ts index de8b6c6e13..bd961b063a 100644 --- a/packages/slack/src/services/workflows.ts +++ b/packages/slack/src/services/workflows.ts @@ -1,4 +1,5 @@ import * as API from "@distilled.cloud/core/api"; +import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; @@ -24,6 +25,292 @@ const TELEMETRY = { propagate: "w3c", } as const; +/** `access_denied` -- This actor does not have access to the permissions on this resource. */ +export class AccessDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("AccessDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "access_denied" } }], + ) {} + +/** `channel_not_found` -- Channel not found. */ +export class ChannelNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ChannelNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "channel_not_found" } }], + ) {} + +/** `connected_org_denied` -- The workspace admin does not allow connected organizations to be named_entities. */ +export class ConnectedOrgDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ConnectedOrgDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "connected_org_denied" } }], + ) {} + +/** `connected_team_denied` -- The workspace admin does not allow connected teams to be named_entities. */ +export class ConnectedTeamDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ConnectedTeamDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "connected_team_denied" } }], + ) {} + +/** `connected_user_denied` -- The workspace admin does not allow connected users to be named_entities. */ +export class ConnectedUserDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ConnectedUserDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "connected_user_denied" } }], + ) {} + +/** `error_invalid_channels` -- Invalid channels provided. */ +export class ErrorInvalidChannels + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorInvalidChannels", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_invalid_channels" } }], + ) {} + +/** `error_modifying_workflows` -- Error modifying workflows */ +export class ErrorModifyingWorkflows + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ErrorModifyingWorkflows", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "error_modifying_workflows" } }], + ) {} + +/** `external_workspace_denied` -- The channel selected is not on the workflow team. */ +export class ExternalWorkspaceDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("ExternalWorkspaceDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "external_workspace_denied" } }], + ) {} + +/** `invalid_permission_type` -- This trigger requires permission_type to be set as named_entities before adding users. */ +export class InvalidPermissionType + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("InvalidPermissionType", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "invalid_permission_type" } }], + ) {} + +/** `method_not_supported` -- Method not yet supported */ +export class MethodNotSupported + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("MethodNotSupported", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "method_not_supported" } }], + ) {} + +/** `named_entities_cannot_be_empty` -- There must be at least one valid named entity */ +export class NamedEntitiesCannotBeEmpty + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NamedEntitiesCannotBeEmpty", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "named_entities_cannot_be_empty" } }], + ) {} + +/** `no_valid_named_entities` -- None of the provided named entities were valid */ +export class NoValidNamedEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("NoValidNamedEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "no_valid_named_entities" } }], + ) {} + +/** `org_not_connected` -- One of more of the listed organizations were not connected. */ +export class OrgNotConnected + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OrgNotConnected", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "org_not_connected" } }], + ) {} + +/** `org_not_found` -- One or more of the listed organizations could not be found. */ +export class OrgNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("OrgNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "org_not_found" } }], + ) {} + +/** `restricted_action` -- User does not have access to this method. */ +export class RestrictedAction + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("RestrictedAction", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "restricted_action" } }], + ) {} + +/** `shared_channel_denied` -- The workspace admin does not allow shared channels to be named_entities. */ +export class SharedChannelDenied + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("SharedChannelDenied", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "shared_channel_denied" } }], + ) {} + +/** `team_not_connected` -- One of more of the listed teams were not connected by org. */ +export class TeamNotConnected + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamNotConnected", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "team_not_connected" } }], + ) {} + +/** `team_not_found` -- One or more of the listed teams could not be found. */ +export class TeamNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TeamNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "team_not_found" } }], + ) {} + +/** `too_many_named_entities` -- Too many named entities passed into the trigger permissions setting. */ +export class TooManyNamedEntities + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TooManyNamedEntities", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "too_many_named_entities" } }], + ) {} + +/** `trigger_not_found` -- This trigger does not exist. */ +export class TriggerNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("TriggerNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "trigger_not_found" } }], + ) {} + +/** `unknown_method` -- This method does not exist. */ +export class UnknownMethod + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UnknownMethod", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }), + [{ body: { "/error": "unknown_method" } }], + ) {} + +/** `user_not_found` -- One or more of the listed users could not be found. */ +export class UserNotFound + extends /*@__PURE__*/ T.applyErrorMatchers( + /*@__PURE__*/ S.TaggedError()("UserNotFound", { + message: S.String, + needed: /*@__PURE__*/ S.optional(S.String), + provided: /*@__PURE__*/ S.optional(S.String), + body: /*@__PURE__*/ S.optional(S.Unknown), + headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), + }).pipe(C.withNotFoundError), + [{ body: { "/error": "user_not_found" } }], + ) {} + /** Comma-separated array of trigger IDs to add; max 15 */ export type AddFeaturedRequestTriggerIdsList = Array; export interface AddFeaturedRequest { @@ -192,8 +479,12 @@ export interface SetTriggersPermissionsResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } -export type AddFeaturedError = SlackOpError; -/** Add featured workflows to a channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `method_not_supported` -- Method not yet supported - `restricted_action` -- User does not have access to this method. - `error_modifying_workflows` -- Error modifying workflows See https://docs.slack.dev/reference/methods/workflows.featured.add */ +export type AddFeaturedError = + | ErrorModifyingWorkflows + | MethodNotSupported + | RestrictedAction + | SlackOpError; +/** Add featured workflows to a channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `method_not_supported` -- Method not yet supported - `restricted_action` -- User does not have access to this method. - `error_modifying_workflows` -- Error modifying workflows See https://docs.slack.dev/reference/methods/workflows.featured.add */ export const addFeatured: API.OperationMethod< AddFeaturedRequest, AddFeaturedResponse, @@ -202,15 +493,38 @@ export const addFeatured: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(16, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ErrorModifyingWorkflows, + MethodNotSupported, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddFeatured", })); -export type AddTriggersPermissionsError = SlackOpError; -/** Allows users to run a trigger that has its permission type set to named_entities Required scopes -- bot: `triggers:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- This actor does not have access to the permissions on this resource. - `channel_not_found` -- One or more of the listed channels could not be found. - `connected_org_denied` -- The workspace admin does not allow connected organizations to be named_entities. - `connected_team_denied` -- The workspace admin does not allow connected teams to be named_entities. - `connected_user_denied` -- The workspace admin does not allow connected users to be named_entities. - `invalid_permission_type` -- This trigger requires permission_type to be set as named_entities before adding users. - `no_valid_named_entities` -- None of the provided named entities were valid - `org_not_connected` -- One of more of the listed organizations were not connected. - `org_not_found` -- One or more of the listed organizations could not be found. - `shared_channel_denied` -- The workspace admin does not allow shared channels to be named_entities. - `team_not_connected` -- One of more of the listed teams were not connected by org. - `team_not_found` -- One or more of the listed teams could not be found. - `too_many_named_entities` -- Too many named entities passed into the trigger permissions setting. - `trigger_not_found` -- This trigger does not exist. - `unknown_method` -- This method does not exist. - `user_not_found` -- One or more of the listed users could not be found. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.add */ +export type AddTriggersPermissionsError = + | AccessDenied + | ChannelNotFound + | ConnectedOrgDenied + | ConnectedTeamDenied + | ConnectedUserDenied + | InvalidPermissionType + | NoValidNamedEntities + | OrgNotConnected + | OrgNotFound + | SharedChannelDenied + | TeamNotConnected + | TeamNotFound + | TooManyNamedEntities + | TriggerNotFound + | UnknownMethod + | UserNotFound + | SlackOpError; +/** Allows users to run a trigger that has its permission type set to named_entities Required scopes -- bot: `triggers:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `access_denied` -- This actor does not have access to the permissions on this resource. - `channel_not_found` -- One or more of the listed channels could not be found. - `connected_org_denied` -- The workspace admin does not allow connected organizations to be named_entities. - `connected_team_denied` -- The workspace admin does not allow connected teams to be named_entities. - `connected_user_denied` -- The workspace admin does not allow connected users to be named_entities. - `invalid_permission_type` -- This trigger requires permission_type to be set as named_entities before adding users. - `no_valid_named_entities` -- None of the provided named entities were valid - `org_not_connected` -- One of more of the listed organizations were not connected. - `org_not_found` -- One or more of the listed organizations could not be found. - `shared_channel_denied` -- The workspace admin does not allow shared channels to be named_entities. - `team_not_connected` -- One of more of the listed teams were not connected by org. - `team_not_found` -- One or more of the listed teams could not be found. - `too_many_named_entities` -- Too many named entities passed into the trigger permissions setting. - `trigger_not_found` -- This trigger does not exist. - `unknown_method` -- This method does not exist. - `user_not_found` -- One or more of the listed users could not be found. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.add */ export const addTriggersPermissions: API.OperationMethod< AddTriggersPermissionsRequest, AddTriggersPermissionsResponse, @@ -219,15 +533,39 @@ export const addTriggersPermissions: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c3, 0) as any as S.Schema, output: __S(16, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + ChannelNotFound, + ConnectedOrgDenied, + ConnectedTeamDenied, + ConnectedUserDenied, + InvalidPermissionType, + NoValidNamedEntities, + OrgNotConnected, + OrgNotFound, + SharedChannelDenied, + TeamNotConnected, + TeamNotFound, + TooManyNamedEntities, + TriggerNotFound, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "AddTriggersPermissions", })); -export type ListFeaturedError = SlackOpError; -/** List the featured workflows for specified channels. Required scopes -- bot: `bookmarks:read`; user: `bookmarks:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `method_not_supported` -- Method not yet supported - `restricted_action` -- User does not have access to this method. - `channel_not_found` -- Channel not found. - `error_invalid_channels` -- Invalid channels provided. See https://docs.slack.dev/reference/methods/workflows.featured.list */ +export type ListFeaturedError = + | ChannelNotFound + | ErrorInvalidChannels + | MethodNotSupported + | RestrictedAction + | SlackOpError; +/** List the featured workflows for specified channels. Required scopes -- bot: `bookmarks:read`; user: `bookmarks:read` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `method_not_supported` -- Method not yet supported - `restricted_action` -- User does not have access to this method. - `channel_not_found` -- Channel not found. - `error_invalid_channels` -- Invalid channels provided. See https://docs.slack.dev/reference/methods/workflows.featured.list */ export const listFeatured: API.OperationMethod< ListFeaturedRequest, ListFeaturedResponse, @@ -236,15 +574,26 @@ export const listFeatured: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c4, 0) as any as S.Schema, output: __S(37, __c4, 5) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ChannelNotFound, + ErrorInvalidChannels, + MethodNotSupported, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListFeatured", })); -export type ListTriggersPermissionsError = SlackOpError; -/** Returns the permission type of a trigger and if applicable, includes the entities that have been granted access Required scopes -- bot: `triggers:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the permissions on this resource. - `trigger_not_found` -- This trigger does not exist. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.list */ +export type ListTriggersPermissionsError = + | AccessDenied + | TriggerNotFound + | UnknownMethod + | SlackOpError; +/** Returns the permission type of a trigger and if applicable, includes the entities that have been granted access Required scopes -- bot: `triggers:read` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `unknown_method` -- This method does not exist. - `access_denied` -- This actor does not have access to the permissions on this resource. - `trigger_not_found` -- This trigger does not exist. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.list */ export const listTriggersPermissions: API.OperationMethod< ListTriggersPermissionsRequest, ListTriggersPermissionsResponse, @@ -253,15 +602,19 @@ export const listTriggersPermissions: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(40, __c5, 0) as any as S.Schema, output: __S(16, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [AccessDenied, TriggerNotFound, UnknownMethod, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListTriggersPermissions", })); -export type RemoveFeaturedError = SlackOpError; -/** Remove featured workflows from a channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `method_not_supported` -- Method not yet supported - `restricted_action` -- User does not have access to this method. - `error_modifying_workflows` -- Error modifying workflows See https://docs.slack.dev/reference/methods/workflows.featured.remove */ +export type RemoveFeaturedError = + | ErrorModifyingWorkflows + | MethodNotSupported + | RestrictedAction + | SlackOpError; +/** Remove featured workflows from a channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `method_not_supported` -- Method not yet supported - `restricted_action` -- User does not have access to this method. - `error_modifying_workflows` -- Error modifying workflows See https://docs.slack.dev/reference/methods/workflows.featured.remove */ export const removeFeatured: API.OperationMethod< RemoveFeaturedRequest, RemoveFeaturedResponse, @@ -270,15 +623,34 @@ export const removeFeatured: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c6, 0) as any as S.Schema, output: __S(16, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ErrorModifyingWorkflows, + MethodNotSupported, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveFeatured", })); -export type RemoveTriggersPermissionsError = SlackOpError; -/** Revoke an entity's access to a trigger that has its permission type set to named_entities Required scopes -- bot: `triggers:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- This actor does not have access to the permissions on this resource. - `connected_org_denied` -- The workspace admin does not allow connected organizations to be named_entities. - `connected_team_denied` -- The workspace admin does not allow connected teams to be named_entities. - `connected_user_denied` -- The workspace admin does not allow connected users to be named_entities. - `named_entities_cannot_be_empty` -- There must be at least one valid named entity - `org_not_connected` -- One of more of the listed organizations were not connected. - `org_not_found` -- One or more of the listed organizations could not be found. - `shared_channel_denied` -- The workspace admin does not allow shared channels to be named_entities. - `trigger_not_found` -- This trigger does not exist. - `invalid_permission_type` -- This trigger requires permission_type to be set as named_entities before adding users. - `too_many_named_entities` -- Too many named entities passed into the trigger permissions setting. - `unknown_method` -- This method does not exist. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.remove */ +export type RemoveTriggersPermissionsError = + | AccessDenied + | ConnectedOrgDenied + | ConnectedTeamDenied + | ConnectedUserDenied + | InvalidPermissionType + | NamedEntitiesCannotBeEmpty + | OrgNotConnected + | OrgNotFound + | SharedChannelDenied + | TooManyNamedEntities + | TriggerNotFound + | UnknownMethod + | SlackOpError; +/** Revoke an entity's access to a trigger that has its permission type set to named_entities Required scopes -- bot: `triggers:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `access_denied` -- This actor does not have access to the permissions on this resource. - `connected_org_denied` -- The workspace admin does not allow connected organizations to be named_entities. - `connected_team_denied` -- The workspace admin does not allow connected teams to be named_entities. - `connected_user_denied` -- The workspace admin does not allow connected users to be named_entities. - `named_entities_cannot_be_empty` -- There must be at least one valid named entity - `org_not_connected` -- One of more of the listed organizations were not connected. - `org_not_found` -- One or more of the listed organizations could not be found. - `shared_channel_denied` -- The workspace admin does not allow shared channels to be named_entities. - `trigger_not_found` -- This trigger does not exist. - `invalid_permission_type` -- This trigger requires permission_type to be set as named_entities before adding users. - `too_many_named_entities` -- Too many named entities passed into the trigger permissions setting. - `unknown_method` -- This method does not exist. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.remove */ export const removeTriggersPermissions: API.OperationMethod< RemoveTriggersPermissionsRequest, RemoveTriggersPermissionsResponse, @@ -287,15 +659,34 @@ export const removeTriggersPermissions: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(56, __c7, 0) as any as S.Schema, output: __S(57, __c7, 1) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + ConnectedOrgDenied, + ConnectedTeamDenied, + ConnectedUserDenied, + InvalidPermissionType, + NamedEntitiesCannotBeEmpty, + OrgNotConnected, + OrgNotFound, + SharedChannelDenied, + TooManyNamedEntities, + TriggerNotFound, + UnknownMethod, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RemoveTriggersPermissions", })); -export type SetFeaturedError = SlackOpError; -/** Set featured workflows for a channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `method_not_supported` -- Method not yet supported - `restricted_action` -- User does not have access to this method. - `error_modifying_workflows` -- Error modifying workflows See https://docs.slack.dev/reference/methods/workflows.featured.set */ +export type SetFeaturedError = + | ErrorModifyingWorkflows + | MethodNotSupported + | RestrictedAction + | SlackOpError; +/** Set featured workflows for a channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (each a typed error named after its slug): - `method_not_supported` -- Method not yet supported - `restricted_action` -- User does not have access to this method. - `error_modifying_workflows` -- Error modifying workflows See https://docs.slack.dev/reference/methods/workflows.featured.set */ export const setFeatured: API.OperationMethod< SetFeaturedRequest, SetFeaturedResponse, @@ -304,15 +695,40 @@ export const setFeatured: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(64, __c8, 0) as any as S.Schema, output: __S(16, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + ErrorModifyingWorkflows, + MethodNotSupported, + RestrictedAction, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SetFeatured", })); -export type SetTriggersPermissionsError = SlackOpError; -/** Set the permission type for who can run a trigger Required scopes -- bot: `triggers:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- This actor does not have access to the permissions on this resource. - `channel_not_found` -- One or more of the listed channels could not be found. - `connected_org_denied` -- The workspace admin does not allow connected organizations to be named_entities. - `connected_team_denied` -- The workspace admin does not allow connected teams to be named_entities. - `connected_user_denied` -- The workspace admin does not allow connected users to be named_entities. - `external_workspace_denied` -- The channel selected is not on the workflow team. - `invalid_permission_type` -- This function requires permission_type to be set as named_entities before adding users. - `named_entities_cannot_be_empty` -- Must pass at least one valid named entity. - `no_valid_named_entities` -- None of the provided named entities were valid - `org_not_found` -- One or more of the listed organizations could not be found. - `org_not_connected` -- One of more of the listed organizations were not connected. - `shared_channel_denied` -- The workspace admin does not allow shared channels to be named_entities. - `team_not_connected` -- One of more of the listed teams were not connected by org. - `team_not_found` -- One or more of the listed teams could not be found. - `too_many_named_entities` -- Too many named_entities passed into the trigger permissions setting. - `trigger_not_found` -- This trigger does not exist. - `unknown_method` -- This method does not exist. - `user_not_found` -- One or more of the listed users could not be found. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.set */ +export type SetTriggersPermissionsError = + | AccessDenied + | ChannelNotFound + | ConnectedOrgDenied + | ConnectedTeamDenied + | ConnectedUserDenied + | ExternalWorkspaceDenied + | InvalidPermissionType + | NamedEntitiesCannotBeEmpty + | NoValidNamedEntities + | OrgNotConnected + | OrgNotFound + | SharedChannelDenied + | TeamNotConnected + | TeamNotFound + | TooManyNamedEntities + | TriggerNotFound + | UnknownMethod + | UserNotFound + | SlackOpError; +/** Set the permission type for who can run a trigger Required scopes -- bot: `triggers:write` Rate limit tier: 3 Method-specific errors (each a typed error named after its slug): - `access_denied` -- This actor does not have access to the permissions on this resource. - `channel_not_found` -- One or more of the listed channels could not be found. - `connected_org_denied` -- The workspace admin does not allow connected organizations to be named_entities. - `connected_team_denied` -- The workspace admin does not allow connected teams to be named_entities. - `connected_user_denied` -- The workspace admin does not allow connected users to be named_entities. - `external_workspace_denied` -- The channel selected is not on the workflow team. - `invalid_permission_type` -- This function requires permission_type to be set as named_entities before adding users. - `named_entities_cannot_be_empty` -- Must pass at least one valid named entity. - `no_valid_named_entities` -- None of the provided named entities were valid - `org_not_found` -- One or more of the listed organizations could not be found. - `org_not_connected` -- One of more of the listed organizations were not connected. - `shared_channel_denied` -- The workspace admin does not allow shared channels to be named_entities. - `team_not_connected` -- One of more of the listed teams were not connected by org. - `team_not_found` -- One or more of the listed teams could not be found. - `too_many_named_entities` -- Too many named_entities passed into the trigger permissions setting. - `trigger_not_found` -- This trigger does not exist. - `unknown_method` -- This method does not exist. - `user_not_found` -- One or more of the listed users could not be found. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.set */ export const setTriggersPermissions: API.OperationMethod< SetTriggersPermissionsRequest, SetTriggersPermissionsResponse, @@ -321,7 +737,28 @@ export const setTriggersPermissions: API.OperationMethod< > = /*@__PURE__*/ API.make(() => ({ input: __S(72, __c9, 0) as any as S.Schema, output: __S(16, __c2, 0) as any as S.Schema, - errors: [SlackError, SlackRateLimited], + errors: [ + AccessDenied, + ChannelNotFound, + ConnectedOrgDenied, + ConnectedTeamDenied, + ConnectedUserDenied, + ExternalWorkspaceDenied, + InvalidPermissionType, + NamedEntitiesCannotBeEmpty, + NoValidNamedEntities, + OrgNotConnected, + OrgNotFound, + SharedChannelDenied, + TeamNotConnected, + TeamNotFound, + TooManyNamedEntities, + TriggerNotFound, + UnknownMethod, + UserNotFound, + SlackError, + SlackRateLimited, + ], protocol: SlackProtocol, retry: Retry.Retry, telemetry: TELEMETRY, From 140e5a4a81981bc6145fc84f7fb8de416b0f6cbe Mon Sep 17 00:00:00 2001 From: Sam Goodwin Date: Fri, 20 Nov 2026 23:29:28 -0800 Subject: [PATCH 2/6] fix(slack): redact the rotated config token and the app verification token --- .../create-manifest-verification-token-sensitive.json | 10 ++++++++++ .../slack/patches/tooling/rotate-token-sensitive.json | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 packages/slack/patches/apps/create-manifest-verification-token-sensitive.json create mode 100644 packages/slack/patches/tooling/rotate-token-sensitive.json diff --git a/packages/slack/patches/apps/create-manifest-verification-token-sensitive.json b/packages/slack/patches/apps/create-manifest-verification-token-sensitive.json new file mode 100644 index 0000000000..85eafdac19 --- /dev/null +++ b/packages/slack/patches/apps/create-manifest-verification-token-sensitive.json @@ -0,0 +1,10 @@ +{ + "description": "apps.manifest.create returns the new app's `verification_token`, the legacy shared secret Slack sends with every Events API and interactivity request. Mark it sensitive like `client_secret` and `signing_secret` beside it. See https://docs.slack.dev/authentication/verifying-requests-from-slack#deprecation", + "patches": [ + { + "op": "add", + "path": "/shapes/com.slack.apps#ManifestCreateResponseCredentials/members/verification_token/traits", + "value": { "smithy.api#sensitive": {} } + } + ] +} diff --git a/packages/slack/patches/tooling/rotate-token-sensitive.json b/packages/slack/patches/tooling/rotate-token-sensitive.json new file mode 100644 index 0000000000..c45b830fbf --- /dev/null +++ b/packages/slack/patches/tooling/rotate-token-sensitive.json @@ -0,0 +1,10 @@ +{ + "description": "tooling.tokens.rotate returns a fresh app configuration token (`token`, an `xoxe.xoxp-` credential that authorizes the App Manifest API). Mark it sensitive like the `refresh_token` beside it, so it is Redacted on decode. See https://docs.slack.dev/app-manifests/configuring-apps-with-app-manifests#config-tokens", + "patches": [ + { + "op": "add", + "path": "/shapes/com.slack.tooling#TokensRotateResponse/members/token/traits/smithy.api#sensitive", + "value": {} + } + ] +} From 0d88b7bea8ffbcc778a202eaeebcd25e507b9a06 Mon Sep 17 00:00:00 2001 From: Sam Goodwin Date: Fri, 20 Nov 2026 23:32:37 -0800 Subject: [PATCH 3/6] fix(slack): model the conversation, usergroup, bookmark and canvas content objects --- .../patches/bookmarks/bookmark-object.json | 87 +++++ .../patches/canvases/canvas-content.json | 78 +++++ .../patches/conversations/canvas-content.json | 36 +++ .../conversations/conversation-object.json | 205 ++++++++++++ .../patches/usergroups/usergroup-object.json | 162 ++++++++++ packages/slack/src/services/bookmarks.ts | 72 ++++- packages/slack/src/services/canvases.ts | 66 +++- packages/slack/src/services/conversations.ts | 299 ++++++++++++------ packages/slack/src/services/usergroups.ts | 155 ++++++--- 9 files changed, 999 insertions(+), 161 deletions(-) create mode 100644 packages/slack/patches/bookmarks/bookmark-object.json create mode 100644 packages/slack/patches/canvases/canvas-content.json create mode 100644 packages/slack/patches/conversations/canvas-content.json create mode 100644 packages/slack/patches/conversations/conversation-object.json create mode 100644 packages/slack/patches/usergroups/usergroup-object.json diff --git a/packages/slack/patches/bookmarks/bookmark-object.json b/packages/slack/patches/bookmarks/bookmark-object.json new file mode 100644 index 0000000000..2c45cec760 --- /dev/null +++ b/packages/slack/patches/bookmarks/bookmark-object.json @@ -0,0 +1,87 @@ +{ + "description": "The docs reference the bookmark object as `{ \"schema\": \"bookmark\" }`, which has no JSON twin, so bookmarks.add/.edit/.list converted it as an untyped Document. Model the fields the bookmarks.list example documents.", + "patches": [ + { + "op": "add", + "path": "/shapes/com.slack.bookmarks#Bookmark", + "value": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Bookmark ID (`Bk\u2026`).", + "smithy.api#required": {} + } + }, + "channel_id": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + }, + "link": { + "target": "smithy.api#String" + }, + "emoji": { + "target": "smithy.api#String" + }, + "icon_url": { + "target": "smithy.api#String" + }, + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "`link`, or a folder/file entity type." + } + }, + "entity_id": { + "target": "smithy.api#String" + }, + "date_created": { + "target": "smithy.api#Long" + }, + "date_updated": { + "target": "smithy.api#Long" + }, + "rank": { + "target": "smithy.api#String" + }, + "last_updated_by_user_id": { + "target": "smithy.api#String" + }, + "last_updated_by_team_id": { + "target": "smithy.api#String" + }, + "shortcut_id": { + "target": "smithy.api#String" + }, + "app_id": { + "target": "smithy.api#String" + }, + "parent_id": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "A channel bookmark. See https://docs.slack.dev/reference/methods/bookmarks.list" + } + } + }, + { + "op": "replace", + "path": "/shapes/com.slack.bookmarks#BookmarksAddResponse/members/bookmark/target", + "value": "com.slack.bookmarks#Bookmark" + }, + { + "op": "replace", + "path": "/shapes/com.slack.bookmarks#BookmarksEditResponse/members/bookmark/target", + "value": "com.slack.bookmarks#Bookmark" + }, + { + "op": "replace", + "path": "/shapes/com.slack.bookmarks#BookmarksListResponseBookmarksList/member/target", + "value": "com.slack.bookmarks#Bookmark" + } + ] +} diff --git a/packages/slack/patches/canvases/canvas-content.json b/packages/slack/patches/canvases/canvas-content.json new file mode 100644 index 0000000000..36df20fb5d --- /dev/null +++ b/packages/slack/patches/canvases/canvas-content.json @@ -0,0 +1,78 @@ +{ + "description": "The docs reference canvas content as `{ \"schema\": \"document_content\" }` and each edit as `{ \"schema\": \"selection\" }`, neither of which has a JSON twin, so canvases.create's `document_content` and canvases.edit's `changes` converted as untyped Documents. Model them from the method examples (`{\"type\":\"markdown\",\"markdown\":\"\u2026\"}`, `{\"operation\":\"insert_before\",\"document_content\":\u2026,\"section_id\":\"\u2026\"}`).", + "patches": [ + { + "op": "add", + "path": "/shapes/com.slack.canvases#CanvasDocumentContent", + "value": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Always `markdown`.", + "smithy.api#required": {} + } + }, + "markdown": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Canvas content as Slack-flavored markdown.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Canvas content. See https://docs.slack.dev/messaging/canvases/#canvas-formatting" + } + } + }, + { + "op": "replace", + "path": "/shapes/com.slack.canvases#CanvasesCreateRequest/members/document_content/target", + "value": "com.slack.canvases#CanvasDocumentContent" + }, + { + "op": "add", + "path": "/shapes/com.slack.canvases#CanvasChange", + "value": { + "type": "structure", + "members": { + "operation": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "`insert_after`, `insert_before`, `insert_at_start`, `insert_at_end`, `replace`, `delete`, or `rename`.", + "smithy.api#required": {} + } + }, + "section_id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Section to act on (`canvases.sections.lookup`); omit to act on the whole canvas." + } + }, + "document_content": { + "target": "com.slack.canvases#CanvasDocumentContent", + "traits": { + "smithy.api#documentation": "Content for insert and replace operations." + } + }, + "title_content": { + "target": "com.slack.canvases#CanvasDocumentContent", + "traits": { + "smithy.api#documentation": "New title for `rename`." + } + } + }, + "traits": { + "smithy.api#documentation": "One canvas edit. See https://docs.slack.dev/reference/methods/canvases.edit" + } + } + }, + { + "op": "replace", + "path": "/shapes/com.slack.canvases#CanvasesEditRequestChangesList/member/target", + "value": "com.slack.canvases#CanvasChange" + } + ] +} diff --git a/packages/slack/patches/conversations/canvas-content.json b/packages/slack/patches/conversations/canvas-content.json new file mode 100644 index 0000000000..09e0b1baf8 --- /dev/null +++ b/packages/slack/patches/conversations/canvas-content.json @@ -0,0 +1,36 @@ +{ + "description": "conversations.canvases.create takes the same `document_content` object as canvases.create (`{\"type\":\"markdown\",\"markdown\":\"\u2026\"}`), which converted as an untyped Document.", + "patches": [ + { + "op": "add", + "path": "/shapes/com.slack.conversations#CanvasDocumentContent", + "value": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Always `markdown`.", + "smithy.api#required": {} + } + }, + "markdown": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Canvas content as Slack-flavored markdown.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Canvas content. See https://docs.slack.dev/messaging/canvases/#canvas-formatting" + } + } + }, + { + "op": "replace", + "path": "/shapes/com.slack.conversations#CanvasesCreateRequest/members/document_content/target", + "value": "com.slack.conversations#CanvasDocumentContent" + } + ] +} diff --git a/packages/slack/patches/conversations/conversation-object.json b/packages/slack/patches/conversations/conversation-object.json new file mode 100644 index 0000000000..a8a2c55817 --- /dev/null +++ b/packages/slack/patches/conversations/conversation-object.json @@ -0,0 +1,205 @@ +{ + "description": "The docs reference the conversation object as `{ \"schema\": \"conversation\" }`, which has no JSON twin, so every `channel` in a conversations.* response converted as an untyped Document. Model the documented conversation object (https://docs.slack.dev/reference/objects/conversation-object) and use it for the channel returned by conversations.create, .info, .rename, .join, .invite and each item of conversations.list. Only `id` is required: the object's other fields vary with the conversation type.", + "patches": [ + { + "op": "add", + "path": "/shapes/com.slack.conversations#ConversationTopic", + "value": { + "type": "structure", + "members": { + "value": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The text." + } + }, + "creator": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "User ID of the member who last set it." + } + }, + "last_set": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "Unix time it was last set (0 when never)." + } + } + }, + "traits": { + "smithy.api#documentation": "A channel's topic or purpose." + } + } + }, + { + "op": "add", + "path": "/shapes/com.slack.conversations#ConversationPreviousNames", + "value": { + "type": "list", + "member": { + "target": "smithy.api#String" + } + } + }, + { + "op": "add", + "path": "/shapes/com.slack.conversations#Conversation", + "value": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {}, + "smithy.api#documentation": "Conversation ID (`C\u2026` for channels, `G\u2026` for some private channels, `D\u2026` for DMs)." + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Channel name, without the leading `#`. Absent on DMs." + } + }, + "name_normalized": { + "target": "smithy.api#String" + }, + "previous_names": { + "target": "com.slack.conversations#ConversationPreviousNames", + "traits": { + "smithy.api#documentation": "Names the channel had before a rename." + } + }, + "created": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "Unix time the conversation was created." + } + }, + "creator": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "User ID of the member who created it." + } + }, + "updated": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "Unix time in milliseconds of the last change." + } + }, + "is_channel": { + "target": "smithy.api#Boolean" + }, + "is_group": { + "target": "smithy.api#Boolean" + }, + "is_im": { + "target": "smithy.api#Boolean" + }, + "is_mpim": { + "target": "smithy.api#Boolean" + }, + "is_private": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether the channel is private." + } + }, + "is_archived": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether the channel is archived." + } + }, + "is_general": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether this is the workspace's #general channel." + } + }, + "is_shared": { + "target": "smithy.api#Boolean" + }, + "is_ext_shared": { + "target": "smithy.api#Boolean" + }, + "is_org_shared": { + "target": "smithy.api#Boolean" + }, + "is_pending_ext_shared": { + "target": "smithy.api#Boolean" + }, + "is_member": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether the calling user or bot is a member." + } + }, + "num_members": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "Member count (with `include_num_members`)." + } + }, + "context_team_id": { + "target": "smithy.api#String" + }, + "unlinked": { + "target": "smithy.api#Integer" + }, + "topic": { + "target": "com.slack.conversations#ConversationTopic", + "traits": { + "smithy.api#documentation": "The channel topic." + } + }, + "purpose": { + "target": "com.slack.conversations#ConversationTopic", + "traits": { + "smithy.api#documentation": "The channel description (purpose)." + } + }, + "properties": { + "target": "smithy.api#Document", + "traits": { + "smithy.api#documentation": "Channel properties (tabs, canvas, \u2026)." + } + } + }, + "traits": { + "smithy.api#documentation": "A conversation object: a channel, private channel, DM or group DM. See https://docs.slack.dev/reference/objects/conversation-object" + } + } + }, + { + "op": "replace", + "path": "/shapes/com.slack.conversations#ConversationsCreateResponse/members/channel/target", + "value": "com.slack.conversations#Conversation" + }, + { + "op": "replace", + "path": "/shapes/com.slack.conversations#ConversationsInfoResponse/members/channel/target", + "value": "com.slack.conversations#Conversation" + }, + { + "op": "replace", + "path": "/shapes/com.slack.conversations#ConversationsRenameResponse/members/channel/target", + "value": "com.slack.conversations#Conversation" + }, + { + "op": "replace", + "path": "/shapes/com.slack.conversations#ConversationsJoinResponse/members/channel/target", + "value": "com.slack.conversations#Conversation" + }, + { + "op": "replace", + "path": "/shapes/com.slack.conversations#ConversationsInviteResponse/members/channel/target", + "value": "com.slack.conversations#Conversation" + }, + { + "op": "replace", + "path": "/shapes/com.slack.conversations#ConversationsListResponseChannelsList/member/target", + "value": "com.slack.conversations#Conversation" + } + ] +} diff --git a/packages/slack/patches/usergroups/usergroup-object.json b/packages/slack/patches/usergroups/usergroup-object.json new file mode 100644 index 0000000000..e3ab6dcaa7 --- /dev/null +++ b/packages/slack/patches/usergroups/usergroup-object.json @@ -0,0 +1,162 @@ +{ + "description": "The docs reference the usergroup object as `{ \"schema\": \"usergroup\" }`, which has no JSON twin, so the `usergroup` in every usergroups.* response converted as an untyped Document. Model the documented object (https://docs.slack.dev/reference/objects/usergroup-object). usergroups.users.list answers `users` as user ID strings (its docs example: `\"users\": [\"U060R4BJ4\", \"W123A4BC5\"]`).", + "patches": [ + { + "op": "add", + "path": "/shapes/com.slack.usergroups#UsergroupUserIds", + "value": { + "type": "list", + "member": { + "target": "smithy.api#String" + } + } + }, + { + "op": "add", + "path": "/shapes/com.slack.usergroups#UsergroupPrefs", + "value": { + "type": "structure", + "members": { + "channels": { + "target": "com.slack.usergroups#UsergroupUserIds", + "traits": { + "smithy.api#documentation": "Default channel IDs." + } + }, + "groups": { + "target": "com.slack.usergroups#UsergroupUserIds", + "traits": { + "smithy.api#documentation": "Default private channel IDs." + } + } + } + } + }, + { + "op": "add", + "path": "/shapes/com.slack.usergroups#Usergroup", + "value": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "User group ID (`S\u2026`).", + "smithy.api#required": {} + } + }, + "team_id": { + "target": "smithy.api#String" + }, + "is_usergroup": { + "target": "smithy.api#Boolean" + }, + "is_subteam": { + "target": "smithy.api#Boolean" + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Display name." + } + }, + "description": { + "target": "smithy.api#String" + }, + "handle": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Mention handle, without the `@`." + } + }, + "is_external": { + "target": "smithy.api#Boolean" + }, + "auto_type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "`admin`/`owner` for the built-in groups, otherwise absent." + } + }, + "date_create": { + "target": "smithy.api#Long" + }, + "date_update": { + "target": "smithy.api#Long" + }, + "date_delete": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "Unix time the group was disabled (0 while enabled)." + } + }, + "created_by": { + "target": "smithy.api#String" + }, + "updated_by": { + "target": "smithy.api#String" + }, + "deleted_by": { + "target": "smithy.api#String" + }, + "prefs": { + "target": "com.slack.usergroups#UsergroupPrefs", + "traits": { + "smithy.api#documentation": "Default channels and groups." + } + }, + "users": { + "target": "com.slack.usergroups#UsergroupUserIds", + "traits": { + "smithy.api#documentation": "Member user IDs (with `include_users`)." + } + }, + "user_count": { + "target": "smithy.api#Integer" + }, + "channel_count": { + "target": "smithy.api#Integer" + } + }, + "traits": { + "smithy.api#documentation": "A user group. See https://docs.slack.dev/reference/objects/usergroup-object" + } + } + }, + { + "op": "replace", + "path": "/shapes/com.slack.usergroups#UsergroupsCreateResponse/members/usergroup/target", + "value": "com.slack.usergroups#Usergroup" + }, + { + "op": "replace", + "path": "/shapes/com.slack.usergroups#UsergroupsUpdateResponse/members/usergroup/target", + "value": "com.slack.usergroups#Usergroup" + }, + { + "op": "replace", + "path": "/shapes/com.slack.usergroups#UsergroupsDisableResponse/members/usergroup/target", + "value": "com.slack.usergroups#Usergroup" + }, + { + "op": "replace", + "path": "/shapes/com.slack.usergroups#UsergroupsEnableResponse/members/usergroup/target", + "value": "com.slack.usergroups#Usergroup" + }, + { + "op": "replace", + "path": "/shapes/com.slack.usergroups#UsersUpdateResponse/members/usergroup/target", + "value": "com.slack.usergroups#Usergroup" + }, + { + "op": "replace", + "path": "/shapes/com.slack.usergroups#UsergroupsListResponseUsergroupsList/member/target", + "value": "com.slack.usergroups#Usergroup" + }, + { + "op": "replace", + "path": "/shapes/com.slack.usergroups#UsersListResponseUsersList/member/target", + "value": "smithy.api#String" + } + ] +} diff --git a/packages/slack/src/services/bookmarks.ts b/packages/slack/src/services/bookmarks.ts index 3d38941fd7..6104b60a06 100644 --- a/packages/slack/src/services/bookmarks.ts +++ b/packages/slack/src/services/bookmarks.ts @@ -392,10 +392,31 @@ export interface AddBookmarkRequest { /** Id of this bookmark's parent */ parent_id?: string | undefined; } +/** A channel bookmark. See https://docs.slack.dev/reference/methods/bookmarks.list */ +export interface Bookmark { + /** Bookmark ID (`Bk...`). */ + id: string; + channel_id?: string | undefined; + title?: string | undefined; + link?: string | undefined; + emoji?: string | undefined; + icon_url?: string | undefined; + /** `link`, or a folder/file entity type. */ + type?: string | undefined; + entity_id?: string | undefined; + date_created?: number | undefined; + date_updated?: number | undefined; + rank?: string | undefined; + last_updated_by_user_id?: string | undefined; + last_updated_by_team_id?: string | undefined; + shortcut_id?: string | undefined; + app_id?: string | undefined; + parent_id?: string | undefined; +} export interface AddBookmarkResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - bookmark: unknown; + bookmark: Bookmark; } export interface EditBookmarkRequest { /** Channel to update bookmark in. Required for public channels. */ @@ -412,13 +433,13 @@ export interface EditBookmarkRequest { export interface EditBookmarkResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - bookmark: unknown; + bookmark: Bookmark; } export interface ListBookmarksRequest { /** Channel to list bookmarks in. Required for public channels. */ channel_id?: string | undefined; } -export type ListBookmarksResponseBookmarksList = Array; +export type ListBookmarksResponseBookmarksList = Array; export interface ListBookmarksResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; @@ -526,7 +547,7 @@ export const editBookmark: API.OperationMethod< EditBookmarkError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(8, __c2, 0) as any as S.Schema, + input: __S(12, __c3, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, errors: [ AccessDenied, @@ -558,8 +579,8 @@ export const listBookmarks: API.OperationMethod< ListBookmarksError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(12, __c3, 0) as any as S.Schema, - output: __S(14, __c3, 2) as any as S.Schema, + input: __S(16, __c4, 0) as any as S.Schema, + output: __S(18, __c4, 2) as any as S.Schema, errors: [AccessDenied, ChannelNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, @@ -583,8 +604,8 @@ export const removeBookmark: API.OperationMethod< RemoveBookmarkError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(16, __c4, 0) as any as S.Schema, - output: __S(17, __c4, 1) as any as S.Schema, + input: __S(20, __c5, 0) as any as S.Schema, + output: __S(21, __c5, 1) as any as S.Schema, errors: [ AccessDenied, ChannelNotFound, @@ -626,12 +647,37 @@ function __c1(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - bookmark: S.Unknown, + bookmark: __S(8, __c2, 0), }), ).annotate({ identifier: "AddBookmarkResponse" }); } } function __c2(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + id: S.String, + channel_id: S.optional(S.String), + title: S.optional(S.String), + link: S.optional(S.String), + emoji: S.optional(S.String), + icon_url: S.optional(S.String), + type: S.optional(S.String), + entity_id: S.optional(S.String), + date_created: S.optional(S.Number), + date_updated: S.optional(S.Number), + rank: S.optional(S.String), + last_updated_by_user_id: S.optional(S.String), + last_updated_by_team_id: S.optional(S.String), + shortcut_id: S.optional(S.String), + app_id: S.optional(S.String), + parent_id: S.optional(S.String), + }), + ).annotate({ identifier: "Bookmark" }); + } +} +function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -645,7 +691,7 @@ function __c2(j: number): any { ).annotate({ identifier: "EditBookmarkRequest" }); } } -function __c3(j: number): any { +function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -654,17 +700,17 @@ function __c3(j: number): any { }).pipe(T.Http({ method: "POST", uri: "/bookmarks.list", code: 200 })), ).annotate({ identifier: "ListBookmarksRequest" }); case 1: - return S.Array(S.Unknown); + return S.Array(__S(8, __c2, 0)); case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, - bookmarks: __S(13, __c3, 1), + bookmarks: __S(17, __c4, 1), }), ).annotate({ identifier: "ListBookmarksResponse" }); } } -function __c4(j: number): any { +function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => diff --git a/packages/slack/src/services/canvases.ts b/packages/slack/src/services/canvases.ts index 94e2845ecf..3163dac7fb 100644 --- a/packages/slack/src/services/canvases.ts +++ b/packages/slack/src/services/canvases.ts @@ -255,11 +255,18 @@ export class UseSkillsApi [{ body: { "/error": "use_skills_api" } }], ) {} +/** Canvas content. See https://docs.slack.dev/messaging/canvases/#canvas-formatting */ +export interface CanvasDocumentContent { + /** Always `markdown`. */ + type: string; + /** Canvas content as Slack-flavored markdown. */ + markdown: string; +} export interface CreateCanvaseRequest { /** Title of the newly created canvas */ title?: string | undefined; /** Structure describing the type and value of the content to create. The markdown content is limited to 1 MiB (1,048,576 characters). */ - document_content?: unknown | undefined; + document_content?: CanvasDocumentContent | undefined; /** Channel ID of the channel the canvas will be tabbed in. This is a required field for free teams. */ channel_id?: string | undefined; } @@ -301,8 +308,19 @@ export interface DeleteCanvaseResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; } +/** One canvas edit. See https://docs.slack.dev/reference/methods/canvases.edit */ +export interface CanvasChange { + /** `insert_after`, `insert_before`, `insert_at_start`, `insert_at_end`, `replace`, `delete`, or `rename`. */ + operation: string; + /** Section to act on (`canvases.sections.lookup`); omit to act on the whole canvas. */ + section_id?: string | undefined; + /** Content for insert and replace operations. */ + document_content?: CanvasDocumentContent | undefined; + /** New title for `rename`. */ + title_content?: CanvasDocumentContent | undefined; +} /** List of changes to apply on the specified canvas. The markdown content of each change is limited to 1 MiB (1,048,576 characters). */ -export type EditCanvaseRequestChangesList = Array; +export type EditCanvaseRequestChangesList = Array; export interface EditCanvaseRequest { /** Encoded ID of the canvas */ canvas_id: string; @@ -420,8 +438,8 @@ export const deleteAccess: API.OperationMethod< DeleteAccessError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(4, __c1, 0) as any as S.Schema, - output: __S(16, __c4, 0) as any as S.Schema, + input: __S(8, __c2, 0) as any as S.Schema, + output: __S(17, __c4, 1) as any as S.Schema, errors: [ CanvasDisabledUserTeam, CanvasNotFound, @@ -484,7 +502,7 @@ export const editCanvase: API.OperationMethod< EditCanvaseError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(28, __c7, 0) as any as S.Schema, + input: __S(30, __c7, 2) as any as S.Schema, output: __S(24, __c6, 0) as any as S.Schema, errors: [ CanvasDisabledUserTeam, @@ -559,7 +577,7 @@ export const setAccess: API.OperationMethod< SlackOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(40, __c10, 0) as any as S.Schema, - output: __S(16, __c4, 0) as any as S.Schema, + output: __S(17, __c4, 1) as any as S.Schema, errors: [ CanvasDisabledUserTeam, CanvasNotFound, @@ -584,7 +602,7 @@ function __c0(j: number): any { return S.suspend(() => S.Struct({ title: S.optional(S.String), - document_content: S.optional(S.Unknown), + document_content: S.optional(__S(4, __c1, 0)), channel_id: S.optional(S.String), }).pipe(T.Http({ method: "POST", uri: "/canvases.create", code: 200 })), ).annotate({ identifier: "CreateCanvaseRequest" }); @@ -602,17 +620,22 @@ function __c1(j: number): any { case 0: return S.suspend(() => S.Struct({ - canvas_id: S.String, - channel_ids: S.optional(__S(8, __c2, 0)), - user_ids: S.optional(__S(12, __c3, 0)), - }).pipe(T.Http({ method: "POST", uri: "/canvases.access.delete", code: 200 })), - ).annotate({ identifier: "DeleteAccessRequest" }); + type: S.String, + markdown: S.String, + }), + ).annotate({ identifier: "CanvasDocumentContent" }); } } function __c2(j: number): any { switch (j) { case 0: - return S.Array(S.Unknown); + return S.suspend(() => + S.Struct({ + canvas_id: S.String, + channel_ids: S.optional(__S(16, __c4, 0)), + user_ids: S.optional(__S(12, __c3, 0)), + }).pipe(T.Http({ method: "POST", uri: "/canvases.access.delete", code: 200 })), + ).annotate({ identifier: "DeleteAccessRequest" }); } } function __c3(j: number): any { @@ -624,6 +647,8 @@ function __c3(j: number): any { function __c4(j: number): any { switch (j) { case 0: + return S.Array(S.Unknown); + case 1: return S.suspend(() => S.Struct({ ok: S.Boolean, @@ -656,10 +681,21 @@ function __c6(j: number): any { function __c7(j: number): any { switch (j) { case 0: + return S.suspend(() => + S.Struct({ + operation: S.String, + section_id: S.optional(S.String), + document_content: S.optional(__S(4, __c1, 0)), + title_content: S.optional(__S(4, __c1, 0)), + }), + ).annotate({ identifier: "CanvasChange" }); + case 1: + return S.Array(__S(28, __c7, 0)); + case 2: return S.suspend(() => S.Struct({ canvas_id: S.String, - changes: __S(8, __c2, 0), + changes: __S(29, __c7, 1), }).pipe(T.Http({ method: "POST", uri: "/canvases.edit", code: 200 })), ).annotate({ identifier: "EditCanvaseRequest" }); } @@ -716,7 +752,7 @@ function __c10(j: number): any { S.Struct({ canvas_id: S.String, access_level: S.String, - channel_ids: S.optional(__S(8, __c2, 0)), + channel_ids: S.optional(__S(16, __c4, 0)), user_ids: S.optional(__S(12, __c3, 0)), }).pipe(T.Http({ method: "POST", uri: "/canvases.access.set", code: 200 })), ).annotate({ identifier: "SetAccessRequest" }); diff --git a/packages/slack/src/services/conversations.ts b/packages/slack/src/services/conversations.ts index 4cd6bbf20c..0dfcfeb444 100644 --- a/packages/slack/src/services/conversations.ts +++ b/packages/slack/src/services/conversations.ts @@ -1692,11 +1692,63 @@ export interface ConversationsInfoRequest { /** Set to `true` to include the member count for the specified conversation. Defaults to `false` */ include_num_members?: boolean | undefined; } +export type ConversationPreviousNames = Array; +/** A channel's topic or purpose. */ +export interface ConversationTopic { + /** The text. */ + value?: string | undefined; + /** User ID of the member who last set it. */ + creator?: string | undefined; + /** Unix time it was last set (0 when never). */ + last_set?: number | undefined; +} +/** A conversation object: a channel, private channel, DM or group DM. See https://docs.slack.dev/reference/objects/conversation-object */ +export interface Conversation { + /** Conversation ID (`C...` for channels, `G...` for some private channels, `D...` for DMs). */ + id: string; + /** Channel name, without the leading `#`. Absent on DMs. */ + name?: string | undefined; + name_normalized?: string | undefined; + /** Names the channel had before a rename. */ + previous_names?: ConversationPreviousNames | undefined; + /** Unix time the conversation was created. */ + created?: number | undefined; + /** User ID of the member who created it. */ + creator?: string | undefined; + /** Unix time in milliseconds of the last change. */ + updated?: number | undefined; + is_channel?: boolean | undefined; + is_group?: boolean | undefined; + is_im?: boolean | undefined; + is_mpim?: boolean | undefined; + /** Whether the channel is private. */ + is_private?: boolean | undefined; + /** Whether the channel is archived. */ + is_archived?: boolean | undefined; + /** Whether this is the workspace's #general channel. */ + is_general?: boolean | undefined; + is_shared?: boolean | undefined; + is_ext_shared?: boolean | undefined; + is_org_shared?: boolean | undefined; + is_pending_ext_shared?: boolean | undefined; + /** Whether the calling user or bot is a member. */ + is_member?: boolean | undefined; + /** Member count (with `include_num_members`). */ + num_members?: number | undefined; + context_team_id?: string | undefined; + unlinked?: number | undefined; + /** The channel topic. */ + topic?: ConversationTopic | undefined; + /** The channel description (purpose). */ + purpose?: ConversationTopic | undefined; + /** Channel properties (tabs, canvas, ...). */ + properties?: unknown | undefined; +} export interface ConversationsInfoResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; app_home?: unknown | undefined; - channel: unknown; + channel: Conversation; home_view?: unknown | null | undefined; } export interface ConversationsKickRequest { @@ -1793,11 +1845,18 @@ export interface ConversationsRepliesResponse { /** Pagination metadata. An empty `next_cursor` means the last page. */ response_metadata?: ConversationsHistoryResponseResponseMetadata | undefined; } +/** Canvas content. See https://docs.slack.dev/messaging/canvases/#canvas-formatting */ +export interface CanvasDocumentContent { + /** Always `markdown`. */ + type: string; + /** Canvas content as Slack-flavored markdown. */ + markdown: string; +} export interface CreateCanvaseRequest { /** Channel ID of the channel the canvas will be tabbed in. */ channel_id: string; /** Structure describing the type and value of the content to create. The markdown content is limited to 1 MiB (1,048,576 characters). */ - document_content?: unknown | undefined; + document_content?: CanvasDocumentContent | undefined; /** Title of the newly created canvas */ title?: string | undefined; } @@ -1818,7 +1877,7 @@ export interface CreateConversationRequest { export interface CreateConversationResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - channel: unknown; + channel: Conversation; } export interface InviteConversationRequest { /** The ID of the public or private channel to invite user(s) to. */ @@ -1832,7 +1891,7 @@ export type InviteConversationResponseErrorsList = Array; export interface InviteConversationResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - channel?: unknown | undefined; + channel?: Conversation | undefined; group?: unknown | undefined; errors?: InviteConversationResponseErrorsList | undefined; } @@ -1880,7 +1939,7 @@ export interface JoinConversationResponseResponseMetadata { export interface JoinConversationResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - channel: unknown; + channel: Conversation; response_metadata?: JoinConversationResponseResponseMetadata | undefined; } export interface LeaveConversationRequest { @@ -1923,7 +1982,7 @@ export interface ListConversationsRequest { /** Mix and match channel types by providing a comma-separated list of any combination of `public_channel`, `private_channel`, `mpim`, `im` */ types?: string | undefined; } -export type ListConversationsResponseChannelsList = Array; +export type ListConversationsResponseChannelsList = Array; /** Pagination metadata. An empty `next_cursor` means the last page. */ export type ListConversationsResponseResponseMetadata = ConversationsHistoryResponseResponseMetadata; @@ -1972,7 +2031,7 @@ export interface RenameConversationRequest { export interface RenameConversationResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - channel: unknown; + channel: Conversation; } export interface RequestSharedInviteDenyRequest { /** ID of the requested shared channel invite to deny. */ @@ -2355,8 +2414,8 @@ export const conversationsKick: API.OperationMethod< ConversationsKickError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(48, __c12, 0) as any as S.Schema, - output: __S(49, __c12, 1) as any as S.Schema, + input: __S(52, __c13, 0) as any as S.Schema, + output: __S(53, __c13, 1) as any as S.Schema, errors: [ CantKickFromGeneral, CantKickSelf, @@ -2389,7 +2448,7 @@ export const conversationsMark: API.OperationMethod< ConversationsMarkError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(52, __c13, 0) as any as S.Schema, + input: __S(56, __c14, 0) as any as S.Schema, output: __S(12, __c3, 0) as any as S.Schema, errors: [ChannelNotFound, InvalidTimestamp, NotInChannel, SlackError, SlackRateLimited], protocol: SlackProtocol, @@ -2415,8 +2474,8 @@ export const conversationsMembers: API.PaginatedOperationMethod< string > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(56, __c14, 0) as any as S.Schema, - output: __S(57, __c14, 1) as any as S.Schema, + input: __S(60, __c15, 0) as any as S.Schema, + output: __S(61, __c15, 1) as any as S.Schema, errors: [ ChannelNotFound, FetchMembersFailed, @@ -2463,8 +2522,8 @@ export const conversationsOpen: API.OperationMethod< ConversationsOpenError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(60, __c15, 0) as any as S.Schema, - output: __S(61, __c15, 1) as any as S.Schema, + input: __S(64, __c16, 0) as any as S.Schema, + output: __S(65, __c16, 1) as any as S.Schema, errors: [ AppCannotJoinChannel, ChannelNotFound, @@ -2507,8 +2566,8 @@ export const conversationsReplies: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(64, __c16, 0) as any as S.Schema, - output: __S(65, __c16, 1) as any as S.Schema, + input: __S(68, __c17, 0) as any as S.Schema, + output: __S(69, __c17, 1) as any as S.Schema, errors: [ ChannelNotFound, InvalidCursor, @@ -2556,8 +2615,8 @@ export const createCanvase: API.OperationMethod< CreateCanvaseError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(68, __c17, 0) as any as S.Schema, - output: __S(69, __c17, 1) as any as S.Schema, + input: __S(73, __c18, 1) as any as S.Schema, + output: __S(74, __c18, 2) as any as S.Schema, errors: [ CanvasCreationFailed, CanvasDisabledUserTeam, @@ -2599,8 +2658,8 @@ export const createConversation: API.OperationMethod< CreateConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(72, __c18, 0) as any as S.Schema, - output: __S(76, __c19, 0) as any as S.Schema, + input: __S(76, __c19, 0) as any as S.Schema, + output: __S(80, __c20, 0) as any as S.Schema, errors: [ CannotCreateChannel, CanvasDisabledUserTeam, @@ -2650,8 +2709,8 @@ export const inviteConversation: API.OperationMethod< InviteConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(80, __c20, 0) as any as S.Schema, - output: __S(81, __c20, 1) as any as S.Schema, + input: __S(84, __c21, 0) as any as S.Schema, + output: __S(85, __c21, 1) as any as S.Schema, errors: [ AlreadyInChannel, AppCannotJoinChannel, @@ -2696,7 +2755,7 @@ export const inviteDeclineShared: API.OperationMethod< InviteDeclineSharedError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(84, __c21, 0) as any as S.Schema, + input: __S(88, __c22, 0) as any as S.Schema, output: __S(12, __c3, 0) as any as S.Schema, errors: [ ApprovalInactive, @@ -2751,8 +2810,8 @@ export const inviteShared: API.OperationMethod< InviteSharedError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(88, __c22, 0) as any as S.Schema, - output: __S(89, __c22, 1) as any as S.Schema, + input: __S(92, __c23, 0) as any as S.Schema, + output: __S(93, __c23, 1) as any as S.Schema, errors: [ AlreadyInChannel, CannotShareCrossWorkspaceChannel, @@ -2806,8 +2865,8 @@ export const joinConversation: API.OperationMethod< JoinConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(92, __c23, 0) as any as S.Schema, - output: __S(94, __c23, 2) as any as S.Schema, + input: __S(96, __c24, 0) as any as S.Schema, + output: __S(98, __c24, 2) as any as S.Schema, errors: [ AppCannotJoinChannel, ChannelIsLimitedAccess, @@ -2841,8 +2900,8 @@ export const leaveConversation: API.OperationMethod< LeaveConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(96, __c24, 0) as any as S.Schema, - output: __S(97, __c24, 1) as any as S.Schema, + input: __S(100, __c25, 0) as any as S.Schema, + output: __S(101, __c25, 1) as any as S.Schema, errors: [ CantLeaveGeneral, ChannelNotFound, @@ -2870,8 +2929,8 @@ export const listConnectInvites: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(100, __c25, 0) as any as S.Schema, - output: __S(101, __c25, 1) as any as S.Schema, + input: __S(104, __c26, 0) as any as S.Schema, + output: __S(105, __c26, 1) as any as S.Schema, errors: [InvalidArguments, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, @@ -2901,11 +2960,11 @@ export const listConversations: API.PaginatedOperationMethod< ListConversationsResponse, ListConversationsError, SlackOpContext, - unknown + Conversation > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(104, __c26, 0) as any as S.Schema, - output: __S(105, __c26, 1) as any as S.Schema, + input: __S(108, __c27, 0) as any as S.Schema, + output: __S(110, __c27, 2) as any as S.Schema, errors: [ InvalidCursor, InvalidLimit, @@ -2945,8 +3004,8 @@ export const listRequestSharedInvite: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(108, __c27, 0) as any as S.Schema, - output: __S(109, __c27, 1) as any as S.Schema, + input: __S(112, __c28, 0) as any as S.Schema, + output: __S(113, __c28, 1) as any as S.Schema, errors: [InvalidCursor, NotImplemented, RestrictedAction, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, @@ -2984,8 +3043,8 @@ export const renameConversation: API.OperationMethod< RenameConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(112, __c28, 0) as any as S.Schema, - output: __S(76, __c19, 0) as any as S.Schema, + input: __S(116, __c29, 0) as any as S.Schema, + output: __S(80, __c20, 0) as any as S.Schema, errors: [ ChannelNotFound, InvalidName, @@ -3026,7 +3085,7 @@ export const requestSharedInviteDeny: API.OperationMethod< RequestSharedInviteDenyError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(116, __c29, 0) as any as S.Schema, + input: __S(120, __c30, 0) as any as S.Schema, output: __S(12, __c3, 0) as any as S.Schema, errors: [ ChannelNotFound, @@ -3061,7 +3120,7 @@ export const setExternalInvitePermissions: API.OperationMethod< SetExternalInvitePermissionsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(120, __c30, 0) as any as S.Schema, + input: __S(124, __c31, 0) as any as S.Schema, output: __S(12, __c3, 0) as any as S.Schema, errors: [ ChannelNotFound, @@ -3094,8 +3153,8 @@ export const setPurpose: API.OperationMethod< SetPurposeError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(124, __c31, 0) as any as S.Schema, - output: __S(76, __c19, 0) as any as S.Schema, + input: __S(128, __c32, 0) as any as S.Schema, + output: __S(132, __c33, 0) as any as S.Schema, errors: [ ChannelNotFound, IsArchived, @@ -3129,8 +3188,8 @@ export const setTopic: API.OperationMethod< SetTopicError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(128, __c32, 0) as any as S.Schema, - output: __S(76, __c19, 0) as any as S.Schema, + input: __S(136, __c34, 0) as any as S.Schema, + output: __S(132, __c33, 0) as any as S.Schema, errors: [ ChannelNotFound, IsArchived, @@ -3161,7 +3220,7 @@ export const unarchiveConversation: API.OperationMethod< UnarchiveConversationError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(132, __c33, 0) as any as S.Schema, + input: __S(140, __c35, 0) as any as S.Schema, output: __S(12, __c3, 0) as any as S.Schema, errors: [ ChannelNotFound, @@ -3319,14 +3378,14 @@ function __c6(j: number): any { is_limited: S.optional(S.Boolean), latest: S.optional(S.String), unread_count_display: S.optional(S.Number), - users: S.optional(__S(28, __c7, 0)), - deleted: S.optional(__S(32, __c8, 0)), + users: S.optional(__S(32, __c8, 0)), + deleted: S.optional(__S(28, __c7, 0)), mutation_timestamps: S.optional(__S(25, __c6, 1)), deleted_overflow: S.optional(S.Boolean), - warnings: S.optional(__S(32, __c8, 0)), + warnings: S.optional(__S(28, __c7, 0)), next_ts: S.optional(S.Number), - latest_updates: S.optional(__S(28, __c7, 0)), - unchanged_messages: S.optional(__S(32, __c8, 0)), + latest_updates: S.optional(__S(32, __c8, 0)), + unchanged_messages: S.optional(__S(28, __c7, 0)), date_joined: S.optional(S.Number), }), ).annotate({ identifier: "ConversationsHistoryResponse" }); @@ -3335,13 +3394,13 @@ function __c6(j: number): any { function __c7(j: number): any { switch (j) { case 0: - return S.Record(S.String, S.Unknown); + return S.Array(S.String); } } function __c8(j: number): any { switch (j) { case 0: - return S.Array(S.String); + return S.Record(S.String, S.Unknown); } } function __c9(j: number): any { @@ -3375,13 +3434,55 @@ function __c11(j: number): any { S.Struct({ ok: S.Boolean, app_home: S.optional(S.Unknown), - channel: S.Unknown, + channel: __S(49, __c12, 1), home_view: S.optional(S.NullOr(S.Unknown)), }), ).annotate({ identifier: "ConversationsInfoResponse" }); } } function __c12(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + value: S.optional(S.String), + creator: S.optional(S.String), + last_set: S.optional(S.Number), + }), + ).annotate({ identifier: "ConversationTopic" }); + case 1: + return S.suspend(() => + S.Struct({ + id: S.String, + name: S.optional(S.String), + name_normalized: S.optional(S.String), + previous_names: S.optional(__S(28, __c7, 0)), + created: S.optional(S.Number), + creator: S.optional(S.String), + updated: S.optional(S.Number), + is_channel: S.optional(S.Boolean), + is_group: S.optional(S.Boolean), + is_im: S.optional(S.Boolean), + is_mpim: S.optional(S.Boolean), + is_private: S.optional(S.Boolean), + is_archived: S.optional(S.Boolean), + is_general: S.optional(S.Boolean), + is_shared: S.optional(S.Boolean), + is_ext_shared: S.optional(S.Boolean), + is_org_shared: S.optional(S.Boolean), + is_pending_ext_shared: S.optional(S.Boolean), + is_member: S.optional(S.Boolean), + num_members: S.optional(S.Number), + context_team_id: S.optional(S.String), + unlinked: S.optional(S.Number), + topic: S.optional(__S(48, __c12, 0)), + purpose: S.optional(__S(48, __c12, 0)), + properties: S.optional(S.Unknown), + }), + ).annotate({ identifier: "Conversation" }); + } +} +function __c13(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3394,12 +3495,12 @@ function __c12(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - errors: S.optional(__S(28, __c7, 0)), + errors: S.optional(__S(32, __c8, 0)), }), ).annotate({ identifier: "ConversationsKickResponse" }); } } -function __c13(j: number): any { +function __c14(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3410,7 +3511,7 @@ function __c13(j: number): any { ).annotate({ identifier: "ConversationsMarkRequest" }); } } -function __c14(j: number): any { +function __c15(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3424,13 +3525,13 @@ function __c14(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - members: __S(32, __c8, 0), + members: __S(28, __c7, 0), response_metadata: S.optional(__S(36, __c9, 0)), }), ).annotate({ identifier: "ConversationsMembersResponse" }); } } -function __c15(j: number): any { +function __c16(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3454,7 +3555,7 @@ function __c15(j: number): any { ).annotate({ identifier: "ConversationsOpenResponse" }); } } -function __c16(j: number): any { +function __c17(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3475,24 +3576,31 @@ function __c16(j: number): any { ok: S.Boolean, has_more: S.optional(S.Boolean), messages: __S(40, __c10, 0), - latest_updates: S.optional(__S(28, __c7, 0)), - unchanged_messages: S.optional(__S(32, __c8, 0)), + latest_updates: S.optional(__S(32, __c8, 0)), + unchanged_messages: S.optional(__S(28, __c7, 0)), response_metadata: S.optional(__S(36, __c9, 0)), }), ).annotate({ identifier: "ConversationsRepliesResponse" }); } } -function __c17(j: number): any { +function __c18(j: number): any { switch (j) { case 0: + return S.suspend(() => + S.Struct({ + type: S.String, + markdown: S.String, + }), + ).annotate({ identifier: "CanvasDocumentContent" }); + case 1: return S.suspend(() => S.Struct({ channel_id: S.String, - document_content: S.optional(S.Unknown), + document_content: S.optional(__S(72, __c18, 0)), title: S.optional(S.String), }).pipe(T.Http({ method: "POST", uri: "/conversations.canvases.create", code: 200 })), ).annotate({ identifier: "CreateCanvaseRequest" }); - case 1: + case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, @@ -3501,7 +3609,7 @@ function __c17(j: number): any { ).annotate({ identifier: "CreateCanvaseResponse" }); } } -function __c18(j: number): any { +function __c19(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3513,18 +3621,18 @@ function __c18(j: number): any { ).annotate({ identifier: "CreateConversationRequest" }); } } -function __c19(j: number): any { +function __c20(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ ok: S.Boolean, - channel: S.Unknown, + channel: __S(49, __c12, 1), }), ).annotate({ identifier: "CreateConversationResponse" }); } } -function __c20(j: number): any { +function __c21(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3538,14 +3646,14 @@ function __c20(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - channel: S.optional(S.Unknown), + channel: S.optional(__S(49, __c12, 1)), group: S.optional(S.Unknown), errors: S.optional(__S(40, __c10, 0)), }), ).annotate({ identifier: "InviteConversationResponse" }); } } -function __c21(j: number): any { +function __c22(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3556,14 +3664,14 @@ function __c21(j: number): any { ).annotate({ identifier: "InviteDeclineSharedRequest" }); } } -function __c22(j: number): any { +function __c23(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ channel: S.String, - emails: S.optional(__S(32, __c8, 0)), - user_ids: S.optional(__S(32, __c8, 0)), + emails: S.optional(__S(28, __c7, 0)), + user_ids: S.optional(__S(28, __c7, 0)), external_limited: S.optional(S.Boolean), }).pipe(T.Http({ method: "POST", uri: "/conversations.inviteShared", code: 200 })), ).annotate({ identifier: "InviteSharedRequest" }); @@ -3579,7 +3687,7 @@ function __c22(j: number): any { ).annotate({ identifier: "InviteSharedResponse" }); } } -function __c23(j: number): any { +function __c24(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3590,20 +3698,20 @@ function __c23(j: number): any { case 1: return S.suspend(() => S.Struct({ - warnings: S.optional(__S(32, __c8, 0)), + warnings: S.optional(__S(28, __c7, 0)), }), ).annotate({ identifier: "JoinConversationResponseResponseMetadata" }); case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, - channel: S.Unknown, - response_metadata: S.optional(__S(93, __c23, 1)), + channel: __S(49, __c12, 1), + response_metadata: S.optional(__S(97, __c24, 1)), }), ).annotate({ identifier: "JoinConversationResponse" }); } } -function __c24(j: number): any { +function __c25(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3620,7 +3728,7 @@ function __c24(j: number): any { ).annotate({ identifier: "LeaveConversationResponse" }); } } -function __c25(j: number): any { +function __c26(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3640,7 +3748,7 @@ function __c25(j: number): any { ).annotate({ identifier: "ListConnectInvitesResponse" }); } } -function __c26(j: number): any { +function __c27(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3653,16 +3761,18 @@ function __c26(j: number): any { }).pipe(T.Http({ method: "GET", uri: "/conversations.list", code: 200 })), ).annotate({ identifier: "ListConversationsRequest" }); case 1: + return S.Array(__S(49, __c12, 1)); + case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, - channels: __S(40, __c10, 0), + channels: __S(109, __c27, 1), response_metadata: S.optional(__S(36, __c9, 0)), }), ).annotate({ identifier: "ListConversationsResponse" }); } } -function __c27(j: number): any { +function __c28(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3671,7 +3781,7 @@ function __c27(j: number): any { include_expired: S.optional(S.Boolean), include_approved: S.optional(S.Boolean), include_denied: S.optional(S.Boolean), - invite_ids: S.optional(__S(32, __c8, 0)), + invite_ids: S.optional(__S(28, __c7, 0)), limit: S.optional(S.Number), cursor: S.optional(S.String), }).pipe( @@ -3688,7 +3798,7 @@ function __c27(j: number): any { ).annotate({ identifier: "ListRequestSharedInviteResponse" }); } } -function __c28(j: number): any { +function __c29(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3699,7 +3809,7 @@ function __c28(j: number): any { ).annotate({ identifier: "RenameConversationRequest" }); } } -function __c29(j: number): any { +function __c30(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3712,7 +3822,7 @@ function __c29(j: number): any { ).annotate({ identifier: "RequestSharedInviteDenyRequest" }); } } -function __c30(j: number): any { +function __c31(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3731,7 +3841,7 @@ function __c30(j: number): any { ).annotate({ identifier: "SetExternalInvitePermissionsRequest" }); } } -function __c31(j: number): any { +function __c32(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3742,7 +3852,18 @@ function __c31(j: number): any { ).annotate({ identifier: "SetPurposeRequest" }); } } -function __c32(j: number): any { +function __c33(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + channel: S.Unknown, + }), + ).annotate({ identifier: "SetPurposeResponse" }); + } +} +function __c34(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -3753,7 +3874,7 @@ function __c32(j: number): any { ).annotate({ identifier: "SetTopicRequest" }); } } -function __c33(j: number): any { +function __c35(j: number): any { switch (j) { case 0: return S.suspend(() => diff --git a/packages/slack/src/services/usergroups.ts b/packages/slack/src/services/usergroups.ts index 4374a82ff4..40d0c791b4 100644 --- a/packages/slack/src/services/usergroups.ts +++ b/packages/slack/src/services/usergroups.ts @@ -388,10 +388,46 @@ export interface CreateUsergroupRequest { /** Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added. */ enable_section?: boolean | undefined; } +export type UsergroupUserIds = Array; +export interface UsergroupPrefs { + /** Default channel IDs. */ + channels?: UsergroupUserIds | undefined; + /** Default private channel IDs. */ + groups?: UsergroupUserIds | undefined; +} +/** A user group. See https://docs.slack.dev/reference/objects/usergroup-object */ +export interface Usergroup { + /** User group ID (`S...`). */ + id: string; + team_id?: string | undefined; + is_usergroup?: boolean | undefined; + is_subteam?: boolean | undefined; + /** Display name. */ + name?: string | undefined; + description?: string | undefined; + /** Mention handle, without the `@`. */ + handle?: string | undefined; + is_external?: boolean | undefined; + /** `admin`/`owner` for the built-in groups, otherwise absent. */ + auto_type?: string | undefined; + date_create?: number | undefined; + date_update?: number | undefined; + /** Unix time the group was disabled (0 while enabled). */ + date_delete?: number | undefined; + created_by?: string | undefined; + updated_by?: string | undefined; + deleted_by?: string | undefined; + /** Default channels and groups. */ + prefs?: UsergroupPrefs | undefined; + /** Member user IDs (with `include_users`). */ + users?: UsergroupUserIds | undefined; + user_count?: number | undefined; + channel_count?: number | undefined; +} export interface CreateUsergroupResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - usergroup: unknown; + usergroup: Usergroup; } export interface DisableUsergroupRequest { /** Include the number of users in the User Group. */ @@ -404,7 +440,7 @@ export interface DisableUsergroupRequest { export interface DisableUsergroupResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - usergroup: unknown; + usergroup: Usergroup; } export interface EnableUsergroupRequest { /** Include the number of users in the User Group. */ @@ -417,7 +453,7 @@ export interface EnableUsergroupRequest { export interface EnableUsergroupResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - usergroup: unknown; + usergroup: Usergroup; } export interface ListUsergroupsRequest { /** Include the number of users in each User Group. */ @@ -429,7 +465,7 @@ export interface ListUsergroupsRequest { /** The user group's encoded team ID. Required if org token is used. */ team_id?: string | undefined; } -export type ListUsergroupsResponseUsergroupsList = Array; +export type ListUsergroupsResponseUsergroupsList = Array; export interface ListUsergroupsResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; @@ -443,7 +479,7 @@ export interface ListUsersRequest { /** The user group's encoded team ID. Required if org token is used. */ team_id?: string | undefined; } -export type ListUsersResponseUsersList = Array; +export type ListUsersResponseUsersList = Array; export interface ListUsersResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; @@ -470,7 +506,7 @@ export interface UpdateUserRequest { export interface UpdateUserResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - usergroup: unknown; + usergroup: Usergroup; } /** A comma separated string of encoded channel IDs for which the User Group uses as a default. */ export type UpdateUsergroupRequestChannelsList = Array; @@ -501,7 +537,7 @@ export type UpdateUsergroupResponseChannelLimitUserIdsList = Array; export interface UpdateUsergroupResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - usergroup: unknown; + usergroup: Usergroup; /** List of user IDs who would exceed their channel limit */ channel_limit_user_ids?: UpdateUsergroupResponseChannelLimitUserIdsList | undefined; } @@ -530,7 +566,7 @@ export const createUsergroup: API.OperationMethod< SlackOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, - output: __S(2, __c1, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, errors: [ BadHandle, DescriptionTooLong, @@ -570,8 +606,8 @@ export const disableUsergroup: API.OperationMethod< DisableUsergroupError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(6, __c3, 0) as any as S.Schema, - output: __S(2, __c1, 0) as any as S.Schema, + input: __S(16, __c4, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, errors: [ MissingArgument, PermissionDenied, @@ -599,8 +635,8 @@ export const enableUsergroup: API.OperationMethod< EnableUsergroupError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(8, __c4, 0) as any as S.Schema, - output: __S(2, __c1, 0) as any as S.Schema, + input: __S(20, __c5, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, errors: [MissingArgument, PermissionDenied, PlanUpgradeRequired, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, @@ -622,8 +658,8 @@ export const listUsergroups: API.OperationMethod< ListUsergroupsError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(10, __c5, 0) as any as S.Schema, - output: __S(11, __c5, 1) as any as S.Schema, + input: __S(24, __c6, 0) as any as S.Schema, + output: __S(26, __c6, 2) as any as S.Schema, errors: [ InvalidCursor, InvalidTeam, @@ -647,8 +683,8 @@ export const listUsers: API.OperationMethod< ListUsersError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(14, __c7, 0) as any as S.Schema, - output: __S(15, __c7, 1) as any as S.Schema, + input: __S(28, __c7, 0) as any as S.Schema, + output: __S(29, __c7, 1) as any as S.Schema, errors: [InvalidCursor, NoSuchSubteam, PlanUpgradeRequired, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, @@ -673,8 +709,8 @@ export const updateUser: API.OperationMethod< UpdateUserError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(16, __c8, 0) as any as S.Schema, - output: __S(2, __c1, 0) as any as S.Schema, + input: __S(32, __c8, 0) as any as S.Schema, + output: __S(12, __c3, 0) as any as S.Schema, errors: [ CannotModifyRoleAdmin, FailedForSomeUsers, @@ -707,8 +743,8 @@ export const updateUsergroup: API.OperationMethod< UpdateUsergroupError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(18, __c9, 0) as any as S.Schema, - output: __S(19, __c9, 1) as any as S.Schema, + input: __S(36, __c9, 0) as any as S.Schema, + output: __S(37, __c9, 1) as any as S.Schema, errors: [ MissingArgument, PaidTeamsOnly, @@ -730,8 +766,8 @@ function __c0(j: number): any { case 0: return S.suspend(() => S.Struct({ - channels: S.optional(__S(4, __c2, 0)), - additional_channels: S.optional(__S(4, __c2, 0)), + channels: S.optional(__S(4, __c1, 0)), + additional_channels: S.optional(__S(4, __c1, 0)), description: S.optional(S.String), handle: S.optional(S.String), include_count: S.optional(S.Boolean), @@ -743,23 +779,58 @@ function __c0(j: number): any { } } function __c1(j: number): any { + switch (j) { + case 0: + return S.Array(S.String); + } +} +function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ - ok: S.Boolean, - usergroup: S.Unknown, + channels: S.optional(__S(4, __c1, 0)), + groups: S.optional(__S(4, __c1, 0)), }), - ).annotate({ identifier: "CreateUsergroupResponse" }); + ).annotate({ identifier: "UsergroupPrefs" }); + case 1: + return S.suspend(() => + S.Struct({ + id: S.String, + team_id: S.optional(S.String), + is_usergroup: S.optional(S.Boolean), + is_subteam: S.optional(S.Boolean), + name: S.optional(S.String), + description: S.optional(S.String), + handle: S.optional(S.String), + is_external: S.optional(S.Boolean), + auto_type: S.optional(S.String), + date_create: S.optional(S.Number), + date_update: S.optional(S.Number), + date_delete: S.optional(S.Number), + created_by: S.optional(S.String), + updated_by: S.optional(S.String), + deleted_by: S.optional(S.String), + prefs: S.optional(__S(8, __c2, 0)), + users: S.optional(__S(4, __c1, 0)), + user_count: S.optional(S.Number), + channel_count: S.optional(S.Number), + }), + ).annotate({ identifier: "Usergroup" }); } } -function __c2(j: number): any { +function __c3(j: number): any { switch (j) { case 0: - return S.Array(S.String); + return S.suspend(() => + S.Struct({ + ok: S.Boolean, + usergroup: __S(9, __c2, 1), + }), + ).annotate({ identifier: "CreateUsergroupResponse" }); } } -function __c3(j: number): any { +function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -771,7 +842,7 @@ function __c3(j: number): any { ).annotate({ identifier: "DisableUsergroupRequest" }); } } -function __c4(j: number): any { +function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -783,7 +854,7 @@ function __c4(j: number): any { ).annotate({ identifier: "EnableUsergroupRequest" }); } } -function __c5(j: number): any { +function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -795,20 +866,16 @@ function __c5(j: number): any { }).pipe(T.Http({ method: "GET", uri: "/usergroups.list", code: 200 })), ).annotate({ identifier: "ListUsergroupsRequest" }); case 1: + return S.Array(__S(9, __c2, 1)); + case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, - usergroups: __S(12, __c6, 0), + usergroups: __S(25, __c6, 1), }), ).annotate({ identifier: "ListUsergroupsResponse" }); } } -function __c6(j: number): any { - switch (j) { - case 0: - return S.Array(S.Unknown); - } -} function __c7(j: number): any { switch (j) { case 0: @@ -823,7 +890,7 @@ function __c7(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - users: __S(12, __c6, 0), + users: __S(4, __c1, 0), }), ).annotate({ identifier: "ListUsersResponse" }); } @@ -836,8 +903,8 @@ function __c8(j: number): any { include_count: S.optional(S.Boolean), team_id: S.optional(S.String), usergroup: S.String, - users: __S(4, __c2, 0), - additional_channels: S.optional(__S(4, __c2, 0)), + users: __S(4, __c1, 0), + additional_channels: S.optional(__S(4, __c1, 0)), is_shared: S.optional(S.Boolean), }).pipe(T.Http({ method: "POST", uri: "/usergroups.users.update", code: 200 })), ).annotate({ identifier: "UpdateUserRequest" }); @@ -848,8 +915,8 @@ function __c9(j: number): any { case 0: return S.suspend(() => S.Struct({ - channels: S.optional(__S(4, __c2, 0)), - additional_channels: S.optional(__S(4, __c2, 0)), + channels: S.optional(__S(4, __c1, 0)), + additional_channels: S.optional(__S(4, __c1, 0)), description: S.optional(S.String), handle: S.optional(S.String), include_count: S.optional(S.Boolean), @@ -863,8 +930,8 @@ function __c9(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - usergroup: S.Unknown, - channel_limit_user_ids: S.optional(__S(4, __c2, 0)), + usergroup: __S(9, __c2, 1), + channel_limit_user_ids: S.optional(__S(4, __c1, 0)), }), ).annotate({ identifier: "UpdateUsergroupResponse" }); } From 5c64d7a2f250ada7cb970002a50fc01cd8feb5dc Mon Sep 17 00:00:00 2001 From: Sam Goodwin Date: Fri, 20 Nov 2026 23:55:43 -0800 Subject: [PATCH 4/6] fix(slack): model the user object --- packages/slack/patches/users/user-object.json | 190 +++++++++++++++++ packages/slack/src/services/users.ts | 199 ++++++++++++++---- 2 files changed, 345 insertions(+), 44 deletions(-) create mode 100644 packages/slack/patches/users/user-object.json diff --git a/packages/slack/patches/users/user-object.json b/packages/slack/patches/users/user-object.json new file mode 100644 index 0000000000..7d11bb8b68 --- /dev/null +++ b/packages/slack/patches/users/user-object.json @@ -0,0 +1,190 @@ +{ + "description": "The docs reference the user object as `{ \"schema\": \"user\" }` (and the profile as `{ \"schema\": \"user_profile\" }`), which have no JSON twins, so users.info, users.list and users.lookupByEmail returned untyped Documents. Model the documented objects (https://docs.slack.dev/reference/objects/user-object). Only `id` is required: bots, guests and deactivated members omit most fields.", + "patches": [ + { + "op": "add", + "path": "/shapes/com.slack.users#UserProfile", + "value": { + "type": "structure", + "members": { + "display_name": { + "target": "smithy.api#String" + }, + "display_name_normalized": { + "target": "smithy.api#String" + }, + "real_name": { + "target": "smithy.api#String" + }, + "real_name_normalized": { + "target": "smithy.api#String" + }, + "first_name": { + "target": "smithy.api#String" + }, + "last_name": { + "target": "smithy.api#String" + }, + "email": { + "target": "smithy.api#String" + }, + "title": { + "target": "smithy.api#String" + }, + "phone": { + "target": "smithy.api#String" + }, + "status_text": { + "target": "smithy.api#String" + }, + "status_emoji": { + "target": "smithy.api#String" + }, + "image_24": { + "target": "smithy.api#String" + }, + "image_32": { + "target": "smithy.api#String" + }, + "image_48": { + "target": "smithy.api#String" + }, + "image_72": { + "target": "smithy.api#String" + }, + "image_192": { + "target": "smithy.api#String" + }, + "image_512": { + "target": "smithy.api#String" + }, + "team": { + "target": "smithy.api#String" + }, + "status_expiration": { + "target": "smithy.api#Long" + }, + "bot_id": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "A member's profile. `email` needs the `users:read.email` scope." + } + } + }, + { + "op": "add", + "path": "/shapes/com.slack.users#User", + "value": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "User ID (`U\u2026`/`W\u2026`).", + "smithy.api#required": {} + } + }, + "team_id": { + "target": "smithy.api#String" + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Username (deprecated in the UI; prefer `profile.display_name`)." + } + }, + "real_name": { + "target": "smithy.api#String" + }, + "deleted": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Whether the account is deactivated." + } + }, + "color": { + "target": "smithy.api#String" + }, + "tz": { + "target": "smithy.api#String" + }, + "tz_label": { + "target": "smithy.api#String" + }, + "tz_offset": { + "target": "smithy.api#Integer" + }, + "is_admin": { + "target": "smithy.api#Boolean" + }, + "is_owner": { + "target": "smithy.api#Boolean" + }, + "is_primary_owner": { + "target": "smithy.api#Boolean" + }, + "is_restricted": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Multi-channel guest." + } + }, + "is_ultra_restricted": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Single-channel guest." + } + }, + "is_bot": { + "target": "smithy.api#Boolean" + }, + "is_app_user": { + "target": "smithy.api#Boolean" + }, + "is_email_confirmed": { + "target": "smithy.api#Boolean" + }, + "updated": { + "target": "smithy.api#Long" + }, + "locale": { + "target": "smithy.api#String" + }, + "profile": { + "target": "com.slack.users#UserProfile" + } + }, + "traits": { + "smithy.api#documentation": "A workspace member. See https://docs.slack.dev/reference/objects/user-object" + } + } + }, + { + "op": "replace", + "path": "/shapes/com.slack.users#UsersInfoResponse/members/user/target", + "value": "com.slack.users#User" + }, + { + "op": "replace", + "path": "/shapes/com.slack.users#UsersInfoResponseUsersList/member/target", + "value": "com.slack.users#User" + }, + { + "op": "replace", + "path": "/shapes/com.slack.users#UsersListResponseMembersList/member/target", + "value": "com.slack.users#User" + }, + { + "op": "replace", + "path": "/shapes/com.slack.users#LookupByEmailResponse/members/user/target", + "value": "com.slack.users#User" + }, + { + "op": "replace", + "path": "/shapes/com.slack.users#ProfileGetResponse/members/profile/target", + "value": "com.slack.users#UserProfile" + } + ] +} diff --git a/packages/slack/src/services/users.ts b/packages/slack/src/services/users.ts index 93258998e9..421a0ff30d 100644 --- a/packages/slack/src/services/users.ts +++ b/packages/slack/src/services/users.ts @@ -580,10 +580,33 @@ export interface GetProfileRequest { /** User to retrieve profile info for */ user?: string | undefined; } +/** A member's profile. `email` needs the `users:read.email` scope. */ +export interface UserProfile { + display_name?: string | undefined; + display_name_normalized?: string | undefined; + real_name?: string | undefined; + real_name_normalized?: string | undefined; + first_name?: string | undefined; + last_name?: string | undefined; + email?: string | undefined; + title?: string | undefined; + phone?: string | undefined; + status_text?: string | undefined; + status_emoji?: string | undefined; + image_24?: string | undefined; + image_32?: string | undefined; + image_48?: string | undefined; + image_72?: string | undefined; + image_192?: string | undefined; + image_512?: string | undefined; + team?: string | undefined; + status_expiration?: number | undefined; + bot_id?: string | undefined; +} export interface GetProfileResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - profile: unknown; + profile: UserProfile; } export interface ListUsersRequest { /** Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/apis/web-api/pagination) for more detail. */ @@ -595,7 +618,35 @@ export interface ListUsersRequest { /** encoded team id to list users in, required if org token is used */ team_id?: string | undefined; } -export type ListUsersResponseMembersList = Array; +/** A workspace member. See https://docs.slack.dev/reference/objects/user-object */ +export interface User { + /** User ID (`U...`/`W...`). */ + id: string; + team_id?: string | undefined; + /** Username (deprecated in the UI; prefer `profile.display_name`). */ + name?: string | undefined; + real_name?: string | undefined; + /** Whether the account is deactivated. */ + deleted?: boolean | undefined; + color?: string | undefined; + tz?: string | undefined; + tz_label?: string | undefined; + tz_offset?: number | undefined; + is_admin?: boolean | undefined; + is_owner?: boolean | undefined; + is_primary_owner?: boolean | undefined; + /** Multi-channel guest. */ + is_restricted?: boolean | undefined; + /** Single-channel guest. */ + is_ultra_restricted?: boolean | undefined; + is_bot?: boolean | undefined; + is_app_user?: boolean | undefined; + is_email_confirmed?: boolean | undefined; + updated?: number | undefined; + locale?: string | undefined; + profile?: UserProfile | undefined; +} +export type ListUsersResponseMembersList = Array; /** Pagination metadata. An empty `next_cursor` means the last page. */ export interface ListUsersResponseResponseMetadata { /** Cursor for the next page -- pass as `cursor` on the next call. */ @@ -617,7 +668,7 @@ export interface LookupByEmailRequest { export interface LookupByEmailResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - user: unknown; + user: User; } export interface LookupDiscoverableContactRequest { email: string; @@ -712,11 +763,11 @@ export interface UsersInfoRequest { /** User to get info on */ user?: string | undefined; } -export type UsersInfoResponseUsersList = Array; +export type UsersInfoResponseUsersList = Array; export interface UsersInfoResponse { /** Always `true` (a failed call raises a typed error instead). */ ok: boolean; - user?: unknown | undefined; + user?: User | undefined; users?: UsersInfoResponseUsersList | undefined; } export type DeletePhotoError = SlackOpError; @@ -777,11 +828,11 @@ export const listUsers: API.PaginatedOperationMethod< ListUsersResponse, ListUsersError, SlackOpContext, - unknown + User > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(16, __c4, 0) as any as S.Schema, - output: __S(17, __c4, 1) as any as S.Schema, + input: __S(20, __c5, 0) as any as S.Schema, + output: __S(21, __c5, 1) as any as S.Schema, errors: [InvalidCursor, LimitRequired, MissingArgument, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, @@ -806,8 +857,8 @@ export const lookupByEmail: API.OperationMethod< LookupByEmailError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(28, __c7, 0) as any as S.Schema, - output: __S(29, __c7, 1) as any as S.Schema, + input: __S(36, __c9, 0) as any as S.Schema, + output: __S(37, __c9, 1) as any as S.Schema, errors: [EnterpriseIsRestricted, UsersNotFound, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, @@ -828,8 +879,8 @@ export const lookupDiscoverableContact: API.OperationMethod< LookupDiscoverableContactError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(32, __c8, 0) as any as S.Schema, - output: __S(33, __c8, 1) as any as S.Schema, + input: __S(40, __c10, 0) as any as S.Schema, + output: __S(41, __c10, 1) as any as S.Schema, errors: [ InvalidArguments, NotAllowed, @@ -852,7 +903,7 @@ export const setActive: API.OperationMethod< SetActiveError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(36, __c9, 0) as any as S.Schema, + input: __S(44, __c11, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, errors: [SlackError, SlackRateLimited], protocol: SlackProtocol, @@ -869,8 +920,8 @@ export const setPhoto: API.OperationMethod< SetPhotoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(40, __c10, 0) as any as S.Schema, - output: __S(42, __c10, 2) as any as S.Schema, + input: __S(48, __c12, 0) as any as S.Schema, + output: __S(50, __c12, 2) as any as S.Schema, errors: [BadImage, TooLarge, TooManyFrames, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, @@ -886,7 +937,7 @@ export const setPresence: API.OperationMethod< SetPresenceError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(44, __c11, 0) as any as S.Schema, + input: __S(52, __c13, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, errors: [InvalidPresence, SlackError, SlackRateLimited], protocol: SlackProtocol, @@ -922,8 +973,8 @@ export const setProfile: API.OperationMethod< SetProfileError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(48, __c12, 0) as any as S.Schema, - output: __S(49, __c12, 1) as any as S.Schema, + input: __S(56, __c14, 0) as any as S.Schema, + output: __S(57, __c14, 1) as any as S.Schema, errors: [ CannotUpdateAdminUser, EmailTaken, @@ -969,8 +1020,8 @@ export const usersConversations: API.PaginatedOperationMethod< unknown > = /*@__PURE__*/ API.makePaginated( () => ({ - input: __S(52, __c13, 0) as any as S.Schema, - output: __S(53, __c13, 1) as any as S.Schema, + input: __S(60, __c15, 0) as any as S.Schema, + output: __S(62, __c15, 2) as any as S.Schema, errors: [ InvalidCursor, InvalidLimit, @@ -1004,7 +1055,7 @@ export const usersIdentity: API.OperationMethod< UsersIdentityError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(56, __c14, 0) as any as S.Schema, + input: __S(64, __c16, 0) as any as S.Schema, output: __S(4, __c1, 0) as any as S.Schema, errors: [EmailNotVerified, InvalidUserId, SlackError, SlackRateLimited], protocol: SlackProtocol, @@ -1021,8 +1072,8 @@ export const usersInfo: API.OperationMethod< UsersInfoError, SlackOpContext > = /*@__PURE__*/ API.make(() => ({ - input: __S(60, __c15, 0) as any as S.Schema, - output: __S(61, __c15, 1) as any as S.Schema, + input: __S(68, __c17, 0) as any as S.Schema, + output: __S(69, __c17, 1) as any as S.Schema, errors: [TooManyUsers, UserNotFound, UserNotVisible, SlackError, SlackRateLimited], protocol: SlackProtocol, retry: Retry.Retry, @@ -1084,12 +1135,41 @@ function __c3(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - profile: S.Unknown, + profile: __S(16, __c4, 0), }), ).annotate({ identifier: "GetProfileResponse" }); } } function __c4(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + display_name: S.optional(S.String), + display_name_normalized: S.optional(S.String), + real_name: S.optional(S.String), + real_name_normalized: S.optional(S.String), + first_name: S.optional(S.String), + last_name: S.optional(S.String), + email: S.optional(S.String), + title: S.optional(S.String), + phone: S.optional(S.String), + status_text: S.optional(S.String), + status_emoji: S.optional(S.String), + image_24: S.optional(S.String), + image_32: S.optional(S.String), + image_48: S.optional(S.String), + image_72: S.optional(S.String), + image_192: S.optional(S.String), + image_512: S.optional(S.String), + team: S.optional(S.String), + status_expiration: S.optional(S.Number), + bot_id: S.optional(S.String), + }), + ).annotate({ identifier: "UserProfile" }); + } +} +function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1104,15 +1184,44 @@ function __c4(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - members: __S(24, __c6, 0), + members: __S(32, __c8, 0), cache_ts: S.Number, - response_metadata: S.optional(__S(20, __c5, 0)), + response_metadata: S.optional(__S(28, __c7, 0)), offset: S.optional(S.String), }), ).annotate({ identifier: "ListUsersResponse" }); } } -function __c5(j: number): any { +function __c6(j: number): any { + switch (j) { + case 0: + return S.suspend(() => + S.Struct({ + id: S.String, + team_id: S.optional(S.String), + name: S.optional(S.String), + real_name: S.optional(S.String), + deleted: S.optional(S.Boolean), + color: S.optional(S.String), + tz: S.optional(S.String), + tz_label: S.optional(S.String), + tz_offset: S.optional(S.Number), + is_admin: S.optional(S.Boolean), + is_owner: S.optional(S.Boolean), + is_primary_owner: S.optional(S.Boolean), + is_restricted: S.optional(S.Boolean), + is_ultra_restricted: S.optional(S.Boolean), + is_bot: S.optional(S.Boolean), + is_app_user: S.optional(S.Boolean), + is_email_confirmed: S.optional(S.Boolean), + updated: S.optional(S.Number), + locale: S.optional(S.String), + profile: S.optional(__S(16, __c4, 0)), + }), + ).annotate({ identifier: "User" }); + } +} +function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1122,13 +1231,13 @@ function __c5(j: number): any { ).annotate({ identifier: "ListUsersResponseResponseMetadata" }); } } -function __c6(j: number): any { +function __c8(j: number): any { switch (j) { case 0: - return S.Array(S.Unknown); + return S.Array(__S(24, __c6, 0)); } } -function __c7(j: number): any { +function __c9(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1140,12 +1249,12 @@ function __c7(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - user: S.Unknown, + user: __S(24, __c6, 0), }), ).annotate({ identifier: "LookupByEmailResponse" }); } } -function __c8(j: number): any { +function __c10(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1162,7 +1271,7 @@ function __c8(j: number): any { ).annotate({ identifier: "LookupDiscoverableContactResponse" }); } } -function __c9(j: number): any { +function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1170,7 +1279,7 @@ function __c9(j: number): any { ).annotate({ identifier: "SetActiveRequest" }); } } -function __c10(j: number): any { +function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1194,12 +1303,12 @@ function __c10(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - profile: __S(41, __c10, 1), + profile: __S(49, __c12, 1), }), ).annotate({ identifier: "SetPhotoResponse" }); } } -function __c11(j: number): any { +function __c13(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1209,7 +1318,7 @@ function __c11(j: number): any { ).annotate({ identifier: "SetPresenceRequest" }); } } -function __c12(j: number): any { +function __c14(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1231,7 +1340,7 @@ function __c12(j: number): any { ).annotate({ identifier: "SetProfileResponse" }); } } -function __c13(j: number): any { +function __c15(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1246,16 +1355,18 @@ function __c13(j: number): any { }).pipe(T.Http({ method: "GET", uri: "/users.conversations", code: 200 })), ).annotate({ identifier: "UsersConversationsRequest" }); case 1: + return S.Array(S.Unknown); + case 2: return S.suspend(() => S.Struct({ ok: S.Boolean, - channels: __S(24, __c6, 0), - response_metadata: S.optional(__S(20, __c5, 0)), + channels: __S(61, __c15, 1), + response_metadata: S.optional(__S(28, __c7, 0)), }), ).annotate({ identifier: "UsersConversationsResponse" }); } } -function __c14(j: number): any { +function __c16(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1263,7 +1374,7 @@ function __c14(j: number): any { ).annotate({ identifier: "UsersIdentityRequest" }); } } -function __c15(j: number): any { +function __c17(j: number): any { switch (j) { case 0: return S.suspend(() => @@ -1276,8 +1387,8 @@ function __c15(j: number): any { return S.suspend(() => S.Struct({ ok: S.Boolean, - user: S.optional(S.Unknown), - users: S.optional(__S(24, __c6, 0)), + user: S.optional(__S(24, __c6, 0)), + users: S.optional(__S(32, __c8, 0)), }), ).annotate({ identifier: "UsersInfoResponse" }); } From 78161198d4649f872cdbd0ec1fd184ad495ce7a0 Mon Sep 17 00:00:00 2001 From: Sam Goodwin Date: Fri, 20 Nov 2026 23:56:19 -0800 Subject: [PATCH 5/6] fix(slack): redact the app-level token apps.manifest.create returns --- ...reate-manifest-verification-token-sensitive.json | 13 +++++++++++-- packages/slack/src/services/apps.ts | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/slack/patches/apps/create-manifest-verification-token-sensitive.json b/packages/slack/patches/apps/create-manifest-verification-token-sensitive.json index 85eafdac19..c080d18ff1 100644 --- a/packages/slack/patches/apps/create-manifest-verification-token-sensitive.json +++ b/packages/slack/patches/apps/create-manifest-verification-token-sensitive.json @@ -1,10 +1,19 @@ { - "description": "apps.manifest.create returns the new app's `verification_token`, the legacy shared secret Slack sends with every Events API and interactivity request. Mark it sensitive like `client_secret` and `signing_secret` beside it. See https://docs.slack.dev/authentication/verifying-requests-from-slack#deprecation", + "description": "apps.manifest.create returns the new app's `verification_token`, the legacy shared secret Slack sends with every Events API and interactivity request. Mark it sensitive like `client_secret` and `signing_secret` beside it. See https://docs.slack.dev/authentication/verifying-requests-from-slack#deprecation The response's `app_token` (an app-level token, sent for apps that use Socket Mode) is a credential too.", "patches": [ { "op": "add", "path": "/shapes/com.slack.apps#ManifestCreateResponseCredentials/members/verification_token/traits", - "value": { "smithy.api#sensitive": {} } + "value": { + "smithy.api#sensitive": {} + } + }, + { + "op": "add", + "path": "/shapes/com.slack.apps#ManifestCreateResponse/members/app_token/traits", + "value": { + "smithy.api#sensitive": {} + } } ] } diff --git a/packages/slack/src/services/apps.ts b/packages/slack/src/services/apps.ts index 37a17df2bf..78c340a20d 100644 --- a/packages/slack/src/services/apps.ts +++ b/packages/slack/src/services/apps.ts @@ -1044,7 +1044,7 @@ export interface CreateManifestResponse { team_id?: string | undefined; /** The team domain where the app was created on */ team_domain?: string | undefined; - app_token?: string | undefined; + app_token?: string | Redacted.Redacted | undefined; } /** A map of attributes referenced in expression */ export type DatastoreCountRequestExpressionAttributesMap = { [key: string]: unknown | undefined }; @@ -2394,7 +2394,7 @@ function __c7(j: number): any { oauth_authorize_url: S.optional(S.String), team_id: S.optional(S.String), team_domain: S.optional(S.String), - app_token: S.optional(S.String), + app_token: S.optional(S.String.pipe(T.SensitiveValue({}))), }), ).annotate({ identifier: "CreateManifestResponse" }); } From 5d49480c5a33fab7c3116a9ed2ad457871492201 Mon Sep 17 00:00:00 2001 From: Sam Goodwin Date: Sat, 21 Nov 2026 01:21:37 -0800 Subject: [PATCH 6/6] test(slack): documented slugs are typed errors; SlackError keeps undocumented ones --- packages/slack/test/protocol.test.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/slack/test/protocol.test.ts b/packages/slack/test/protocol.test.ts index 5c6cb76019..02eb2064f7 100644 --- a/packages/slack/test/protocol.test.ts +++ b/packages/slack/test/protocol.test.ts @@ -24,7 +24,7 @@ import { import type { SlackOpContext } from "../src/protocol.ts"; import * as Retry from "../src/retry.ts"; import { bulkArchive, getFile } from "../src/services/admin.ts"; -import { postMessage } from "../src/services/chat.ts"; +import { ChannelNotFound, postMessage } from "../src/services/chat.ts"; import { addRemote } from "../src/services/files.ts"; import { migrationExchange } from "../src/services/migration.ts"; import { v2Exchange } from "../src/services/oauth.ts"; @@ -241,12 +241,20 @@ describe("ok:true responses", () => { }); describe("ok:false envelopes", () => { + test("a slug the method documents is its typed error", async () => { + const error = await failWith(postMessage({ channel: "C1" }), { + body: notOk("channel_not_found", { needed: "chat:write" }), + }); + expect(error).toBeInstanceOf(ChannelNotFound); + expect(error).toMatchObject({ _tag: "ChannelNotFound", needed: "chat:write" }); + }); + test("an unrecognised slug inside HTTP 200 is SlackError carrying the slug", async () => { const error = await failWith(postMessage({ channel: "C1" }), { - body: notOk("channel_not_found"), + body: notOk("some_future_slug"), }); expect(error).toBeInstanceOf(SlackError); - expect(error).toMatchObject({ code: "channel_not_found" }); + expect(error).toMatchObject({ code: "some_future_slug" }); // The message is omitted when it would only repeat the slug. expect((error as SlackError).message).toBe(""); }); @@ -274,10 +282,10 @@ describe("ok:false envelopes", () => { test("a bare `errors` list is used as detail too", async () => { const error = await failWith(postMessage({ channel: "C1" }), { - body: notOk("invalid_blocks", { errors: ["invalid block at index 0"] }), + body: notOk("some_future_slug", { errors: ["invalid block at index 0"] }), }); expect(error).toMatchObject({ - code: "invalid_blocks", + code: "some_future_slug", message: "invalid block at index 0", messages: ["invalid block at index 0"], });