From 383c4001f3e7e3caba7cf93087adbb074dcd38a3 Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Fri, 14 Jun 2024 09:16:19 -0400 Subject: [PATCH] Add new incoming canvas APIs, no longer consider `functions.*` APIs hidden. (#104) --- scripts/src/public-api-methods.ts | 16 +++++++++------- .../method-types/api_method_types_test.ts | 7 +++++++ src/generated/method-types/canvases.ts | 14 ++++++++++++++ src/generated/method-types/conversations.ts | 3 +++ src/generated/method-types/mod.ts | 2 ++ 5 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 src/generated/method-types/canvases.ts diff --git a/scripts/src/public-api-methods.ts b/scripts/src/public-api-methods.ts index eec7185..f1c8c66 100644 --- a/scripts/src/public-api-methods.ts +++ b/scripts/src/public-api-methods.ts @@ -103,6 +103,12 @@ export const getPublicAPIMethods = () => { "calls.update", "calls.participants.add", "calls.participants.remove", + "canvases.access.delete", + "canvases.access.set", + "canvases.create", + "canvases.delete", + "canvases.edit", + "canvases.sections.lookup", "chat.delete", "chat.deleteScheduledMessage", "chat.getPermalink", @@ -116,6 +122,7 @@ export const getPublicAPIMethods = () => { "conversations.acceptSharedInvite", "conversations.approveSharedInvite", "conversations.archive", + "conversations.canvases.create", "conversations.close", "conversations.create", "conversations.declineSharedInvite", @@ -161,6 +168,8 @@ export const getPublicAPIMethods = () => { "files.remote.remove", "files.remote.share", "files.remote.update", + "functions.completeError", + "functions.completeSuccess", "migration.exchange", "oauth.access", "oauth.v2.access", @@ -223,15 +232,8 @@ export const getPublicAPIMethods = () => { "workflows.updateStep", ]; - // next gen platform methods we want available but aren't listed quite yet - const nextGenPlatformMethods = [ - "functions.completeError", - "functions.completeSuccess", - ]; - const methodsSet = new Set([ ...publicAPIMethods, - ...nextGenPlatformMethods, ]); methodsWithCustomTypes.forEach((customMethod) => { diff --git a/src/generated/method-types/api_method_types_test.ts b/src/generated/method-types/api_method_types_test.ts index 083df9a..318adfc 100644 --- a/src/generated/method-types/api_method_types_test.ts +++ b/src/generated/method-types/api_method_types_test.ts @@ -139,6 +139,12 @@ Deno.test("SlackAPIMethodsType generated types", () => { assertEquals(typeof client.calls.participants.add, "function"); assertEquals(typeof client.calls.participants.remove, "function"); assertEquals(typeof client.calls.update, "function"); + assertEquals(typeof client.canvases.access.delete, "function"); + assertEquals(typeof client.canvases.access.set, "function"); + assertEquals(typeof client.canvases.create, "function"); + assertEquals(typeof client.canvases.delete, "function"); + assertEquals(typeof client.canvases.edit, "function"); + assertEquals(typeof client.canvases.sections.lookup, "function"); assertEquals(typeof client.chat.delete, "function"); assertEquals(typeof client.chat.deleteScheduledMessage, "function"); assertEquals(typeof client.chat.getPermalink, "function"); @@ -151,6 +157,7 @@ Deno.test("SlackAPIMethodsType generated types", () => { assertEquals(typeof client.conversations.acceptSharedInvite, "function"); assertEquals(typeof client.conversations.approveSharedInvite, "function"); assertEquals(typeof client.conversations.archive, "function"); + assertEquals(typeof client.conversations.canvases.create, "function"); assertEquals(typeof client.conversations.close, "function"); assertEquals(typeof client.conversations.create, "function"); assertEquals(typeof client.conversations.declineSharedInvite, "function"); diff --git a/src/generated/method-types/canvases.ts b/src/generated/method-types/canvases.ts new file mode 100644 index 0000000..e6f2800 --- /dev/null +++ b/src/generated/method-types/canvases.ts @@ -0,0 +1,14 @@ +import type { SlackAPIMethod } from "../../types.ts"; + +export type CanvasesAPIType = { + access: { + delete: SlackAPIMethod; + set: SlackAPIMethod; + }; + create: SlackAPIMethod; + delete: SlackAPIMethod; + edit: SlackAPIMethod; + sections: { + lookup: SlackAPIMethod; + }; +}; diff --git a/src/generated/method-types/conversations.ts b/src/generated/method-types/conversations.ts index b440955..9b56891 100644 --- a/src/generated/method-types/conversations.ts +++ b/src/generated/method-types/conversations.ts @@ -7,6 +7,9 @@ export type ConversationsAPIType = { acceptSharedInvite: SlackAPIMethod; approveSharedInvite: SlackAPIMethod; archive: SlackAPIMethod; + canvases: { + create: SlackAPIMethod; + }; close: SlackAPIMethod; create: SlackAPIMethod; declineSharedInvite: SlackAPIMethod; diff --git a/src/generated/method-types/mod.ts b/src/generated/method-types/mod.ts index e63e139..c85ad84 100644 --- a/src/generated/method-types/mod.ts +++ b/src/generated/method-types/mod.ts @@ -5,6 +5,7 @@ import { type AuthAPIType } from "./auth.ts"; import { type BookmarksAPIType } from "./bookmarks.ts"; import { type BotsAPIType } from "./bots.ts"; import { type CallsAPIType } from "./calls.ts"; +import { type CanvasesAPIType } from "./canvases.ts"; import { type ChatAPIType } from "./chat.ts"; import { type ConversationsAPIType } from "./conversations.ts"; import { type DialogAPIType } from "./dialog.ts"; @@ -36,6 +37,7 @@ export type SlackAPIMethodsType = { bookmarks: BookmarksAPIType; bots: BotsAPIType; calls: CallsAPIType; + canvases: CanvasesAPIType; chat: ChatAPIType; conversations: ConversationsAPIType; dialog: DialogAPIType;