recurrente-js 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const axios_1 = __importDefault(require("axios"));
30
+ const dotenv = __importStar(require("dotenv"));
31
+ // Load environment variables from .env file
32
+ dotenv.config();
33
+ const baseURL = process.env.RECURRENTE_BASE_URL;
34
+ const publicKey = process.env.RECURRENTE_PUBLIC_KEY;
35
+ const secretKey = process.env.RECURRENTE_SECRET_KEY;
36
+ if (!baseURL) {
37
+ throw new Error('Missing Recurrente base URL');
38
+ }
39
+ if (!publicKey) {
40
+ throw new Error('Missing Recurrente Public Key');
41
+ }
42
+ if (!secretKey) {
43
+ throw new Error('Missing Recurrente Secret Key');
44
+ }
45
+ // Create an Axios instance with configuration
46
+ const client = axios_1.default.create({
47
+ baseURL: `${baseURL}/api`,
48
+ headers: {
49
+ 'X-PUBLIC-KEY': publicKey,
50
+ 'X-SECRET-KEY': secretKey,
51
+ 'Content-Type': 'application/json',
52
+ },
53
+ });
54
+ // Export the Axios instance for use in other parts of the package
55
+ exports.default = client;
@@ -0,0 +1 @@
1
+ export { default as recurrente } from './api/recurrente';
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.recurrente = void 0;
7
+ var recurrente_1 = require("./api/recurrente");
8
+ Object.defineProperty(exports, "recurrente", { enumerable: true, get: function () { return __importDefault(recurrente_1).default; } });