From 461155bea8c7e935c956d10ebcdc4f88aab0f788 Mon Sep 17 00:00:00 2001 From: pulgueta Date: Tue, 27 Jan 2026 19:57:07 -0500 Subject: [PATCH 1/4] feat: create sandbox app to test sdk --- bun.lock | 8 +- docs/.env.example | 3 + docs/.gitignore | 24 ++ docs/README.md | 46 +++ docs/astro.config.mjs | 12 + docs/package.json | 22 ++ docs/public/favicon.ico | Bin 0 -> 655 bytes docs/public/favicon.svg | 9 + docs/src/layouts/Layout.astro | 504 +++++++++++++++++++++++++++++ docs/src/lib/config.ts | 57 ++++ docs/src/lib/nequi.ts | 46 +++ docs/src/pages/api/[...slug].ts | 226 +++++++++++++ docs/src/pages/dispersions.astro | 212 ++++++++++++ docs/src/pages/index.astro | 143 ++++++++ docs/src/pages/payments.astro | 232 +++++++++++++ docs/src/pages/qr.astro | 173 ++++++++++ docs/src/pages/reports.astro | 97 ++++++ docs/src/pages/subscriptions.astro | 264 +++++++++++++++ docs/tsconfig.json | 11 + packages/server/package.json | 2 +- 20 files changed, 2086 insertions(+), 5 deletions(-) create mode 100644 docs/.env.example create mode 100644 docs/.gitignore create mode 100644 docs/README.md create mode 100644 docs/astro.config.mjs create mode 100644 docs/package.json create mode 100644 docs/public/favicon.ico create mode 100644 docs/public/favicon.svg create mode 100644 docs/src/layouts/Layout.astro create mode 100644 docs/src/lib/config.ts create mode 100644 docs/src/lib/nequi.ts create mode 100644 docs/src/pages/api/[...slug].ts create mode 100644 docs/src/pages/dispersions.astro create mode 100644 docs/src/pages/index.astro create mode 100644 docs/src/pages/payments.astro create mode 100644 docs/src/pages/qr.astro create mode 100644 docs/src/pages/reports.astro create mode 100644 docs/src/pages/subscriptions.astro create mode 100644 docs/tsconfig.json diff --git a/bun.lock b/bun.lock index fc70f09..027c714 100644 --- a/bun.lock +++ b/bun.lock @@ -20,14 +20,14 @@ }, "packages/server": { "name": "@pulgueta/nequi-node", - "version": "1.0.0", - "dependencies": { - "zod": "^4.3.5", - }, + "version": "1.6.0", "devDependencies": { "@types/bun": "^1.3.6", "typescript": "^5.9.3", }, + "peerDependencies": { + "zod": "^4.3.5", + }, }, }, "packages": { diff --git a/docs/.env.example b/docs/.env.example new file mode 100644 index 0000000..c8a5942 --- /dev/null +++ b/docs/.env.example @@ -0,0 +1,3 @@ +NEQUI_CLIENT_ID=your_client_id_here +NEQUI_CLIENT_SECRET=your_client_secret_here +NEQUI_API_KEY=your_api_key_here diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..016b59e --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,24 @@ +# build output +dist/ + +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store + +# jetbrains setting folder +.idea/ diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..b6de9b9 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,46 @@ +# Astro Starter Kit: Basics + +```sh +bun create astro@latest -- --template basics +``` + +> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun! + +## 🚀 Project Structure + +Inside of your Astro project, you'll see the following folders and files: + +```text +/ +├── public/ +│ └── favicon.svg +├── src +│   ├── assets +│   │   └── astro.svg +│   ├── components +│   │   └── Welcome.astro +│   ├── layouts +│   │   └── Layout.astro +│   └── pages +│   └── index.astro +└── package.json +``` + +To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/). + +## 🧞 Commands + +All commands are run from the root of the project, from a terminal: + +| Command | Action | +| :------------------------ | :----------------------------------------------- | +| `bun install` | Installs dependencies | +| `bun dev` | Starts local dev server at `localhost:4321` | +| `bun build` | Build your production site to `./dist/` | +| `bun preview` | Preview your build locally, before deploying | +| `bun astro ...` | Run CLI commands like `astro add`, `astro check` | +| `bun astro -- --help` | Get help using the Astro CLI | + +## 👀 Want to learn more? + +Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs new file mode 100644 index 0000000..2a52043 --- /dev/null +++ b/docs/astro.config.mjs @@ -0,0 +1,12 @@ +// @ts-check + +import node from "@astrojs/node"; +import { defineConfig } from "astro/config"; + +// https://astro.build/config +export default defineConfig({ + output: "server", + adapter: node({ + mode: "standalone", + }), +}); diff --git a/docs/package.json b/docs/package.json new file mode 100644 index 0000000..6f2dedb --- /dev/null +++ b/docs/package.json @@ -0,0 +1,22 @@ +{ + "name": "docs", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/node": "^9.2.3", + "@pulgueta/nequi-node": "workspace:*", + "astro": "^5.16.15", + "elysia": "^1.4.22", + "zod": "^4.3.5" + }, + "devDependencies": { + "@types/bun": "^1.3.6", + "typescript": "^5.9.3" + } +} diff --git a/docs/public/favicon.ico b/docs/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..7f48a94d16071d6c8d06478c7458ab12e675019c GIT binary patch literal 655 zcmV;A0&x9_P)Rl-XF(A`bsas&GH{e7U1}Ri zJr5jR8B2*Jd6$=$AqgTM2o2FV$WZ9|#jJ3mmpEs{jB0ps@*Kxv}=RB|IJih8Z&fqwCG`%bN0000#bW%=J zQ=IH#a_&L{B{_6Lu_3m>0bMN%+@aOmN_3G~H^8EGi>+bXO=;-|Z`uFnf==AdP z{Oj-S=ltmI=<4`LcLE*&009F@L_t(|+I`d4ZUZ3@1<*Uo7H^LoCw6-8z4wsbd;b4l zA}zMFtOw2mLX6O5Mgl}(5P=uOM4%=tnuHiuAp%(G<c=npm$Fz%eL + + + diff --git a/docs/src/layouts/Layout.astro b/docs/src/layouts/Layout.astro new file mode 100644 index 0000000..3894071 --- /dev/null +++ b/docs/src/layouts/Layout.astro @@ -0,0 +1,504 @@ +--- +interface Props { + title: string; +} + +const { title } = Astro.props; +--- + + + + + + + + + + {title} + + + + + + + +
+ +
+ + + + + + diff --git a/docs/src/lib/config.ts b/docs/src/lib/config.ts new file mode 100644 index 0000000..491295d --- /dev/null +++ b/docs/src/lib/config.ts @@ -0,0 +1,57 @@ +import { z } from "zod"; + +// Schema for credentials validation +export const credentialsSchema = z.object({ + clientId: z.string().min(1, "Client ID is required"), + clientSecret: z.string().min(1, "Client secret is required"), + apiKey: z.string().min(1, "API key is required"), +}); + +export type Credentials = z.infer; + +// Check if we're running in production (deployed) or development (local) +export const isProduction = process.env.NODE_ENV === "production"; + +// Environment variables schema for development mode +const envSchema = z.object({ + NEQUI_CLIENT_ID: z.string().min(1, "Client ID is required"), + NEQUI_CLIENT_SECRET: z.string().min(1, "Client secret is required"), + NEQUI_API_KEY: z.string().min(1, "API key is required"), +}); + +// Parse environment variables (only used in development) +const parseEnv = () => { + if (isProduction) { + return { + isConfigured: false, + errors: [], + config: null, + }; + } + + const result = envSchema.safeParse({ + NEQUI_CLIENT_ID: process.env.NEQUI_CLIENT_ID, + NEQUI_CLIENT_SECRET: process.env.NEQUI_CLIENT_SECRET, + NEQUI_API_KEY: process.env.NEQUI_API_KEY, + }); + + if (!result.success) { + return { + isConfigured: false, + errors: result.error.issues.map((i: z.ZodIssue) => i.message), + config: null, + }; + } + + return { + isConfigured: true, + errors: [], + config: { + clientId: result.data.NEQUI_CLIENT_ID, + clientSecret: result.data.NEQUI_CLIENT_SECRET, + apiKey: result.data.NEQUI_API_KEY, + } satisfies Credentials, + }; +}; + +export const { isConfigured, errors, config } = parseEnv(); diff --git a/docs/src/lib/nequi.ts b/docs/src/lib/nequi.ts new file mode 100644 index 0000000..1648c93 --- /dev/null +++ b/docs/src/lib/nequi.ts @@ -0,0 +1,46 @@ +import { Nequi } from "@pulgueta/nequi-node"; +import type { Credentials } from "./config"; +import { config, credentialsSchema, isConfigured, isProduction } from "./config"; + +/** + * Create a Nequi SDK instance with the provided credentials + * Environment is always "development" (sandbox) for testing + */ +export const createNequiInstance = (credentials: Credentials) => { + return new Nequi({ + apiKey: credentials.apiKey, + clientId: credentials.clientId, + clientSecret: credentials.clientSecret, + env: "development", // Always sandbox for testing + }); +}; + +/** + * Get Nequi SDK instance based on environment: + * - Production: requires credentials passed in the request + * - Development: uses environment variables + */ +export const getNequiFromRequest = (requestCredentials?: unknown) => { + // In production, credentials must be provided in the request + if (isProduction) { + if (!requestCredentials) { + return { nequi: null, error: "Credentials required" }; + } + + const parsed = credentialsSchema.safeParse(requestCredentials); + if (!parsed.success) { + return { nequi: null, error: "Invalid credentials format" }; + } + + return { nequi: createNequiInstance(parsed.data), error: null }; + } + + // In development, use environment variables + if (!isConfigured || !config) { + return { nequi: null, error: "SDK not configured. Check your .env.local file." }; + } + + return { nequi: createNequiInstance(config), error: null }; +}; + +export { isConfigured, isProduction, config }; diff --git a/docs/src/pages/api/[...slug].ts b/docs/src/pages/api/[...slug].ts new file mode 100644 index 0000000..41674bf --- /dev/null +++ b/docs/src/pages/api/[...slug].ts @@ -0,0 +1,226 @@ +import { Elysia } from "elysia"; +import { getNequiFromRequest, isConfigured, isProduction } from "../../lib/nequi"; + +// Helper to extract credentials and data from request body +const parseRequestBody = (body: unknown) => { + const { credentials, ...data } = (body || {}) as { + credentials?: unknown; + [key: string]: unknown; + }; + return { credentials, data }; +}; + +const app = new Elysia({ prefix: "/api" }) + // Health check and configuration status + .get("/health", () => ({ + isProduction, + isConfigured: isProduction ? false : isConfigured, + message: isProduction + ? "Production mode - provide credentials via the form" + : isConfigured + ? "SDK is ready (using .env.local)" + : "SDK credentials not configured in .env.local", + })) + + // Validate credentials (for production mode) + .post("/auth/validate", async ({ body }) => { + const { credentials } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "Invalid credentials" }; + } + + // We can't really validate without making an API call + // Just return success if credentials are properly formatted + return { success: true, message: "Credentials accepted" }; + }) + + // ============================================================================ + // QR Code Payments + // ============================================================================ + .post("/qr/create", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.qr.createQR(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + .post("/qr/status", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const { qrValue } = data as { qrValue: string }; + const [err, result] = await nequi.qr.getStatus(qrValue); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + .post("/qr/revert", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.qr.revert(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + // ============================================================================ + // Push Payments + // ============================================================================ + .post("/payments/create", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.pushPayment.createPayment(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + .post("/payments/status", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.pushPayment.getStatus(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + .post("/payments/cancel", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.pushPayment.cancel(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + .post("/payments/revert", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.pushPayment.revertTransaction(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + // ============================================================================ + // Subscriptions + // ============================================================================ + .post("/subscriptions/create", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.subscription.createSubscription(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + .post("/subscriptions/payment", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.subscription.automaticPayment(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + .post("/subscriptions/details", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.subscription.getSubscription(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + .post("/subscriptions/revert", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.subscription.reverseTransaction(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + // ============================================================================ + // Dispersions + // ============================================================================ + .post("/dispersions/create", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.dispersions.createDispersion(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + .post("/dispersions/revert", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.dispersions.reverseDispersion(data); + return { success: !err, message: err?.message || "Success", data: result }; + }) + + // ============================================================================ + // Reports + // ============================================================================ + .post("/reports/get", async ({ body }) => { + const { credentials, data } = parseRequestBody(body); + const { nequi, error } = getNequiFromRequest(credentials); + + if (error || !nequi) { + return { success: false, message: error || "SDK not configured", data: null }; + } + + const [err, result] = await nequi.reports.getReports(data); + return { success: !err, message: err?.message || "Success", data: result }; + }); + +const handle = ({ request }: { request: Request }) => app.handle(request); + +export const GET = handle; +export const POST = handle; diff --git a/docs/src/pages/dispersions.astro b/docs/src/pages/dispersions.astro new file mode 100644 index 0000000..b3b1b52 --- /dev/null +++ b/docs/src/pages/dispersions.astro @@ -0,0 +1,212 @@ +--- +import Layout from "../layouts/Layout.astro"; +--- + + +

Dispersions

+ + +
+

Create Dispersion (Send Funds)

+
+
+ + +

Commerce code (NIT/RUC/etc.)

+
+
+ + +

Your internal tracking/unique ID

+
+
+ + +

Beneficiary's Nequi phone number

+
+
+ + +

Amount to disperse (string)

+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+ + +
+

Reverse Dispersion

+
+
+ + +
+
+ + +

Same tracking ID used in the original dispersion

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+ + diff --git a/docs/src/pages/index.astro b/docs/src/pages/index.astro new file mode 100644 index 0000000..e6d862c --- /dev/null +++ b/docs/src/pages/index.astro @@ -0,0 +1,143 @@ +--- +import Layout from "../layouts/Layout.astro"; +--- + + +

Nequi SDK Test Application

+ +
+

Configuration Status

+

Loading...

+
+ +

Test Endpoints

+ + +
+

SDK Usage Pattern

+

+ The SDK uses a tuple pattern [error, data] for all responses: +

+
{`const [error, data] = await nequi.qr.createQR({
+  code: "NIT_1",
+  value: "1000",
+});
+
+if (error) {
+  console.error(error.message);
+  return;
+}
+
+console.log(data);`}
+
+
+ + diff --git a/docs/src/pages/payments.astro b/docs/src/pages/payments.astro new file mode 100644 index 0000000..03d439d --- /dev/null +++ b/docs/src/pages/payments.astro @@ -0,0 +1,232 @@ +--- +import Layout from "../layouts/Layout.astro"; +--- + + +

Push Payments

+ + +
+

Create Push Payment

+
+
+ + +

Customer's Nequi phone number

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+ + +
+

Get Payment Status

+
+
+ + +
+ +
+
+
+
+ + +
+

Cancel Payment

+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+ + +
+

Revert Transaction

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+ + diff --git a/docs/src/pages/qr.astro b/docs/src/pages/qr.astro new file mode 100644 index 0000000..4c8277f --- /dev/null +++ b/docs/src/pages/qr.astro @@ -0,0 +1,173 @@ +--- +import Layout from "../layouts/Layout.astro"; +--- + + +

QR Code Payments

+ + +
+

Generate QR Code

+
+
+ + +

Merchant identifier (e.g., NIT_1)

+
+
+ + +

Amount to charge (string)

+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+ + +
+

Get QR Payment Status

+
+
+ + +

The qrValue returned from generateCodeQR

+
+ +
+
+
+
+ + +
+

Reverse QR Transaction

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+ + diff --git a/docs/src/pages/reports.astro b/docs/src/pages/reports.astro new file mode 100644 index 0000000..9e0f69c --- /dev/null +++ b/docs/src/pages/reports.astro @@ -0,0 +1,97 @@ +--- +import Layout from "../layouts/Layout.astro"; +--- + + +

Reports

+ + +
+

Get Transaction Reports

+
+
+ + +

Commerce identifier (NIT/CC/CE/RUC)

+
+
+ + +

Report start date (YYYY-MM-DD)

+
+
+ + +

Report end date (YYYY-MM-DD)

+
+
+ + +

Output format for the report

+
+ +
+
+
+
+
+ + diff --git a/docs/src/pages/subscriptions.astro b/docs/src/pages/subscriptions.astro new file mode 100644 index 0000000..1b177c2 --- /dev/null +++ b/docs/src/pages/subscriptions.astro @@ -0,0 +1,264 @@ +--- +import Layout from "../layouts/Layout.astro"; +--- + + +

Subscriptions

+ + +
+

Create Subscription

+
+
+ + +

Customer's Nequi phone number

+
+
+ + +
+
+ + +
+ +
+
+
+
+ + +
+

Automatic Payment

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +

Token returned from the subscription creation

+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+ + +
+

Get Subscription Details

+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+ + +
+

Reverse Subscription Payment

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +

Must be "automaticPayment" for subscription reversals

+
+ +
+
+
+
+
+ + diff --git a/docs/tsconfig.json b/docs/tsconfig.json new file mode 100644 index 0000000..cea96c7 --- /dev/null +++ b/docs/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "astro/tsconfigs/strict", + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + } + }, + "include": [".astro/types.d.ts", "**/*"], + "exclude": ["dist"] +} diff --git a/packages/server/package.json b/packages/server/package.json index df70424..41e9e38 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@pulgueta/nequi-node", "description": "SDK de la comunidad de Nequi para Node.js", - "version": "1.0.0", + "version": "1.6.0", "license": "MIT", "author": { "name": "Andrés Rodríguez", From 8300d19cdb11ca39db525a6ea949472111ef87e0 Mon Sep 17 00:00:00 2001 From: pulgueta Date: Tue, 27 Jan 2026 20:01:15 -0500 Subject: [PATCH 2/4] docs: update docs --- README.md | 94 +++++++++++--- packages/server/README.md | 262 ++++++++++++++++++++++++++++++++++++++ release.config.mjs | 4 +- 3 files changed, 340 insertions(+), 20 deletions(-) create mode 100644 packages/server/README.md diff --git a/README.md b/README.md index 0ab7eea..8ff59a6 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,98 @@ -# @pulgueta/nequi-node +# Nequi Node.js SDK -SDK de la comunidad de Nequi para Node.js +A community-driven TypeScript SDK for integrating with Nequi Conecta API in Node.js applications. -## Características +## Features -- Soporte para Node.js -- Soporte para TypeScript -- Fácil de usar +- ✅ **TypeScript Support** - Full type safety and IntelliSense +- ✅ **QR Code Payments** - Generate and manage QR code payments +- ✅ **Push Payments** - Send payment notifications to Nequi app users +- ✅ **Subscriptions** - Create and manage automatic subscription payments +- ✅ **Dispersions** - Send payments from your business account to Nequi accounts +- ✅ **Reports** - Retrieve transaction reports and analytics +- ✅ **Error Handling** - Comprehensive error handling with typed errors +- ✅ **Validation** - Built-in request validation using Zod schemas -## Instalación - -```sh -pnpm add @pulgueta/nequi-node +## Installation +```bash npm install @pulgueta/nequi-node - yarn add @pulgueta/nequi-node +pnpm add @pulgueta/nequi-node +bun add @pulgueta/nequi-node ``` -## Uso +## Quick Start -```ts +```typescript import { Nequi } from "@pulgueta/nequi-node"; const nequi = new Nequi({ apiKey: "your-api-key", clientId: "your-client-id", clientSecret: "your-client-secret", - // env: "development" | "production" basado en process.env.NODE_ENV + env: "development", // or "production" +}); + +// Generate a QR code for payment +const [error, data] = await nequi.qr.createQR({ + code: "NIT_1", + value: "1000", + reference1: "Order #123", }); + +if (error) { + console.error("Error:", error.message); + return; +} + +console.log("QR Code:", data); +``` + +## Documentation + +For detailed API documentation, see the [SDK Documentation](./packages/server/README.md). + +## Requirements + +- Node.js >= 24 +- Bun >= 1.3.5 + +## Development + +This is a monorepo managed with Bun workspaces. + +```bash +# Install dependencies +bun install + +# Build the SDK +bun run build:server + +# Run linting +bun run lint + +# Format code +bun run format + +# Run CI checks +bun run ci ``` -## Contribuciones +## Contributing + +Contributions are welcome! Please read the [CONTRIBUTING.md](./CONTRIBUTING.md) file for details on our code of conduct and the process for submitting pull requests. + +## License + +This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details. + +## Attribution -Las contribuciones son bienvenidas. Por favor, lee el [CONTRIBUTING.md](./CONTRIBUTING.md) para más detalles. +This SDK was originally developed by Andrés Rodríguez and is now accepting contributions from the community. Any official work or release based on this project must give appropriate credit and should not be claimed as work done solely by any entity, institution, or person. -## Atribuciones +## Links -Este SDK está desarrollado original e inicialmente por Andrés Rodríguez y posteriormente aceptando contribuciones de la comunidad. Cualquier trabajo o release oficial basado en este proyecto debe dársele el crédito correspondiente y no debería reclamarse como trabajo únicamente hecho por la entidad, institución o persona. +- [GitHub Repository](https://github.com/pulgueta/nequi-node) +- [Issue Tracker](https://github.com/pulgueta/nequi-node/issues) +- [NPM Package](https://www.npmjs.com/package/@pulgueta/nequi-node) diff --git a/packages/server/README.md b/packages/server/README.md new file mode 100644 index 0000000..30e3d2c --- /dev/null +++ b/packages/server/README.md @@ -0,0 +1,262 @@ +# Nequi Node.js SDK + +TypeScript SDK for integrating with Nequi Conecta API. + +## Installation + +```bash +npm install @pulgueta/nequi-node +``` + +## Configuration + +```typescript +import { Nequi } from "@pulgueta/nequi-node"; + +const nequi = new Nequi({ + apiKey: "your-api-key", // Required: API key from Nequi Conecta + clientId: "your-client-id", // Required: Client ID from Nequi Conecta + clientSecret: "your-client-secret", // Required: Client secret from Nequi Conecta + env: "development", // Optional: "development" | "production" (default: "development") +}); +``` + +## Error Handling + +All SDK methods return a tuple `[error, data]` pattern: + +```typescript +const [error, data] = await nequi.qr.createQR({...}); + +if (error) { + // Handle error + console.error(error.message); + console.error(error.status); + console.error(error.name); + return; +} + +// Use data +console.log(data); +``` + +## Services + +### QR Code Payments + +Generate QR codes for payments and check their status. + +```typescript +// Generate QR code +const [error, qrData] = await nequi.qr.createQR({ + code: "NIT_1", + value: "1000", + reference1: "Order #123", + reference2: "optional", + reference3: "optional", +}); + +// Get QR payment status +const [error, status] = await nequi.qr.getStatus({ + qrValue: "0002010102125303170540410005802CO...", +}); + +// Reverse QR transaction +const [error, result] = await nequi.qr.revert({ + qrValue: "0002010102125303170540410005802CO...", + phoneNumber: "3998764643", + value: "1000", + code: "NIT_1", +}); +``` + +### Push Payments + +Send payment notifications to customers' Nequi app. + +```typescript +// Create push payment +const [error, payment] = await nequi.pushPayment.createPayment({ + phoneNumber: "3998764643", + code: "NIT_1", + value: "1000", + reference1: "Order #123", + reference2: "optional", + reference3: "optional", +}); + +// Get payment status +const [error, status] = await nequi.pushPayment.getStatus({ + codeQR: "350-913291938-2471-C001", +}); + +// Cancel payment +const [error, result] = await nequi.pushPayment.cancel({ + code: "1", + phoneNumber: "3012146840", + transactionId: "350-3012146840-9232-8944090690", +}); + +// Revert transaction +const [error, result] = await nequi.pushPayment.revertTransaction({ + phoneNumber: "3998764643", + value: "1000", + code: "NIT_1", + messageId: "9857836163", + type: "payment", +}); +``` + +### Subscriptions + +Create and manage automatic subscription payments. + +```typescript +// Create subscription +const [error, subscription] = await nequi.subscription.createSubscription({ + phoneNumber: "3998764643", + code: "NIT_1", + name: "Premium Plan", +}); + +// Process automatic payment +const [error, payment] = await nequi.subscription.automaticPayment({ + phoneNumber: "3998764643", + code: "NIT_1", + value: "1000", + token: subscription.token, // Token from createSubscription + reference1: "Monthly payment", +}); + +// Get subscription details +const [error, details] = await nequi.subscription.getSubscription({ + phoneNumber: "3998764643", + code: "NIT_1", + token: subscription.token, +}); + +// Reverse subscription transaction +const [error, result] = await nequi.subscription.reverseTransaction({ + phoneNumber: "3998764643", + value: "100", + code: "NIT_1", + messageId: "9857836163", + type: "automaticPayment", +}); +``` + +### Dispersions + +Send payments from your business account to Nequi accounts. + +```typescript +// Disperse funds +const [error, result] = await nequi.dispersions.createDispersion({ + code: "NIT_440627004_00", + trackingID: "DAN123456789", + phoneNumber: "3998764643", + value: "1000", + reference1: "Payroll", + reference2: "optional", + reference3: "optional", +}); + +// Reverse dispersion +const [error, result] = await nequi.dispersions.reverseDispersion({ + code: "NIT_440627004_00", + trackingID: "DAN123456789", + phoneNumber: "3998764643", + value: "1000", + reference1: "Payroll", + reference2: "optional", + reference3: "optional", +}); +``` + +### Reports + +Retrieve transaction reports and analytics. + +```typescript +// Get reports +const [error, reports] = await nequi.reports.getReports({ + code: "NIT_901049033", + startDate: "2018-09-01", + endDate: "2018-09-09", + format: "json", // "json" | "csv" | "pdf" +}); +``` + +## Types + +The SDK exports TypeScript types for all request and response schemas: + +```typescript +import type { + GenerateCodeQRRQ, + GetQRStatusPaymentRQ, + UnregisteredPaymentRQ, + AutomaticPaymentRQ, + DisperseFundsRQ, + GetReportsRQ, + // ... and more +} from "@pulgueta/nequi-node"; +``` + +## Error Types + +```typescript +import { NequiError } from "@pulgueta/nequi-node"; + +// Check if error is NequiError +if (NequiError.isNequiError(error)) { + console.error(error.name); // Error code name + console.error(error.message); // Error message + console.error(error.status); // HTTP status code +} +``` + +## Advanced Usage + +### Custom Request Building + +```typescript +import { buildRequestHeader, buildRequestMessage } from "@pulgueta/nequi-node"; + +const header = buildRequestHeader("PQR03-C001", "client-id", { + ServiceName: "PaymentsService", + ServiceOperation: "generateCodeQR", + ServiceRegion: "C001", + ServiceVersion: "1.2.0", +}); +``` + +### Validation Utilities + +```typescript +import { safeParse, isSuccessResponse } from "@pulgueta/nequi-node"; +import { GenerateCodeQRRQSchema } from "@pulgueta/nequi-node"; + +const [error, validated] = safeParse(GenerateCodeQRRQSchema, { + code: "NIT_1", + value: "1000", +}); + +// Check response status +if (isSuccessResponse("0")) { + // Success +} +``` + +## Additional Documentation + +- [Push Payments](./PUSH-PAYMENTS.md) +- [QR Code Payments](./QR-CODE-PAYMENTS.md) +- [Subscriptions](./SUBSCRIPTIONS.md) +- [Dispersions](./DISPERTIONS.md) +- [Reports](./REPORTS.md) +- [Security Token](./SECURITY-TOKEN.md) + +## Support + +For issues and questions, please visit the [GitHub repository](https://github.com/pulgueta/nequi-node/issues). diff --git a/release.config.mjs b/release.config.mjs index 5130d26..409634a 100644 --- a/release.config.mjs +++ b/release.config.mjs @@ -12,14 +12,14 @@ export default { [ "@semantic-release/changelog", { - "changelogFile": "CHANGELOG.md" + "changelogFile": "./packages/server/CHANGELOG.md" } ], [ "@semantic-release/git", { "assets": [ - "CHANGELOG.md" + "./packages/server/CHANGELOG.md" ] } ], From fe8f8e04a0cfd0bb84bde7acbb0454f0bdc00aa6 Mon Sep 17 00:00:00 2001 From: pulgueta Date: Tue, 27 Jan 2026 20:17:31 -0500 Subject: [PATCH 3/4] feat: build package with tsup --- .github/workflows/release.yaml | 8 +- bun.lock | 177 ++++++++++++++++++++++++++++++++- packages/server/package.json | 4 +- packages/server/tsup.config.ts | 12 +++ 4 files changed, 189 insertions(+), 12 deletions(-) create mode 100644 packages/server/tsup.config.ts diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 158b713..dd7a7a5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,13 +41,7 @@ jobs: extra_plugins: | @semantic-release/changelog @semantic-release/git + @semantic-release/npm env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Publish package to NPM - working-directory: packages/server - env: - BUN_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - bun publish diff --git a/bun.lock b/bun.lock index 027c714..a8c5e49 100644 --- a/bun.lock +++ b/bun.lock @@ -21,13 +21,14 @@ "packages/server": { "name": "@pulgueta/nequi-node", "version": "1.6.0", + "dependencies": { + "zod": "^4.3.5", + }, "devDependencies": { "@types/bun": "^1.3.6", + "tsup": "^8.5.1", "typescript": "^5.9.3", }, - "peerDependencies": { - "zod": "^4.3.5", - }, }, }, "packages": { @@ -63,8 +64,68 @@ "@colors/colors": ["@colors/colors@1.5.0", "", {}, "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ=="], + "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.27.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw=="], + + "@esbuild/android-arm": ["@esbuild/android-arm@0.27.2", "", { "os": "android", "cpu": "arm" }, "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA=="], + + "@esbuild/android-arm64": ["@esbuild/android-arm64@0.27.2", "", { "os": "android", "cpu": "arm64" }, "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA=="], + + "@esbuild/android-x64": ["@esbuild/android-x64@0.27.2", "", { "os": "android", "cpu": "x64" }, "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A=="], + + "@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.27.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg=="], + + "@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.27.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA=="], + + "@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.27.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g=="], + + "@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.27.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA=="], + + "@esbuild/linux-arm": ["@esbuild/linux-arm@0.27.2", "", { "os": "linux", "cpu": "arm" }, "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw=="], + + "@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.27.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw=="], + + "@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.27.2", "", { "os": "linux", "cpu": "ia32" }, "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w=="], + + "@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.27.2", "", { "os": "linux", "cpu": "none" }, "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg=="], + + "@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.27.2", "", { "os": "linux", "cpu": "none" }, "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw=="], + + "@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.27.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ=="], + + "@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.27.2", "", { "os": "linux", "cpu": "none" }, "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA=="], + + "@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.27.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w=="], + + "@esbuild/linux-x64": ["@esbuild/linux-x64@0.27.2", "", { "os": "linux", "cpu": "x64" }, "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA=="], + + "@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.27.2", "", { "os": "none", "cpu": "arm64" }, "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw=="], + + "@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.27.2", "", { "os": "none", "cpu": "x64" }, "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA=="], + + "@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.27.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA=="], + + "@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.27.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg=="], + + "@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.27.2", "", { "os": "none", "cpu": "arm64" }, "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag=="], + + "@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.27.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg=="], + + "@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.27.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg=="], + + "@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.27.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ=="], + + "@esbuild/win32-x64": ["@esbuild/win32-x64@0.27.2", "", { "os": "win32", "cpu": "x64" }, "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ=="], + "@fastify/busboy": ["@fastify/busboy@2.1.1", "", {}, "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA=="], + "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="], + + "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], + + "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="], + + "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], + "@octokit/auth-token": ["@octokit/auth-token@6.0.0", "", {}, "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w=="], "@octokit/core": ["@octokit/core@7.0.6", "", { "dependencies": { "@octokit/auth-token": "^6.0.0", "@octokit/graphql": "^9.0.3", "@octokit/request": "^10.0.6", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "before-after-hook": "^4.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q=="], @@ -95,6 +156,56 @@ "@pulgueta/nequi-node": ["@pulgueta/nequi-node@workspace:packages/server"], + "@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.57.0", "", { "os": "android", "cpu": "arm" }, "sha512-tPgXB6cDTndIe1ah7u6amCI1T0SsnlOuKgg10Xh3uizJk4e5M1JGaUMk7J4ciuAUcFpbOiNhm2XIjP9ON0dUqA=="], + + "@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.57.0", "", { "os": "android", "cpu": "arm64" }, "sha512-sa4LyseLLXr1onr97StkU1Nb7fWcg6niokTwEVNOO7awaKaoRObQ54+V/hrF/BP1noMEaaAW6Fg2d/CfLiq3Mg=="], + + "@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.57.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-/NNIj9A7yLjKdmkx5dC2XQ9DmjIECpGpwHoGmA5E1AhU0fuICSqSWScPhN1yLCkEdkCwJIDu2xIeLPs60MNIVg=="], + + "@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.57.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-xoh8abqgPrPYPr7pTYipqnUi1V3em56JzE/HgDgitTqZBZ3yKCWI+7KUkceM6tNweyUKYru1UMi7FC060RyKwA=="], + + "@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.57.0", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-PCkMh7fNahWSbA0OTUQ2OpYHpjZZr0hPr8lId8twD7a7SeWrvT3xJVyza+dQwXSSq4yEQTMoXgNOfMCsn8584g=="], + + "@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.57.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-1j3stGx+qbhXql4OCDZhnK7b01s6rBKNybfsX+TNrEe9JNq4DLi1yGiR1xW+nL+FNVvI4D02PUnl6gJ/2y6WJA=="], + + "@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.57.0", "", { "os": "linux", "cpu": "arm" }, "sha512-eyrr5W08Ms9uM0mLcKfM/Uzx7hjhz2bcjv8P2uynfj0yU8GGPdz8iYrBPhiLOZqahoAMB8ZiolRZPbbU2MAi6Q=="], + + "@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.57.0", "", { "os": "linux", "cpu": "arm" }, "sha512-Xds90ITXJCNyX9pDhqf85MKWUI4lqjiPAipJ8OLp8xqI2Ehk+TCVhF9rvOoN8xTbcafow3QOThkNnrM33uCFQA=="], + + "@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.57.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-Xws2KA4CLvZmXjy46SQaXSejuKPhwVdaNinldoYfqruZBaJHqVo6hnRa8SDo9z7PBW5x84SH64+izmldCgbezw=="], + + "@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.57.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-hrKXKbX5FdaRJj7lTMusmvKbhMJSGWJ+w++4KmjiDhpTgNlhYobMvKfDoIWecy4O60K6yA4SnztGuNTQF+Lplw=="], + + "@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.57.0", "", { "os": "linux", "cpu": "none" }, "sha512-6A+nccfSDGKsPm00d3xKcrsBcbqzCTAukjwWK6rbuAnB2bHaL3r9720HBVZ/no7+FhZLz/U3GwwZZEh6tOSI8Q=="], + + "@rollup/rollup-linux-loong64-musl": ["@rollup/rollup-linux-loong64-musl@4.57.0", "", { "os": "linux", "cpu": "none" }, "sha512-4P1VyYUe6XAJtQH1Hh99THxr0GKMMwIXsRNOceLrJnaHTDgk1FTcTimDgneRJPvB3LqDQxUmroBclQ1S0cIJwQ=="], + + "@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.57.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-8Vv6pLuIZCMcgXre6c3nOPhE0gjz1+nZP6T+hwWjr7sVH8k0jRkH+XnfjjOTglyMBdSKBPPz54/y1gToSKwrSQ=="], + + "@rollup/rollup-linux-ppc64-musl": ["@rollup/rollup-linux-ppc64-musl@4.57.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-r1te1M0Sm2TBVD/RxBPC6RZVwNqUTwJTA7w+C/IW5v9Ssu6xmxWEi+iJQlpBhtUiT1raJ5b48pI8tBvEjEFnFA=="], + + "@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.57.0", "", { "os": "linux", "cpu": "none" }, "sha512-say0uMU/RaPm3CDQLxUUTF2oNWL8ysvHkAjcCzV2znxBr23kFfaxocS9qJm+NdkRhF8wtdEEAJuYcLPhSPbjuQ=="], + + "@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.57.0", "", { "os": "linux", "cpu": "none" }, "sha512-/MU7/HizQGsnBREtRpcSbSV1zfkoxSTR7wLsRmBPQ8FwUj5sykrP1MyJTvsxP5KBq9SyE6kH8UQQQwa0ASeoQQ=="], + + "@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.57.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-Q9eh+gUGILIHEaJf66aF6a414jQbDnn29zeu0eX3dHMuysnhTvsUvZTCAyZ6tJhUjnvzBKE4FtuaYxutxRZpOg=="], + + "@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.57.0", "", { "os": "linux", "cpu": "x64" }, "sha512-OR5p5yG5OKSxHReWmwvM0P+VTPMwoBS45PXTMYaskKQqybkS3Kmugq1W+YbNWArF8/s7jQScgzXUhArzEQ7x0A=="], + + "@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.57.0", "", { "os": "linux", "cpu": "x64" }, "sha512-XeatKzo4lHDsVEbm1XDHZlhYZZSQYym6dg2X/Ko0kSFgio+KXLsxwJQprnR48GvdIKDOpqWqssC3iBCjoMcMpw=="], + + "@rollup/rollup-openbsd-x64": ["@rollup/rollup-openbsd-x64@4.57.0", "", { "os": "openbsd", "cpu": "x64" }, "sha512-Lu71y78F5qOfYmubYLHPcJm74GZLU6UJ4THkf/a1K7Tz2ycwC2VUbsqbJAXaR6Bx70SRdlVrt2+n5l7F0agTUw=="], + + "@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.57.0", "", { "os": "none", "cpu": "arm64" }, "sha512-v5xwKDWcu7qhAEcsUubiav7r+48Uk/ENWdr82MBZZRIm7zThSxCIVDfb3ZeRRq9yqk+oIzMdDo6fCcA5DHfMyA=="], + + "@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.57.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-XnaaaSMGSI6Wk8F4KK3QP7GfuuhjGchElsVerCplUuxRIzdvZ7hRBpLR0omCmw+kI2RFJB80nenhOoGXlJ5TfQ=="], + + "@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.57.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-3K1lP+3BXY4t4VihLw5MEg6IZD3ojSYzqzBG571W3kNQe4G4CcFpSUQVgurYgib5d+YaCjeFow8QivWp8vuSvA=="], + + "@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.57.0", "", { "os": "win32", "cpu": "x64" }, "sha512-MDk610P/vJGc5L5ImE4k5s+GZT3en0KoK1MKPXCRgzmksAMk79j4h3k1IerxTNqwDLxsGxStEZVBqG0gIqZqoA=="], + + "@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.57.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Zv7v6q6aV+VslnpwzqKAmrk5JdVkLUzok2208ZXGipjb+msxBr/fJPZyeEXiFgH7k62Ak0SLIfxQRZQvTuf7rQ=="], + "@sec-ant/readable-stream": ["@sec-ant/readable-stream@0.4.1", "", {}, "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg=="], "@semantic-release/changelog": ["@semantic-release/changelog@6.0.3", "", { "dependencies": { "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", "fs-extra": "^11.0.0", "lodash": "^4.17.4" }, "peerDependencies": { "semantic-release": ">=18.0.0" } }, "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag=="], @@ -117,10 +228,14 @@ "@types/bun": ["@types/bun@1.3.6", "", { "dependencies": { "bun-types": "1.3.6" } }, "sha512-uWCv6FO/8LcpREhenN1d1b6fcspAB+cefwD7uti8C8VffIv0Um08TKMn98FynpTiU38+y2dUO55T11NgDt8VAA=="], + "@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], + "@types/node": ["@types/node@25.0.10", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-zWW5KPngR/yvakJgGOmZ5vTBemDoSqF3AcV/LrO5u5wTWyEAVVh+IT39G4gtyAkh3CtTZs8aX/yRM82OfzHJRg=="], "@types/normalize-package-data": ["@types/normalize-package-data@2.4.4", "", {}, "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA=="], + "acorn": ["acorn@8.15.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg=="], + "agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="], "aggregate-error": ["aggregate-error@3.1.0", "", { "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" } }, "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA=="], @@ -147,12 +262,18 @@ "bun-types": ["bun-types@1.3.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-OlFwHcnNV99r//9v5IIOgQ9Uk37gZqrNMCcqEaExdkVq3Avwqok1bJFmvGMCkCE0FqzdY8VMOZpfpR3lwI+CsQ=="], + "bundle-require": ["bundle-require@5.1.0", "", { "dependencies": { "load-tsconfig": "^0.2.3" }, "peerDependencies": { "esbuild": ">=0.18" } }, "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA=="], + + "cac": ["cac@6.7.14", "", {}, "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ=="], + "callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="], "chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], "char-regex": ["char-regex@1.0.2", "", {}, "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw=="], + "chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="], + "clean-stack": ["clean-stack@2.2.0", "", {}, "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A=="], "cli-highlight": ["cli-highlight@2.1.11", "", { "dependencies": { "chalk": "^4.0.0", "highlight.js": "^10.7.1", "mz": "^2.4.0", "parse5": "^5.1.1", "parse5-htmlparser2-tree-adapter": "^6.0.0", "yargs": "^16.0.0" }, "bin": { "highlight": "bin/highlight" } }, "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg=="], @@ -165,10 +286,16 @@ "color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="], + "commander": ["commander@4.1.1", "", {}, "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA=="], + "compare-func": ["compare-func@2.0.0", "", { "dependencies": { "array-ify": "^1.0.0", "dot-prop": "^5.1.0" } }, "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA=="], + "confbox": ["confbox@0.1.8", "", {}, "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w=="], + "config-chain": ["config-chain@1.1.13", "", { "dependencies": { "ini": "^1.3.4", "proto-list": "~1.2.1" } }, "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ=="], + "consola": ["consola@3.4.2", "", {}, "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA=="], + "conventional-changelog-angular": ["conventional-changelog-angular@8.1.0", "", { "dependencies": { "compare-func": "^2.0.0" } }, "sha512-GGf2Nipn1RUCAktxuVauVr1e3r8QrLP/B0lEUsFktmGqc3ddbQkhoJZHJctVU829U1c6mTSWftrVOCHaL85Q3w=="], "conventional-changelog-atom": ["conventional-changelog-atom@5.0.0", "", {}, "sha512-WfzCaAvSCFPkznnLgLnfacRAzjgqjLUjvf3MftfsJzQdDICqkOOpcMtdJF3wTerxSpv2IAAjX8doM3Vozqle3g=="], @@ -211,6 +338,8 @@ "error-ex": ["error-ex@1.3.4", "", { "dependencies": { "is-arrayish": "^0.2.1" } }, "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ=="], + "esbuild": ["esbuild@0.27.2", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.27.2", "@esbuild/android-arm": "0.27.2", "@esbuild/android-arm64": "0.27.2", "@esbuild/android-x64": "0.27.2", "@esbuild/darwin-arm64": "0.27.2", "@esbuild/darwin-x64": "0.27.2", "@esbuild/freebsd-arm64": "0.27.2", "@esbuild/freebsd-x64": "0.27.2", "@esbuild/linux-arm": "0.27.2", "@esbuild/linux-arm64": "0.27.2", "@esbuild/linux-ia32": "0.27.2", "@esbuild/linux-loong64": "0.27.2", "@esbuild/linux-mips64el": "0.27.2", "@esbuild/linux-ppc64": "0.27.2", "@esbuild/linux-riscv64": "0.27.2", "@esbuild/linux-s390x": "0.27.2", "@esbuild/linux-x64": "0.27.2", "@esbuild/netbsd-arm64": "0.27.2", "@esbuild/netbsd-x64": "0.27.2", "@esbuild/openbsd-arm64": "0.27.2", "@esbuild/openbsd-x64": "0.27.2", "@esbuild/openharmony-arm64": "0.27.2", "@esbuild/sunos-x64": "0.27.2", "@esbuild/win32-arm64": "0.27.2", "@esbuild/win32-ia32": "0.27.2", "@esbuild/win32-x64": "0.27.2" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw=="], + "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], "escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="], @@ -231,10 +360,14 @@ "find-versions": ["find-versions@6.0.0", "", { "dependencies": { "semver-regex": "^4.0.5", "super-regex": "^1.0.0" } }, "sha512-2kCCtc+JvcZ86IGAz3Z2Y0A1baIz9fL31pH/0S1IqZr9Iwnjq8izfPtrCyQKO6TLMPELLsQMre7VDqeIKCsHkA=="], + "fix-dts-default-cjs-exports": ["fix-dts-default-cjs-exports@1.0.1", "", { "dependencies": { "magic-string": "^0.30.17", "mlly": "^1.7.4", "rollup": "^4.34.8" } }, "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg=="], + "from2": ["from2@2.3.0", "", { "dependencies": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" } }, "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g=="], "fs-extra": ["fs-extra@11.3.3", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg=="], + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + "function-timeout": ["function-timeout@1.0.2", "", {}, "sha512-939eZS4gJ3htTHAldmyyuzlrD58P03fHG49v2JfFXbV6OhvZKRC9j2yAtdHw/zrp2zXHuv05zMIy40F0ge7spA=="], "get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="], @@ -301,6 +434,8 @@ "java-properties": ["java-properties@1.0.2", "", {}, "sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ=="], + "joycon": ["joycon@3.1.1", "", {}, "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw=="], + "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "js-yaml": ["js-yaml@4.1.1", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA=="], @@ -311,10 +446,14 @@ "jsonfile": ["jsonfile@6.2.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg=="], + "lilconfig": ["lilconfig@3.1.3", "", {}, "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw=="], + "lines-and-columns": ["lines-and-columns@1.2.4", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="], "load-json-file": ["load-json-file@4.0.0", "", { "dependencies": { "graceful-fs": "^4.1.2", "parse-json": "^4.0.0", "pify": "^3.0.0", "strip-bom": "^3.0.0" } }, "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw=="], + "load-tsconfig": ["load-tsconfig@0.2.5", "", {}, "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg=="], + "locate-path": ["locate-path@2.0.0", "", { "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" } }, "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA=="], "lodash": ["lodash@4.17.23", "", {}, "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w=="], @@ -333,6 +472,8 @@ "lru-cache": ["lru-cache@11.2.5", "", {}, "sha512-vFrFJkWtJvJnD5hg+hJvVE8Lh/TcMzKnTgCWmtBipwI5yLX/iX+5UB2tfuyODF5E7k9xEzMdYgGqaSb1c0c5Yw=="], + "magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], + "make-asynchronous": ["make-asynchronous@1.0.1", "", { "dependencies": { "p-event": "^6.0.0", "type-fest": "^4.6.0", "web-worker": "1.2.0" } }, "sha512-T9BPOmEOhp6SmV25SwLVcHK4E6JyG/coH3C6F1NjNXSziv/fd4GmsqMk8YR6qpPOswfaOCApSNkZv6fxoaYFcQ=="], "marked": ["marked@15.0.12", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA=="], @@ -351,6 +492,8 @@ "minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="], + "mlly": ["mlly@1.8.0", "", { "dependencies": { "acorn": "^8.15.0", "pathe": "^2.0.3", "pkg-types": "^1.3.1", "ufo": "^1.6.1" } }, "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g=="], + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], "mz": ["mz@2.7.0", "", { "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", "thenify-all": "^1.0.0" } }, "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q=="], @@ -409,14 +552,22 @@ "path-type": ["path-type@4.0.0", "", {}, "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="], + "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], + "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], "picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], "pify": ["pify@3.0.0", "", {}, "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg=="], + "pirates": ["pirates@4.0.7", "", {}, "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA=="], + "pkg-conf": ["pkg-conf@2.1.0", "", { "dependencies": { "find-up": "^2.0.0", "load-json-file": "^4.0.0" } }, "sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g=="], + "pkg-types": ["pkg-types@1.3.1", "", { "dependencies": { "confbox": "^0.1.8", "mlly": "^1.7.4", "pathe": "^2.0.1" } }, "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ=="], + + "postcss-load-config": ["postcss-load-config@6.0.1", "", { "dependencies": { "lilconfig": "^3.1.1" }, "peerDependencies": { "jiti": ">=1.21.0", "postcss": ">=8.0.9", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["jiti", "postcss", "tsx", "yaml"] }, "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g=="], + "pretty-ms": ["pretty-ms@9.3.0", "", { "dependencies": { "parse-ms": "^4.0.0" } }, "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ=="], "process-nextick-args": ["process-nextick-args@2.0.1", "", {}, "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="], @@ -431,12 +582,16 @@ "readable-stream": ["readable-stream@2.3.8", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="], + "readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="], + "registry-auth-token": ["registry-auth-token@5.1.1", "", { "dependencies": { "@pnpm/npm-conf": "^3.0.2" } }, "sha512-P7B4+jq8DeD2nMsAcdfaqHbssgHtZ7Z5+++a5ask90fvmJ8p5je4mOa+wzu+DB4vQ5tdJV/xywY+UnVFeQLV5Q=="], "require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="], "resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="], + "rollup": ["rollup@4.57.0", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.57.0", "@rollup/rollup-android-arm64": "4.57.0", "@rollup/rollup-darwin-arm64": "4.57.0", "@rollup/rollup-darwin-x64": "4.57.0", "@rollup/rollup-freebsd-arm64": "4.57.0", "@rollup/rollup-freebsd-x64": "4.57.0", "@rollup/rollup-linux-arm-gnueabihf": "4.57.0", "@rollup/rollup-linux-arm-musleabihf": "4.57.0", "@rollup/rollup-linux-arm64-gnu": "4.57.0", "@rollup/rollup-linux-arm64-musl": "4.57.0", "@rollup/rollup-linux-loong64-gnu": "4.57.0", "@rollup/rollup-linux-loong64-musl": "4.57.0", "@rollup/rollup-linux-ppc64-gnu": "4.57.0", "@rollup/rollup-linux-ppc64-musl": "4.57.0", "@rollup/rollup-linux-riscv64-gnu": "4.57.0", "@rollup/rollup-linux-riscv64-musl": "4.57.0", "@rollup/rollup-linux-s390x-gnu": "4.57.0", "@rollup/rollup-linux-x64-gnu": "4.57.0", "@rollup/rollup-linux-x64-musl": "4.57.0", "@rollup/rollup-openbsd-x64": "4.57.0", "@rollup/rollup-openharmony-arm64": "4.57.0", "@rollup/rollup-win32-arm64-msvc": "4.57.0", "@rollup/rollup-win32-ia32-msvc": "4.57.0", "@rollup/rollup-win32-x64-gnu": "4.57.0", "@rollup/rollup-win32-x64-msvc": "4.57.0", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-e5lPJi/aui4TO1LpAXIRLySmwXSE8k3b9zoGfd42p67wzxog4WHjiZF3M2uheQih4DGyc25QEV4yRBbpueNiUA=="], + "safe-buffer": ["safe-buffer@5.1.2", "", {}, "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="], "semantic-release": ["semantic-release@25.0.2", "", { "dependencies": { "@semantic-release/commit-analyzer": "^13.0.1", "@semantic-release/error": "^4.0.0", "@semantic-release/github": "^12.0.0", "@semantic-release/npm": "^13.1.1", "@semantic-release/release-notes-generator": "^14.1.0", "aggregate-error": "^5.0.0", "cosmiconfig": "^9.0.0", "debug": "^4.0.0", "env-ci": "^11.0.0", "execa": "^9.0.0", "figures": "^6.0.0", "find-versions": "^6.0.0", "get-stream": "^6.0.0", "git-log-parser": "^1.2.0", "hook-std": "^4.0.0", "hosted-git-info": "^9.0.0", "import-from-esm": "^2.0.0", "lodash-es": "^4.17.21", "marked": "^15.0.0", "marked-terminal": "^7.3.0", "micromatch": "^4.0.2", "p-each-series": "^3.0.0", "p-reduce": "^3.0.0", "read-package-up": "^12.0.0", "resolve-from": "^5.0.0", "semver": "^7.3.2", "semver-diff": "^5.0.0", "signale": "^1.2.1", "yargs": "^18.0.0" }, "bin": { "semantic-release": "bin/semantic-release.js" } }, "sha512-6qGjWccl5yoyugHt3jTgztJ9Y0JVzyH8/Voc/D8PlLat9pwxQYXz7W1Dpnq5h0/G5GCYGUaDSlYcyk3AMh5A6g=="], @@ -457,7 +612,7 @@ "skin-tone": ["skin-tone@2.0.0", "", { "dependencies": { "unicode-emoji-modifier-base": "^1.0.0" } }, "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA=="], - "source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], + "source-map": ["source-map@0.7.6", "", {}, "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ=="], "spawn-error-forwarder": ["spawn-error-forwarder@1.0.0", "", {}, "sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g=="], @@ -485,6 +640,8 @@ "strip-json-comments": ["strip-json-comments@2.0.1", "", {}, "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ=="], + "sucrase": ["sucrase@3.35.1", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", "lines-and-columns": "^1.1.6", "mz": "^2.7.0", "pirates": "^4.0.1", "tinyglobby": "^0.2.11", "ts-interface-checker": "^0.1.9" }, "bin": { "sucrase": "bin/sucrase", "sucrase-node": "bin/sucrase-node" } }, "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw=="], + "super-regex": ["super-regex@1.1.0", "", { "dependencies": { "function-timeout": "^1.0.1", "make-asynchronous": "^1.0.1", "time-span": "^5.1.0" } }, "sha512-WHkws2ZflZe41zj6AolvvmaTrWds/VuyeYr9iPVv/oQeaIoVxMKaushfFWpOGDT+GuBrM/sVqF8KUCYQlSSTdQ=="], "supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], @@ -505,18 +662,28 @@ "time-span": ["time-span@5.1.0", "", { "dependencies": { "convert-hrtime": "^5.0.0" } }, "sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA=="], + "tinyexec": ["tinyexec@0.3.2", "", {}, "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA=="], + "tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="], "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], "traverse": ["traverse@0.6.8", "", {}, "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA=="], + "tree-kill": ["tree-kill@1.2.2", "", { "bin": { "tree-kill": "cli.js" } }, "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A=="], + + "ts-interface-checker": ["ts-interface-checker@0.1.13", "", {}, "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="], + + "tsup": ["tsup@8.5.1", "", { "dependencies": { "bundle-require": "^5.1.0", "cac": "^6.7.14", "chokidar": "^4.0.3", "consola": "^3.4.0", "debug": "^4.4.0", "esbuild": "^0.27.0", "fix-dts-default-cjs-exports": "^1.0.0", "joycon": "^3.1.1", "picocolors": "^1.1.1", "postcss-load-config": "^6.0.1", "resolve-from": "^5.0.0", "rollup": "^4.34.8", "source-map": "^0.7.6", "sucrase": "^3.35.0", "tinyexec": "^0.3.2", "tinyglobby": "^0.2.11", "tree-kill": "^1.2.2" }, "peerDependencies": { "@microsoft/api-extractor": "^7.36.0", "@swc/core": "^1", "postcss": "^8.4.12", "typescript": ">=4.5.0" }, "optionalPeers": ["@microsoft/api-extractor", "@swc/core", "postcss", "typescript"], "bin": { "tsup": "dist/cli-default.js", "tsup-node": "dist/cli-node.js" } }, "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing=="], + "tunnel": ["tunnel@0.0.6", "", {}, "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="], "type-fest": ["type-fest@5.4.1", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-xygQcmneDyzsEuKZrFbRMne5HDqMs++aFzefrJTgEIKjQ3rekM+RPfFCVq2Gp1VIDqddoYeppCj4Pcb+RZW0GQ=="], "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + "ufo": ["ufo@1.6.3", "", {}, "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q=="], + "uglify-js": ["uglify-js@3.19.3", "", { "bin": { "uglifyjs": "bin/uglifyjs" } }, "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ=="], "undici": ["undici@7.19.1", "", {}, "sha512-Gpq0iNm5M6cQWlyHQv9MV+uOj1jWk7LpkoE5vSp/7zjb4zMdAcUD+VL5y0nH4p9EbUklq00eVIIX/XcDHzu5xg=="], @@ -589,6 +756,8 @@ "fdir/picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="], + "handlebars/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], + "import-fresh/resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="], "load-json-file/parse-json": ["parse-json@4.0.0", "", { "dependencies": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" } }, "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw=="], diff --git a/packages/server/package.json b/packages/server/package.json index 41e9e38..f88dab6 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -11,6 +11,7 @@ "publishConfig": { "access": "public" }, + "sideEffects": false, "keywords": [ "nequi", "sdk", @@ -40,7 +41,7 @@ "dist" ], "scripts": { - "build": "bun build ./src/index.ts --outdir ./dist --target node --minify --format esm --splitting", + "build": "tsup", "typecheck": "tsc --noEmit" }, "dependencies": { @@ -48,6 +49,7 @@ }, "devDependencies": { "@types/bun": "^1.3.6", + "tsup": "^8.5.1", "typescript": "^5.9.3" } } diff --git a/packages/server/tsup.config.ts b/packages/server/tsup.config.ts new file mode 100644 index 0000000..59063bd --- /dev/null +++ b/packages/server/tsup.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["./src/index.ts"], + outDir: "./dist", + splitting: true, + clean: true, + minify: true, + platform: "node", + treeshake: true, + format: "esm", +}); From d9e7d67d74746ccdc8010566440055b4d6f04bbd Mon Sep 17 00:00:00 2001 From: pulgueta Date: Tue, 27 Jan 2026 20:50:45 -0500 Subject: [PATCH 4/4] fix: apply greptile suggestions on base path and auth uri, unused env property --- packages/server/src/auth/index.ts | 9 ++++++--- packages/server/src/constants/index.ts | 8 ++++---- packages/server/src/dispersions/index.ts | 6 +++--- packages/server/src/error/types.ts | 2 +- packages/server/src/nequi.ts | 17 +++++++++++++++-- packages/server/src/payments/index.ts | 10 +++++----- packages/server/src/qr/index.ts | 6 +++--- packages/server/src/reports/index.ts | 4 ++-- packages/server/src/subscriptions/index.ts | 10 +++++----- 9 files changed, 44 insertions(+), 28 deletions(-) diff --git a/packages/server/src/auth/index.ts b/packages/server/src/auth/index.ts index d88ed81..8ea0630 100644 --- a/packages/server/src/auth/index.ts +++ b/packages/server/src/auth/index.ts @@ -1,13 +1,16 @@ -import { URLS } from "@/constants"; import { NequiError } from "@/error"; import { AuthResponseSchema } from "@/schemas/auth"; import { handleValidationError } from "@/utils/validation"; -export const nequiAuth = async (clientId: string, clientSecret: string) => { +export const nequiAuth = async ( + clientId: string, + clientSecret: string, + authUri: string, +) => { try { const authToken = `Basic ${Buffer.from(`${clientId}:${clientSecret}`).toString("base64")}`; - const req = await fetch(`${URLS.AUTH_URI}?grant_type=client_credentials`, { + const req = await fetch(`${authUri}?grant_type=client_credentials`, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded", diff --git a/packages/server/src/constants/index.ts b/packages/server/src/constants/index.ts index 74651c5..d9573a8 100644 --- a/packages/server/src/constants/index.ts +++ b/packages/server/src/constants/index.ts @@ -1,13 +1,13 @@ -export const URLS = { +export const getUrls = (env: "development" | "production") => ({ BASE_PATH: - process.env.NODE_ENV === "development" + env === "development" ? "https://api.sandbox.nequi.com" : "https://api.nequi.com", AUTH_URI: - process.env.NODE_ENV === "development" + env === "development" ? "https://oauth.sandbox.nequi.com/oauth2/token" : "https://oauth.nequi.com/oauth2/token", -} as const; +}); export const ENDPOINTS = { QR: { diff --git a/packages/server/src/dispersions/index.ts b/packages/server/src/dispersions/index.ts index e178559..5999de4 100644 --- a/packages/server/src/dispersions/index.ts +++ b/packages/server/src/dispersions/index.ts @@ -1,4 +1,4 @@ -import { CHANNELS, ENDPOINTS, URLS } from "@/constants"; +import { CHANNELS, ENDPOINTS } from "@/constants"; import type { Nequi } from "@/nequi"; import { DisperseFundsRQSchema, @@ -37,7 +37,7 @@ export class Dispersions { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.DISPERSIONS.CREATE_DISPERSION}`, + `${this.nequi.basePath}${ENDPOINTS.DISPERSIONS.CREATE_DISPERSION}`, { body: JSON.stringify(body), }, @@ -67,7 +67,7 @@ export class Dispersions { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.DISPERSIONS.CANCEL_DISPERSION}`, + `${this.nequi.basePath}${ENDPOINTS.DISPERSIONS.CANCEL_DISPERSION}`, { body: JSON.stringify(body), }, diff --git a/packages/server/src/error/types.ts b/packages/server/src/error/types.ts index 4dfbaad..8312067 100644 --- a/packages/server/src/error/types.ts +++ b/packages/server/src/error/types.ts @@ -5,7 +5,7 @@ export const ERROR_CODES_BY_KEY = { invalid_region: 422, rate_limit_exceeded: 429, missing_api_key: 401, - invalid_api_Key: 403, + invalid_api_key: 403, validation_error: 403, not_found: 404, authentication_error: 401, diff --git a/packages/server/src/nequi.ts b/packages/server/src/nequi.ts index 270753c..8e2f8c9 100644 --- a/packages/server/src/nequi.ts +++ b/packages/server/src/nequi.ts @@ -1,6 +1,7 @@ import type { z } from "zod"; import { nequiAuth } from "@/auth"; +import { getUrls } from "@/constants"; import { Dispersions } from "@/dispersions"; import { NequiError } from "@/error"; import { PushPayment } from "@/payments"; @@ -15,6 +16,9 @@ export class Nequi { private readonly apiKey: string; private readonly clientId: string; private readonly clientSecret: string; + private readonly env: "development" | "production"; + readonly basePath: string; + readonly authUri: string; readonly qr: GenerateQR; readonly pushPayment: PushPayment; @@ -36,6 +40,11 @@ export class Nequi { this.apiKey = parsed.data.apiKey; this.clientId = parsed.data.clientId; this.clientSecret = parsed.data.clientSecret; + this.env = parsed.data.env; + + const urls = getUrls(this.env); + this.basePath = urls.BASE_PATH; + this.authUri = urls.AUTH_URI; this.qr = new GenerateQR(this); this.pushPayment = new PushPayment(this); @@ -49,7 +58,11 @@ export class Nequi { } private async auth() { - const authenticate = await nequiAuth(this.clientId, this.clientSecret); + const authenticate = await nequiAuth( + this.clientId, + this.clientSecret, + this.authUri, + ); if (NequiError.isNequiError(authenticate)) { throw NequiError.from(authenticate); @@ -84,7 +97,7 @@ export class Nequi { return [ NequiError.from({ name: - req.status === 403 ? "invalid_api_Key" : "application_error", + req.status === 403 ? "invalid_api_key" : "application_error", message: errJson?.message || req.statusText, status: req.status, }), diff --git a/packages/server/src/payments/index.ts b/packages/server/src/payments/index.ts index 8a6188a..8407c52 100644 --- a/packages/server/src/payments/index.ts +++ b/packages/server/src/payments/index.ts @@ -1,4 +1,4 @@ -import { CHANNELS, ENDPOINTS, URLS } from "@/constants"; +import { CHANNELS, ENDPOINTS } from "@/constants"; import type { Nequi } from "@/nequi"; import { CancelUnregisteredPaymentRQSchema, @@ -39,7 +39,7 @@ export class PushPayment { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.PAYMENT_PUSH.UNREGISTERED}`, + `${this.nequi.basePath}${ENDPOINTS.PAYMENT_PUSH.UNREGISTERED}`, { body: JSON.stringify(body), }, @@ -69,7 +69,7 @@ export class PushPayment { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.PAYMENT_PUSH.CANCEL_UNREGISTERED}`, + `${this.nequi.basePath}${ENDPOINTS.PAYMENT_PUSH.CANCEL_UNREGISTERED}`, { body: JSON.stringify(body), }, @@ -99,7 +99,7 @@ export class PushPayment { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.PAYMENT_PUSH.STATUS}`, + `${this.nequi.basePath}${ENDPOINTS.PAYMENT_PUSH.STATUS}`, { body: JSON.stringify(body), }, @@ -129,7 +129,7 @@ export class PushPayment { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.PAYMENT_PUSH.REVERT}`, + `${this.nequi.basePath}${ENDPOINTS.PAYMENT_PUSH.REVERT}`, { body: JSON.stringify(body), }, diff --git a/packages/server/src/qr/index.ts b/packages/server/src/qr/index.ts index 9d3c242..6a55863 100644 --- a/packages/server/src/qr/index.ts +++ b/packages/server/src/qr/index.ts @@ -1,4 +1,4 @@ -import { CHANNELS, ENDPOINTS, URLS } from "@/constants"; +import { CHANNELS, ENDPOINTS } from "@/constants"; import type { Nequi } from "@/nequi"; import { GenerateCodeQRRQSchema, @@ -63,7 +63,7 @@ export class GenerateQR { { getStatusPaymentRQ: validated }, ); - return this.nequi.post(`${URLS.BASE_PATH}${ENDPOINTS.QR.STATUS}`, { + return this.nequi.post(`${this.nequi.basePath}${ENDPOINTS.QR.STATUS}`, { body: JSON.stringify(body), }); } @@ -90,7 +90,7 @@ export class GenerateQR { { reversionRQ: validated }, ); - return this.nequi.post(`${URLS.BASE_PATH}${ENDPOINTS.QR.REVERT}`, { + return this.nequi.post(`${this.nequi.basePath}${ENDPOINTS.QR.REVERT}`, { body: JSON.stringify(body), }); } diff --git a/packages/server/src/reports/index.ts b/packages/server/src/reports/index.ts index e5e2d08..f1f8867 100644 --- a/packages/server/src/reports/index.ts +++ b/packages/server/src/reports/index.ts @@ -1,4 +1,4 @@ -import { CHANNELS, ENDPOINTS, URLS } from "@/constants"; +import { CHANNELS, ENDPOINTS } from "@/constants"; import type { Nequi } from "@/nequi"; import { GetReportsRQSchema } from "@/schemas/reports"; import { buildRequestMessage } from "@/utils/builders"; @@ -31,7 +31,7 @@ export class Reports { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.REPORTS.GET_REPORTS}`, + `${this.nequi.basePath}${ENDPOINTS.REPORTS.GET_REPORTS}`, { body: JSON.stringify(body), }, diff --git a/packages/server/src/subscriptions/index.ts b/packages/server/src/subscriptions/index.ts index d76ad4e..590482a 100644 --- a/packages/server/src/subscriptions/index.ts +++ b/packages/server/src/subscriptions/index.ts @@ -1,4 +1,4 @@ -import { CHANNELS, ENDPOINTS, URLS } from "@/constants"; +import { CHANNELS, ENDPOINTS } from "@/constants"; import type { Nequi } from "@/nequi"; import { AutomaticPaymentRQSchema, @@ -39,7 +39,7 @@ export class Subscription { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.SUBSCRIPTION.AUTOMATIC_PAYMENT}`, + `${this.nequi.basePath}${ENDPOINTS.SUBSCRIPTION.AUTOMATIC_PAYMENT}`, { body: JSON.stringify(body), }, @@ -69,7 +69,7 @@ export class Subscription { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.SUBSCRIPTION.CREATE_SUBSCRIPTION}`, + `${this.nequi.basePath}${ENDPOINTS.SUBSCRIPTION.CREATE_SUBSCRIPTION}`, { body: JSON.stringify(body), }, @@ -99,7 +99,7 @@ export class Subscription { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.SUBSCRIPTION.GET_SUBSCRIPTION}`, + `${this.nequi.basePath}${ENDPOINTS.SUBSCRIPTION.GET_SUBSCRIPTION}`, { body: JSON.stringify(body), }, @@ -129,7 +129,7 @@ export class Subscription { ); return this.nequi.post( - `${URLS.BASE_PATH}${ENDPOINTS.SUBSCRIPTION.REVERSE_TRANSACTION}`, + `${this.nequi.basePath}${ENDPOINTS.SUBSCRIPTION.REVERSE_TRANSACTION}`, { body: JSON.stringify(body), },