diff --git a/backend/serverless/.gitignore b/backend/serverless/.gitignore deleted file mode 100644 index 3c0be6ea..00000000 --- a/backend/serverless/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -node_modules -dist -.wrangler -.dev.vars - -# Change them to your taste: -package-lock.json -yarn.lock -pnpm-lock.yaml -bun.lockb \ No newline at end of file diff --git a/backend/serverless/.yarnrc b/backend/serverless/.yarnrc deleted file mode 100644 index cf16ca24..00000000 --- a/backend/serverless/.yarnrc +++ /dev/null @@ -1,13 +0,0 @@ -# backend/ws/.yarnrc - -# Use Workspaces (if needed, though it's typically inherited) -workspaces-experimental true - -"@paybox:registry" "https://registry.yarnpkg.com/" - -# Specify private registry for private packages -# "@paybox:registry" "https://your-private-registry-url/" - -# Use selective version resolutions if needed -# For example, to specify a different version of a package for this workspace -# "@paybox/ws" "1.0.0" diff --git a/backend/serverless/CHANGELOG.md b/backend/serverless/CHANGELOG.md deleted file mode 100644 index eb16e6ce..00000000 --- a/backend/serverless/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -# @paybox/serverless - -## 0.0.9 - -### Patch Changes - -- 2f0d245: feat: updating scripts and pipeline and adding some actions - -## 0.0.8 - -### Patch Changes - -- init package publishing diff --git a/backend/serverless/README.md b/backend/serverless/README.md deleted file mode 100644 index cc58e962..00000000 --- a/backend/serverless/README.md +++ /dev/null @@ -1,8 +0,0 @@ -``` -npm install -npm run dev -``` - -``` -npm run deploy -``` diff --git a/backend/serverless/package.json b/backend/serverless/package.json deleted file mode 100644 index bcee22e0..00000000 --- a/backend/serverless/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@paybox/serverless", - "version": "0.0.9", - "main": "./src/index.ts", - "types": "./src/index.ts", - "type": "commonjs", - "license": "MIT", - "private": "true", - "scripts": { - "dev": "wrangler dev src/index.ts", - "deploy": "wrangler deploy --minify src/index.ts" - }, - "dependencies": { - "hono": "^4.0.8" - }, - "devDependencies": { - "@cloudflare/workers-types": "^4.20240208.0", - "@types/morgan": "^1.9.9", - "morgan": "^1.10.0", - "wrangler": "^3.25.0" - } -} diff --git a/backend/serverless/src/auth/utils.ts b/backend/serverless/src/auth/utils.ts deleted file mode 100644 index bcb81abb..00000000 --- a/backend/serverless/src/auth/utils.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { importPKCS8, importSPKI, jwtVerify, SignJWT } from "jose"; -import bcryptjs from "bcryptjs"; -import { AUTH_JWT_PRIVATE_KEY, JWT_ALGO } from "@paybox/common"; - -export const createJwt = async (userId: string) => { - const secret = await importPKCS8(AUTH_JWT_PRIVATE_KEY, JWT_ALGO); - - const jwt = await new SignJWT({ - sub: userId, - }) - .setProtectedHeader({ alg: JWT_ALGO }) - .setIssuer("shawakash") - .setAudience("payBox") - .setIssuedAt() - .sign(secret); - - return jwt; -}; diff --git a/backend/serverless/src/index.ts b/backend/serverless/src/index.ts deleted file mode 100644 index b897b14d..00000000 --- a/backend/serverless/src/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Hono } from "hono"; -import { cors } from "hono/cors"; -import { clientRouter } from "./route/client"; - -export const app = new Hono<{ - Bindings: {}; -}>(); - -app.use( - "/*", - cors({ - origin: `*`, - allowHeaders: ["X-Custom-Header", "Upgrade-Insecure-Requests"], - allowMethods: ["POST", "GET", "OPTIONS", "HEAD", "PUT", "PATCH", "DELETE"], - exposeHeaders: ["Content-Length", "Authorization"], - maxAge: 600, - credentials: true, - }), -); - -app.get("/", (c) => { - return c.json({ - message: "OK", - timestamp: Date.now(), - }); -}); - -app.get("/_health", (c) => { - return c.json({ - message: "OK", - timestamp: Date.now(), - }); -}); - -app.route("/api/v1/client", clientRouter); - -export default app; diff --git a/backend/serverless/src/route/client.ts b/backend/serverless/src/route/client.ts deleted file mode 100644 index e49458a1..00000000 --- a/backend/serverless/src/route/client.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Hono } from "hono"; - -export const clientRouter = new Hono<{ - Bindings: {}; -}>(); - -clientRouter.post("/", async (c) => {}); diff --git a/backend/serverless/tsconfig.json b/backend/serverless/tsconfig.json deleted file mode 100644 index 33a96fd0..00000000 --- a/backend/serverless/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "target": "ESNext", - "module": "ESNext", - "moduleResolution": "Bundler", - "strict": true, - "lib": [ - "ESNext" - ], - "types": [ - "@cloudflare/workers-types" - ], - "jsx": "react-jsx", - "jsxImportSource": "hono/jsx" - }, -} \ No newline at end of file diff --git a/backend/serverless/wrangler.toml b/backend/serverless/wrangler.toml deleted file mode 100644 index d21194a1..00000000 --- a/backend/serverless/wrangler.toml +++ /dev/null @@ -1,18 +0,0 @@ -name = "serverless" -compatibility_date = "2023-12-01" - -# [vars] -# MY_VARIABLE = "production_value" - -# [[kv_namespaces]] -# binding = "MY_KV_NAMESPACE" -# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - -# [[r2_buckets]] -# binding = "MY_BUCKET" -# bucket_name = "my-bucket" - -# [[d1_databases]] -# binding = "DB" -# database_name = "my-database" -# database_id = ""