@mbanq/core-sdk-js 0.1.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/LICENSE +21 -0
- package/README.md +777 -0
- package/dist/chunk-5NRQMAHH.mjs +1 -0
- package/dist/chunk-5PEETHWV.mjs +1 -0
- package/dist/chunk-BDI3SHA2.js +1 -0
- package/dist/chunk-OGW7GTJP.js +1 -0
- package/dist/chunk-RA5GVN3G.js +1 -0
- package/dist/chunk-RX3BFHHX.mjs +1 -0
- package/dist/client/index.d.mts +5 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +1 -0
- package/dist/client/index.mjs +1 -0
- package/dist/commands/index.d.mts +96 -0
- package/dist/commands/index.d.ts +96 -0
- package/dist/commands/index.js +1 -0
- package/dist/commands/index.mjs +1 -0
- package/dist/config.d-CyK6ZM6s.d.mts +53 -0
- package/dist/config.d-CyK6ZM6s.d.ts +53 -0
- package/dist/index-5Sj83ZJ4.d.mts +209 -0
- package/dist/index-DXK5OdKW.d.ts +209 -0
- package/dist/index-DvE2ddFU.d.mts +4568 -0
- package/dist/index-vaBvDmsq.d.ts +4568 -0
- package/dist/index.d.mts +67 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +93 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { C as CreatePaymentInput, P as Payment, U as UpdatePaymentInput, a as PaymentFilters, b as PaymentResponse } from './index-DvE2ddFU.mjs';
|
|
2
|
+
export { q as CreatePaymentInputShape, k as CreatePaymentInputZod, h as PaymentFilterKeyZod, o as PaymentFilterShape, n as PaymentFiltersZod, e as PaymentRailType, i as PaymentRailZod, m as PaymentResponseZod, p as PaymentShape, d as PaymentStatus, g as PaymentStatusZod, f as PaymentType, j as PaymentTypeZod, S as SortOrderZod, r as UpdatePaymentInputShape, l as UpdatePaymentInputZod, c as createClient } from './index-DvE2ddFU.mjs';
|
|
3
|
+
import { M as Middleware, C as Command } from './config.d-CyK6ZM6s.mjs';
|
|
4
|
+
export { a as Config } from './config.d-CyK6ZM6s.mjs';
|
|
5
|
+
export { G as GetClientData, c as GraphQL, S as SendAuthorizationToCore, U as UpdateCardID, a as UpdateClient, b as UpdateClientIdentifier } from './index-5Sj83ZJ4.mjs';
|
|
6
|
+
import 'zod';
|
|
7
|
+
import 'graphql';
|
|
8
|
+
import 'axios';
|
|
9
|
+
|
|
10
|
+
interface MetricsClient {
|
|
11
|
+
incrementCounter: (counterName: string) => void;
|
|
12
|
+
recordError?: (error: Error) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const createMetricsMiddleware: (metricsClient: MetricsClient) => Middleware;
|
|
15
|
+
|
|
16
|
+
interface Logger {
|
|
17
|
+
info: (message: string, ...args: unknown[]) => void;
|
|
18
|
+
error: (message: string, ...args: unknown[]) => void;
|
|
19
|
+
warn?: (message: string, ...args: unknown[]) => void;
|
|
20
|
+
log?: (message: string, ...args: unknown[]) => void;
|
|
21
|
+
}
|
|
22
|
+
declare const createLoggingMiddleware: (logger?: Logger) => Middleware;
|
|
23
|
+
|
|
24
|
+
declare const CreatePayment: (params: {
|
|
25
|
+
payment: CreatePaymentInput;
|
|
26
|
+
tenantId?: string;
|
|
27
|
+
}) => Command<{
|
|
28
|
+
payment: CreatePaymentInput;
|
|
29
|
+
tenantId?: string;
|
|
30
|
+
}, Payment>;
|
|
31
|
+
declare const GetPayment: (params: {
|
|
32
|
+
id: number;
|
|
33
|
+
tenantId?: string;
|
|
34
|
+
}) => Command<{
|
|
35
|
+
id: number;
|
|
36
|
+
tenantId?: string;
|
|
37
|
+
}, Payment>;
|
|
38
|
+
declare const UpdatePayment: (params: {
|
|
39
|
+
id: number;
|
|
40
|
+
payment: UpdatePaymentInput;
|
|
41
|
+
tenantId?: string;
|
|
42
|
+
}) => Command<{
|
|
43
|
+
id: number;
|
|
44
|
+
payment: UpdatePaymentInput;
|
|
45
|
+
tenantId?: string;
|
|
46
|
+
}, Payment>;
|
|
47
|
+
declare const GetPayments: (params: PaymentFilters, configuration: {
|
|
48
|
+
tenantId?: string;
|
|
49
|
+
}) => Command<{
|
|
50
|
+
params: PaymentFilters;
|
|
51
|
+
configuration: {
|
|
52
|
+
tenantId?: string;
|
|
53
|
+
};
|
|
54
|
+
}, PaymentResponse>;
|
|
55
|
+
|
|
56
|
+
interface ApiError {
|
|
57
|
+
name: string;
|
|
58
|
+
message: string;
|
|
59
|
+
statusCode?: number;
|
|
60
|
+
code?: string;
|
|
61
|
+
requestId?: string;
|
|
62
|
+
originalError?: Error;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare const isCommandError: (error: unknown) => error is ApiError;
|
|
66
|
+
|
|
67
|
+
export { Command, CreatePayment, CreatePaymentInput, GetPayment, GetPayments, type Logger, type MetricsClient, Middleware, Payment, PaymentFilters, PaymentResponse, UpdatePayment, UpdatePaymentInput, createLoggingMiddleware, createMetricsMiddleware, isCommandError };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { C as CreatePaymentInput, P as Payment, U as UpdatePaymentInput, a as PaymentFilters, b as PaymentResponse } from './index-vaBvDmsq.js';
|
|
2
|
+
export { q as CreatePaymentInputShape, k as CreatePaymentInputZod, h as PaymentFilterKeyZod, o as PaymentFilterShape, n as PaymentFiltersZod, e as PaymentRailType, i as PaymentRailZod, m as PaymentResponseZod, p as PaymentShape, d as PaymentStatus, g as PaymentStatusZod, f as PaymentType, j as PaymentTypeZod, S as SortOrderZod, r as UpdatePaymentInputShape, l as UpdatePaymentInputZod, c as createClient } from './index-vaBvDmsq.js';
|
|
3
|
+
import { M as Middleware, C as Command } from './config.d-CyK6ZM6s.js';
|
|
4
|
+
export { a as Config } from './config.d-CyK6ZM6s.js';
|
|
5
|
+
export { G as GetClientData, c as GraphQL, S as SendAuthorizationToCore, U as UpdateCardID, a as UpdateClient, b as UpdateClientIdentifier } from './index-DXK5OdKW.js';
|
|
6
|
+
import 'zod';
|
|
7
|
+
import 'graphql';
|
|
8
|
+
import 'axios';
|
|
9
|
+
|
|
10
|
+
interface MetricsClient {
|
|
11
|
+
incrementCounter: (counterName: string) => void;
|
|
12
|
+
recordError?: (error: Error) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const createMetricsMiddleware: (metricsClient: MetricsClient) => Middleware;
|
|
15
|
+
|
|
16
|
+
interface Logger {
|
|
17
|
+
info: (message: string, ...args: unknown[]) => void;
|
|
18
|
+
error: (message: string, ...args: unknown[]) => void;
|
|
19
|
+
warn?: (message: string, ...args: unknown[]) => void;
|
|
20
|
+
log?: (message: string, ...args: unknown[]) => void;
|
|
21
|
+
}
|
|
22
|
+
declare const createLoggingMiddleware: (logger?: Logger) => Middleware;
|
|
23
|
+
|
|
24
|
+
declare const CreatePayment: (params: {
|
|
25
|
+
payment: CreatePaymentInput;
|
|
26
|
+
tenantId?: string;
|
|
27
|
+
}) => Command<{
|
|
28
|
+
payment: CreatePaymentInput;
|
|
29
|
+
tenantId?: string;
|
|
30
|
+
}, Payment>;
|
|
31
|
+
declare const GetPayment: (params: {
|
|
32
|
+
id: number;
|
|
33
|
+
tenantId?: string;
|
|
34
|
+
}) => Command<{
|
|
35
|
+
id: number;
|
|
36
|
+
tenantId?: string;
|
|
37
|
+
}, Payment>;
|
|
38
|
+
declare const UpdatePayment: (params: {
|
|
39
|
+
id: number;
|
|
40
|
+
payment: UpdatePaymentInput;
|
|
41
|
+
tenantId?: string;
|
|
42
|
+
}) => Command<{
|
|
43
|
+
id: number;
|
|
44
|
+
payment: UpdatePaymentInput;
|
|
45
|
+
tenantId?: string;
|
|
46
|
+
}, Payment>;
|
|
47
|
+
declare const GetPayments: (params: PaymentFilters, configuration: {
|
|
48
|
+
tenantId?: string;
|
|
49
|
+
}) => Command<{
|
|
50
|
+
params: PaymentFilters;
|
|
51
|
+
configuration: {
|
|
52
|
+
tenantId?: string;
|
|
53
|
+
};
|
|
54
|
+
}, PaymentResponse>;
|
|
55
|
+
|
|
56
|
+
interface ApiError {
|
|
57
|
+
name: string;
|
|
58
|
+
message: string;
|
|
59
|
+
statusCode?: number;
|
|
60
|
+
code?: string;
|
|
61
|
+
requestId?: string;
|
|
62
|
+
originalError?: Error;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare const isCommandError: (error: unknown) => error is ApiError;
|
|
66
|
+
|
|
67
|
+
export { Command, CreatePayment, CreatePaymentInput, GetPayment, GetPayments, type Logger, type MetricsClient, Middleware, Payment, PaymentFilters, PaymentResponse, UpdatePayment, UpdatePaymentInput, createLoggingMiddleware, createMetricsMiddleware, isCommandError };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRA5GVN3Gjs = require('./chunk-RA5GVN3G.js');var _chunkBDI3SHA2js = require('./chunk-BDI3SHA2.js');var _chunkOGW7GTJPjs = require('./chunk-OGW7GTJP.js');var N=(t=console)=>({before:async e=>{t.info(`Executing ${e.metadata.commandName}`,{input:e.input,metadata:e.metadata})},after:async(e,a)=>{t.info(`Completed ${e.metadata.commandName}`,{response:a,metadata:e.metadata})},onError:async(e,a)=>{t.error(`Error in ${e.metadata.commandName}`,{error:a,input:e.input,metadata:e.metadata})}});var v=t=>({before:async e=>{t.incrementCounter(`${e.metadata.commandName}_started`)},after:async e=>{t.incrementCounter(`${e.metadata.commandName}_completed`)},onError:async(e,a)=>{t.incrementCounter(`${e.metadata.commandName}_error`),t.recordError&&typeof t.recordError=="function"&&t.recordError(a)}});exports.CreatePayment = _chunkRA5GVN3Gjs.n; exports.CreatePaymentInputShape = _chunkRA5GVN3Gjs.i; exports.CreatePaymentInputZod = _chunkRA5GVN3Gjs.j; exports.GetClientData = _chunkBDI3SHA2js.c; exports.GetPayment = _chunkRA5GVN3Gjs.o; exports.GetPayments = _chunkRA5GVN3Gjs.q; exports.GraphQL = _chunkBDI3SHA2js.f; exports.PaymentFilterKeyZod = _chunkRA5GVN3Gjs.a; exports.PaymentFilterShape = _chunkRA5GVN3Gjs.f; exports.PaymentFiltersZod = _chunkRA5GVN3Gjs.g; exports.PaymentRailZod = _chunkRA5GVN3Gjs.c; exports.PaymentResponseZod = _chunkRA5GVN3Gjs.m; exports.PaymentShape = _chunkRA5GVN3Gjs.h; exports.PaymentStatusZod = _chunkRA5GVN3Gjs.b; exports.PaymentTypeZod = _chunkRA5GVN3Gjs.d; exports.SendAuthorizationToCore = _chunkBDI3SHA2js.a; exports.SortOrderZod = _chunkRA5GVN3Gjs.e; exports.UpdateCardID = _chunkBDI3SHA2js.b; exports.UpdateClient = _chunkBDI3SHA2js.d; exports.UpdateClientIdentifier = _chunkBDI3SHA2js.e; exports.UpdatePayment = _chunkRA5GVN3Gjs.p; exports.UpdatePaymentInputShape = _chunkRA5GVN3Gjs.k; exports.UpdatePaymentInputZod = _chunkRA5GVN3Gjs.l; exports.createClient = _chunkRA5GVN3Gjs.r; exports.createLoggingMiddleware = N; exports.createMetricsMiddleware = v; exports.isCommandError = _chunkOGW7GTJPjs.b;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,b as o,c as m,d,e as p,f as i,g as s,h as y,i as c,j as P,k as f,l as u,m as g,n as l,o as S,p as C,q as x,r as h}from"./chunk-5NRQMAHH.mjs";import{a as w,b as M,c as E,d as I,e as Z,f as U}from"./chunk-5PEETHWV.mjs";import{b as r}from"./chunk-RX3BFHHX.mjs";var N=(t=console)=>({before:async e=>{t.info(`Executing ${e.metadata.commandName}`,{input:e.input,metadata:e.metadata})},after:async(e,a)=>{t.info(`Completed ${e.metadata.commandName}`,{response:a,metadata:e.metadata})},onError:async(e,a)=>{t.error(`Error in ${e.metadata.commandName}`,{error:a,input:e.input,metadata:e.metadata})}});var v=t=>({before:async e=>{t.incrementCounter(`${e.metadata.commandName}_started`)},after:async e=>{t.incrementCounter(`${e.metadata.commandName}_completed`)},onError:async(e,a)=>{t.incrementCounter(`${e.metadata.commandName}_error`),t.recordError&&typeof t.recordError=="function"&&t.recordError(a)}});export{l as CreatePayment,c as CreatePaymentInputShape,P as CreatePaymentInputZod,E as GetClientData,S as GetPayment,x as GetPayments,U as GraphQL,n as PaymentFilterKeyZod,i as PaymentFilterShape,s as PaymentFiltersZod,m as PaymentRailZod,g as PaymentResponseZod,y as PaymentShape,o as PaymentStatusZod,d as PaymentTypeZod,w as SendAuthorizationToCore,p as SortOrderZod,M as UpdateCardID,I as UpdateClient,Z as UpdateClientIdentifier,C as UpdatePayment,f as UpdatePaymentInputShape,u as UpdatePaymentInputZod,h as createClient,N as createLoggingMiddleware,v as createMetricsMiddleware,r as isCommandError};
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mbanq/core-sdk-js",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "A comprehensive JavaScript SDK for interacting with the Mbanq payment API. Features type-safe payment operations, multi-tenant support, and Zod validation.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"module": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"require": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./command": {
|
|
18
|
+
"import": "./dist/commands/index.mjs",
|
|
19
|
+
"require": "./dist/commands/index.js",
|
|
20
|
+
"types": "./dist/commands/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./client": {
|
|
23
|
+
"import": "./dist/client/index.mjs",
|
|
24
|
+
"require": "./dist/client/index.js",
|
|
25
|
+
"types": "./dist/client/index.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./types": {
|
|
28
|
+
"types": "./dist/index.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./types/command": {
|
|
31
|
+
"types": "./dist/commands/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./types/client": {
|
|
34
|
+
"types": "./dist/client/index.d.ts"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist/**"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"dev": "tsup --watch",
|
|
42
|
+
"semantic-release": "semantic-release",
|
|
43
|
+
"build": "tsup",
|
|
44
|
+
"test": "vitest run --coverage",
|
|
45
|
+
"test:ci": "vitest run --coverage --reporter=default --reporter=junit --outputFile=junit.xml",
|
|
46
|
+
"lint": "eslint '*/**/*.{js,ts}' --fix"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git@github.com:mbanq/core-sdk-js.git"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://github.com/mbanq/core-sdk-js",
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/mbanq/core-sdk-js/issues"
|
|
55
|
+
},
|
|
56
|
+
"keywords": [
|
|
57
|
+
"core",
|
|
58
|
+
"sdk",
|
|
59
|
+
"javascript"
|
|
60
|
+
],
|
|
61
|
+
"author": "MbanqCloud",
|
|
62
|
+
"license": "MIT",
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@babel/eslint-plugin": "^7.27.1",
|
|
65
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
66
|
+
"@semantic-release/git": "^10.0.1",
|
|
67
|
+
"@semantic-release/github": "^11.0.4",
|
|
68
|
+
"@semantic-release/npm": "^12.0.2",
|
|
69
|
+
"@types/jsonwebtoken": "^9.0.10",
|
|
70
|
+
"@types/node": "^24.2.1",
|
|
71
|
+
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
|
72
|
+
"@typescript-eslint/parser": "^8.39.1",
|
|
73
|
+
"@vitest/coverage-istanbul": "^3.2.4",
|
|
74
|
+
"eslint": "^9.33.0",
|
|
75
|
+
"eslint-plugin-import": "^2.32.0",
|
|
76
|
+
"eslint-plugin-node": "^11.1.0",
|
|
77
|
+
"eslint-plugin-security": "^3.0.1",
|
|
78
|
+
"globals": "^16.3.0",
|
|
79
|
+
"semantic-release": "^24.2.7",
|
|
80
|
+
"semantic-release-slack-bot": "^4.0.2",
|
|
81
|
+
"tsup": "^8.5.0",
|
|
82
|
+
"typescript": "^5.9.2",
|
|
83
|
+
"vitest": "^3.2.4"
|
|
84
|
+
},
|
|
85
|
+
"dependencies": {
|
|
86
|
+
"axios": "^1.11.0",
|
|
87
|
+
"graphql": "^16.11.0",
|
|
88
|
+
"jsonwebtoken": "^9.0.2",
|
|
89
|
+
"moment-timezone": "^0.6.0",
|
|
90
|
+
"uuid": "^11.1.0",
|
|
91
|
+
"zod": "^3.25.76"
|
|
92
|
+
}
|
|
93
|
+
}
|