Skip to content

Commit

Permalink
fix(github): mts to js files (#48)
Browse files Browse the repository at this point in the history
* fix(github): mts to js files

* fix(github): mts to js files

* fix(github): mts to js files
  • Loading branch information
ekeren authored Jan 2, 2024
1 parent 58dd1bb commit 3cfb0d9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion github/lib.w
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub class ProbotApp {
var onPullRequestOpenedHandler: inflight (probot.PullRequestOpenedContext): void;
var onPullRequestReopenedHandler: inflight (probot.PullRequestOpenedContext): void;

extern "./probot/probot.mts" pub static inflight createGithubAppJwt(appId: str, privateKey: str): str;
extern "./probot/probot.js" pub static inflight createGithubAppJwt(appId: str, privateKey: str): str;

new(props: ProbotAppProps) {
this.appId = props.appId;
Expand Down
2 changes: 1 addition & 1 deletion github/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@winglibs/github",
"description": "A Wing library for GitHub Probot",
"version": "0.0.1",
"version": "0.0.2",
"author": {
"name": "Elad Cohen",
"email": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion github/probot/adapter.w
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct CreateAdapterOptions {
}

pub class ProbotAdapter {
extern "./probot.mts" pub static inflight createProbotAdapter(options: CreateAdapterOptions): probot.ProbotInstance;
extern "./probot.js" pub static inflight createProbotAdapter(options: CreateAdapterOptions): probot.ProbotInstance;

pub appId: cloud.Secret;
pub privateKey: cloud.Secret;
Expand Down
9 changes: 2 additions & 7 deletions github/probot/probot.mts → github/probot/probot.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import { createProbot } from "@probot/adapter-aws-lambda-serverless";
import jwt from "jsonwebtoken";

export interface CreateProbotAdapterOptions {
appId: number;
privateKey: string;
webhookSecret: string;
}

export const createProbotAdapter = async (
options: CreateProbotAdapterOptions,
options,
) => {
const probot = createProbot({
overrides: {
Expand All @@ -23,7 +18,7 @@ export const createProbotAdapter = async (
return probot;
};

export const createGithubAppJwt = async (appId: string, privateKey: string) => {
export const createGithubAppJwt = async (appId, privateKey) => {
const now = Math.floor(Date.now() / 1000) - 30;
const expiration = now + 60 * 10; // JWT expiration time (10 minute maximum)

Expand Down

0 comments on commit 3cfb0d9

Please sign in to comment.