@solvapay/core 1.0.0-preview.1

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.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @solvapay/core
2
+
3
+ Shared types, schemas, and errors.
4
+
5
+ ## Install
6
+ ```bash
7
+ pnpm add @solvapay/core
8
+ ```
9
+
10
+ ## Usage
11
+ ```ts
12
+ import { SolvaPayError, Env } from '@solvapay/core';
13
+ ```
14
+
15
+ More: docs/architecture.md
package/dist/index.cjs ADDED
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Env: () => Env,
24
+ SolvaPayError: () => SolvaPayError,
25
+ version: () => version
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+ var import_zod = require("zod");
29
+ var Env = import_zod.z.object({
30
+ SOLVAPAY_SECRET_KEY: import_zod.z.string().min(1),
31
+ SOLVAPAY_API_BASE_URL: import_zod.z.string().url().optional()
32
+ });
33
+ var SolvaPayError = class extends Error {
34
+ constructor(message) {
35
+ super(message);
36
+ this.name = "SolvaPayError";
37
+ }
38
+ };
39
+ var version = "0.1.0";
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ Env,
43
+ SolvaPayError,
44
+ version
45
+ });
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const Env: z.ZodObject<{
4
+ SOLVAPAY_SECRET_KEY: z.ZodString;
5
+ SOLVAPAY_API_BASE_URL: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ SOLVAPAY_SECRET_KEY: string;
8
+ SOLVAPAY_API_BASE_URL?: string | undefined;
9
+ }, {
10
+ SOLVAPAY_SECRET_KEY: string;
11
+ SOLVAPAY_API_BASE_URL?: string | undefined;
12
+ }>;
13
+ type Env = z.infer<typeof Env>;
14
+ declare class SolvaPayError extends Error {
15
+ constructor(message: string);
16
+ }
17
+ declare const version = "0.1.0";
18
+
19
+ export { Env, SolvaPayError, version };
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const Env: z.ZodObject<{
4
+ SOLVAPAY_SECRET_KEY: z.ZodString;
5
+ SOLVAPAY_API_BASE_URL: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ SOLVAPAY_SECRET_KEY: string;
8
+ SOLVAPAY_API_BASE_URL?: string | undefined;
9
+ }, {
10
+ SOLVAPAY_SECRET_KEY: string;
11
+ SOLVAPAY_API_BASE_URL?: string | undefined;
12
+ }>;
13
+ type Env = z.infer<typeof Env>;
14
+ declare class SolvaPayError extends Error {
15
+ constructor(message: string);
16
+ }
17
+ declare const version = "0.1.0";
18
+
19
+ export { Env, SolvaPayError, version };
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ // src/index.ts
2
+ import { z } from "zod";
3
+ var Env = z.object({
4
+ SOLVAPAY_SECRET_KEY: z.string().min(1),
5
+ SOLVAPAY_API_BASE_URL: z.string().url().optional()
6
+ });
7
+ var SolvaPayError = class extends Error {
8
+ constructor(message) {
9
+ super(message);
10
+ this.name = "SolvaPayError";
11
+ }
12
+ };
13
+ var version = "0.1.0";
14
+ export {
15
+ Env,
16
+ SolvaPayError,
17
+ version
18
+ };
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@solvapay/core",
3
+ "version": "1.0.0-preview.1",
4
+ "type": "module",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/solvapay/solvapay-sdk.git",
25
+ "directory": "packages/core"
26
+ },
27
+ "sideEffects": false,
28
+ "dependencies": {
29
+ "zod": "^3.23.8"
30
+ },
31
+ "devDependencies": {
32
+ "tsup": "^8.0.1",
33
+ "typescript": "^5.5.4",
34
+ "vitest": "^2.0.5"
35
+ },
36
+ "scripts": {
37
+ "build": "tsup src/index.ts --format esm,cjs --dts --tsconfig tsconfig.build.json",
38
+ "test": "vitest run || exit 0",
39
+ "test:unit": "vitest run || exit 0",
40
+ "test:watch": "vitest",
41
+ "lint": "echo 'no lint yet'"
42
+ }
43
+ }