Skip to content

Commit

Permalink
Update Deno code
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Apr 15, 2024
1 parent f482b33 commit e7cdb32
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 33 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,9 @@ const app = new SlackApp<SlackEdgeAppEnv>({

// Add listeners here

await Deno.serve(
{ port: 3000 },
async (request) => { return await app.run(request); },
);
await Deno.serve({ port: 3000 }, async (request) => {
return await app.run(request);
});
```

You can run the app by:
Expand Down
4 changes: 2 additions & 2 deletions src_deno/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
import {
ResponseUrlSender,
SlackAPIClient,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";
import {
builtBaseContext,
SlackAppContext,
Expand All @@ -55,7 +55,7 @@ import { Middleware, PreAuthorizeMiddleware } from "./middleware/middleware.ts";
import {
isDebugLogEnabled,
prettyPrint,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";
import { Authorize } from "./authorization/authorize.ts";
import { AuthorizeResult } from "./authorization/authorize-result.ts";
import {
Expand Down
2 changes: 1 addition & 1 deletion src_deno/authorization/single-team-authorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
AuthTestResponse,
SlackAPIClient,
SlackAPIError,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";
import { Authorize } from "./authorize.ts";

export const singleTeamAuthorize: Authorize = async (req) => {
Expand Down
2 changes: 1 addition & 1 deletion src_deno/context/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ChatPostMessageResponse,
SlackAPIClient,
WebhookParams,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";

export interface PreAuthorizeSlackAppContext {
isEnterpriseinstall?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src_deno/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export * from "./app.ts";
export * from "./app-env.ts";
export * from "./execution-context.ts";

export * from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
export * from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";

export * from "./errors.ts";
export * from "./oauth/error-codes.ts";
Expand Down
2 changes: 1 addition & 1 deletion src_deno/oauth-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
OAuthV2AccessResponse,
OpenIDConnectTokenResponse,
SlackAPIClient,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";
import { toInstallation } from "./oauth/installation.ts";
import {
AfterInstallation,
Expand Down
2 changes: 1 addition & 1 deletion src_deno/oauth/callback.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OAuthV2AccessResponse } from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
import { OAuthV2AccessResponse } from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";
import { InvalidStateParameter, OAuthErrorCode } from "./error-codes.ts";
import { Installation } from "./installation.ts";
import {
Expand Down
2 changes: 1 addition & 1 deletion src_deno/oauth/installation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OAuthV2AccessResponse } from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
import { OAuthV2AccessResponse } from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";

export interface Installation {
app_id: string;
Expand Down
4 changes: 2 additions & 2 deletions src_deno/oidc/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { SlackLoggingLevel } from "../app-env.ts";
import {
OpenIDConnectTokenResponse,
SlackAPIClient,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
import { prettyPrint } from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";
import { prettyPrint } from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";

export interface OpenIDConnectCallbackArgs {
env: SlackLoggingLevel;
Expand Down
2 changes: 1 addition & 1 deletion src_deno/oidc/login.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
OpenIDConnectTokenResponse,
OpenIDConnectUserInfoResponse,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";

export interface Login {
enterprise_id?: string;
Expand Down
2 changes: 1 addition & 1 deletion src_deno/request/payload/block-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
MessageAttachment,
MessageMetadata,
PlainTextField,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";
import { DataSubmissionView, ViewStateValue } from "./view-objects.ts";
import { BotProfile } from "./event.ts";

Expand Down
2 changes: 1 addition & 1 deletion src_deno/request/payload/block-suggestion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnyOption } from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
import { AnyOption } from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";
import { DataSubmissionView } from "./view-objects.ts";

export interface BlockSuggestion {
Expand Down
2 changes: 1 addition & 1 deletion src_deno/request/payload/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
HomeTabView,
MessageAttachment,
MessageMetadata,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";

export type AnySlackEvent =
| AppRequestedEvent
Expand Down
2 changes: 1 addition & 1 deletion src_deno/request/payload/view-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
AnyModalBlock,
PlainTextField,
RichTextBlock,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";

export interface ViewStateSelectedOption {
text: PlainTextField;
Expand Down
2 changes: 1 addition & 1 deletion src_deno/response/response-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MessageAttachment,
MessageMetadata,
ModalView,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";

export interface MessageResponse {
response_type?: "ephemeral" | "in_channel";
Expand Down
2 changes: 1 addition & 1 deletion src_deno/socket-mode/socket-mode-client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
isDebugLogEnabled,
SlackAPIClient,
} from "https://deno.land/x/slack_web_api_client@0.10.1/mod.ts";
} from "https://deno.land/x/slack_web_api_client@0.10.4/mod.ts";
import { SlackApp } from "../app.ts";
import { ConfigError, SocketModeError } from "../errors.ts";
import { SlackSocketModeAppEnv } from "../app-env.ts";
Expand Down
9 changes: 3 additions & 6 deletions test/test-app-deno-oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ app.shortcut(

// deno run --watch --allow-net --allow-env --allow-read --allow-write test/test-app-deno-oauth.ts
// ngrok http 3000 --subdomain your-domain
await Deno.serve(
{ port: 3000 },
async (request) => {
return await app.run(request);
},
);
await Deno.serve({ port: 3000 }, async (request) => {
return await app.run(request);
});
9 changes: 3 additions & 6 deletions test/test-app-deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ app.shortcut(

// deno run --watch --allow-net --allow-env test/test-app-deno.ts
// ngrok http 3000 --subdomain your-domain
await Deno.serve(
{ port: 3000 },
async (request) => {
return await app.run(request);
},
);
await Deno.serve({ port: 3000 }, async (request) => {
return await app.run(request);
});

0 comments on commit e7cdb32

Please sign in to comment.