@mbanq/core-sdk-js 0.2.0 → 0.3.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.
- package/README.md +171 -113
- package/dist/chunk-BYLL2GK4.js +1 -0
- package/dist/chunk-C5426MUQ.js +1 -0
- package/dist/chunk-I22UNKNA.mjs +1 -0
- package/dist/{chunk-MNWURBTP.mjs → chunk-TF7GWO4M.mjs} +1 -1
- package/dist/{chunk-S3G3HESY.js → chunk-WANY7FS3.js} +1 -1
- package/dist/chunk-ZPWW7X3U.mjs +1 -0
- package/dist/client/index.d.mts +1291 -3
- package/dist/client/index.d.ts +1291 -3
- package/dist/client/index.js +1 -1
- package/dist/client/index.mjs +1 -1
- package/dist/client-z_1PDcj6.d.mts +7971 -0
- package/dist/client-z_1PDcj6.d.ts +7971 -0
- package/dist/commands/index.d.mts +2 -2
- package/dist/commands/index.d.ts +2 -2
- package/dist/commands/index.js +1 -1
- package/dist/commands/index.mjs +1 -1
- package/dist/index-BcDxuEgp.d.ts +176 -0
- package/dist/index-D3PYCZYG.d.mts +176 -0
- package/dist/index.d.mts +5 -38
- package/dist/index.d.ts +5 -38
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-MDNXUIWP.mjs +0 -1
- package/dist/chunk-S3UCKQ5Q.js +0 -1
- package/dist/chunk-SQZ4PAOL.mjs +0 -1
- package/dist/chunk-UD2TOWHP.js +0 -1
- package/dist/client-DhU5QMWd.d.mts +0 -2143
- package/dist/client-DhU5QMWd.d.ts +0 -2143
- package/dist/index-BC3pkS--.d.mts +0 -4638
- package/dist/index-BHzajnME.d.mts +0 -92
- package/dist/index-CQe-0gwX.d.ts +0 -92
- package/dist/index-UyJmi0Vg.d.ts +0 -4638
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import {
|
|
1
|
+
export { f as CreateClient, C as CreatePayment, k as DeleteAccount, D as DeleteClient, m as DeletePayment, h as GetAccount, i as GetAccountsOfClient, c as GetClient, g as GetClients, G as GetPayment, a as GetPayments, l as GraphQL, L as ListAccountsOfClient, S as SendAuthorizationToCore, j as UpdateAccount, b as UpdateCardID, d as UpdateClient, e as UpdateClientIdentifier, U as UpdatePayment } from '../index-D3PYCZYG.mjs';
|
|
2
|
+
import { H as PaymentRail, a as Command, F as ProcessOutput, I as MarkAsReturnInput, T as Transfer, J as GetTransferInput, K as UpdateTraceNumbersInput, N as CreateTransferInput, O as CreateTransferOutput } from '../client-z_1PDcj6.mjs';
|
|
3
3
|
import 'graphql';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import 'zod';
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import {
|
|
1
|
+
export { f as CreateClient, C as CreatePayment, k as DeleteAccount, D as DeleteClient, m as DeletePayment, h as GetAccount, i as GetAccountsOfClient, c as GetClient, g as GetClients, G as GetPayment, a as GetPayments, l as GraphQL, L as ListAccountsOfClient, S as SendAuthorizationToCore, j as UpdateAccount, b as UpdateCardID, d as UpdateClient, e as UpdateClientIdentifier, U as UpdatePayment } from '../index-BcDxuEgp.js';
|
|
2
|
+
import { H as PaymentRail, a as Command, F as ProcessOutput, I as MarkAsReturnInput, T as Transfer, J as GetTransferInput, K as UpdateTraceNumbersInput, N as CreateTransferInput, O as CreateTransferOutput } from '../client-z_1PDcj6.js';
|
|
3
3
|
import 'graphql';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import 'zod';
|
package/dist/commands/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkWANY7FS3js = require('../chunk-WANY7FS3.js');var _chunkBYLL2GK4js = require('../chunk-BYLL2GK4.js');var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);var _momenttimezone = require('moment-timezone'); var _momenttimezone2 = _interopRequireDefault(_momenttimezone);var p=(t=new Date,e=!1,r=_nullishCoalesce(process.env.TIMEZONE, () => ("Europe/Berlin")))=>_momenttimezone2.default.call(void 0, t.getTime()).tz(r).utc(!e);var D=t=>({input:t,metadata:{commandName:"CreateTransfer",path:"/v1/transfers",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkBYLL2GK4js.d.call(void 0, e);try{return(await r.post("/v1/transfers",t.transfer)).data}catch(n){_chunkBYLL2GK4js.c.call(void 0, n)}}}),F= exports.GetTransfer =t=>({input:t,metadata:{commandName:"GetTransfer",path:`/v1/transfers/${t.id}`,method:"GET"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkBYLL2GK4js.d.call(void 0, e);try{return(await r.get(`/v1/transfers/${t.id}`)).data}catch(n){_chunkBYLL2GK4js.c.call(void 0, n)}}}),L= exports.GetTransfers =t=>{let e={paymentType:t.paymentType||"ACH",status:t.transferStatus||"EXECUTION_SCHEDULED",toExecuteDate:t.executedAt||p().toISOString(!0).slice(0,10),locale:"en",dateFormat:"yyyy-MM-dd",associateClientData:!0,originatedBy:"us",accountType:t.accountType};return{input:t,metadata:{commandName:"GetTransfers",path:"/v1/transfers",method:"GET"},execute:async r=>{t.tenantId&&(r.tenantId=t.tenantId);let n=await _chunkBYLL2GK4js.d.call(void 0, r),a=[],c=t.queryLimit||200,u=0,i=0,I={...e,limit:c,offset:u};try{do{let d=await n.get("/v1/transfers",{params:I}),{totalFilteredRecords:f,pageItems:C}=d.data;a.push(...C),i=f,u+=c}while(u<i);return a}catch(d){_chunkBYLL2GK4js.c.call(void 0, d)}}}},K= exports.MarkAsSuccess =t=>{let e={...t,paymentType:t.paymentType||"ACH"};return{input:t,metadata:{commandName:"MarkAsSuccess",path:"/v1/external-transfers?command=MARK_AS_SUCCESS",method:"POST"},execute:async r=>{t.tenantId&&(r.tenantId=t.tenantId);let n=await _chunkBYLL2GK4js.d.call(void 0, r);try{return(await n.post("/v1/external-transfers?command=MARK_AS_SUCCESS",e)).data}catch(a){_chunkBYLL2GK4js.c.call(void 0, a)}}}},q= exports.MarkAsProcessing =t=>({input:t,metadata:{commandName:"MarkAsProcessing",path:"/v1/external-transfers?command=MARK_AS_PROCESSING",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkBYLL2GK4js.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_PROCESSING",t)).data}catch(n){_chunkBYLL2GK4js.c.call(void 0, n)}}}),$= exports.MarkAsReturned =t=>({input:t,metadata:{commandName:"MarkAsReturned",path:"/v1/external-transfers?command=MARK_AS_RETURN",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkBYLL2GK4js.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_RETURN",{...t})).data}catch(n){_chunkBYLL2GK4js.c.call(void 0, n)}}}),z= exports.LogFailTransfer =t=>{let e={...t.payload};return{input:t,metadata:{commandName:"LogFailTransfer",path:"/v1/external-transfers?command=LOG_FAILURE",method:"POST"},execute:async r=>{t.tenantId&&(r.tenantId=t.tenantId);let n=await _chunkBYLL2GK4js.d.call(void 0, r);try{return(await n.post("/v1/external-transfers?command=LOG_FAILURE",e)).data}catch(a){throw _axios2.default.isAxiosError(a)?_chunkBYLL2GK4js.a.call(void 0, {message:"LogFailTransfer command failed",statusCode:_optionalChain([a, 'access', _2 => _2.response, 'optionalAccess', _3 => _3.status]),code:a.code,requestId:_optionalChain([a, 'access', _4 => _4.response, 'optionalAccess', _5 => _5.headers, 'optionalAccess', _6 => _6["x-request-id"]]),originalError:a}):a}}}},B= exports.MarkAsFail =t=>({input:t,metadata:{commandName:"MarkAsFail",path:"/v1/external-transfers?command=MARK_AS_FAIL",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkBYLL2GK4js.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_FAIL",t)).data}catch(n){_chunkBYLL2GK4js.c.call(void 0, n)}}}),H= exports.UpdateTraceNumber =t=>{let e={traceNumbers:t.traceNumbers};return{input:t,metadata:{commandName:"UpdateTraceNumber",path:`/v1/external-transfers/${t.externalId}`,method:"PUT"},execute:async r=>{t.tenantId&&(r.tenantId=t.tenantId);let n=await _chunkBYLL2GK4js.d.call(void 0, r);try{return(await n.put(`/v1/external-transfers/${t.externalId}`,e)).data}catch(a){_chunkBYLL2GK4js.c.call(void 0, a)}}}};var Z=t=>({input:t,metadata:{commandName:t.commandName||"CustomUpdate",path:t.url,method:"PUT"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkBYLL2GK4js.d.call(void 0, e);try{return(await r.put(t.url,{...t.updates},{params:t.params})).data}catch(n){_chunkBYLL2GK4js.c.call(void 0, n)}}}),Q= exports.CustomCreate =t=>({input:t,metadata:{commandName:t.commandName||"CustomCreate",path:t.url,method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkBYLL2GK4js.d.call(void 0, e);try{return(await r.post(t.url,t.data,{params:t.params})).data}catch(n){_chunkBYLL2GK4js.c.call(void 0, n)}}}),X= exports.CustomGet =t=>({input:t,metadata:{commandName:t.commandName||"CustomGet",path:t.url,method:"GET"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkBYLL2GK4js.d.call(void 0, e);try{return(await r.get(t.url,{params:t.params})).data}catch(n){_chunkBYLL2GK4js.c.call(void 0, n)}}});exports.CreateClient = _chunkBYLL2GK4js.A; exports.CreatePayment = _chunkBYLL2GK4js.r; exports.CreateTransfer = D; exports.CustomCreate = Q; exports.CustomGet = X; exports.CustomUpdate = Z; exports.DeleteAccount = _chunkBYLL2GK4js.O; exports.DeleteClient = _chunkBYLL2GK4js.D; exports.DeletePayment = _chunkBYLL2GK4js.w; exports.GetAccount = _chunkBYLL2GK4js.M; exports.GetAccountsOfClient = _chunkBYLL2GK4js.Q; exports.GetClient = _chunkBYLL2GK4js.x; exports.GetClients = _chunkBYLL2GK4js.C; exports.GetPayment = _chunkBYLL2GK4js.s; exports.GetPayments = _chunkBYLL2GK4js.v; exports.GetTransfer = F; exports.GetTransfers = L; exports.GraphQL = _chunkWANY7FS3js.c; exports.ListAccountsOfClient = _chunkBYLL2GK4js.P; exports.LogFailTransfer = z; exports.MarkAsFail = B; exports.MarkAsProcessing = q; exports.MarkAsReturned = $; exports.MarkAsSuccess = K; exports.SendAuthorizationToCore = _chunkWANY7FS3js.a; exports.UpdateAccount = _chunkBYLL2GK4js.N; exports.UpdateCardID = _chunkWANY7FS3js.b; exports.UpdateClient = _chunkBYLL2GK4js.y; exports.UpdateClientIdentifier = _chunkBYLL2GK4js.z; exports.UpdatePayment = _chunkBYLL2GK4js.t; exports.UpdateTraceNumber = H;
|
package/dist/commands/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as E,b as v,c as _}from"../chunk-TF7GWO4M.mjs";import{A as O,C as S,D as R,M as w,N,O as M,P as G,Q as U,a as m,c as o,d as s,r as l,s as y,t as x,v as T,w as g,x as h,y as A,z as P}from"../chunk-ZPWW7X3U.mjs";import k from"axios";import b from"moment-timezone";var p=(t=new Date,e=!1,r=process.env.TIMEZONE??"Europe/Berlin")=>b(t.getTime()).tz(r).utc(!e);var D=t=>({input:t,metadata:{commandName:"CreateTransfer",path:"/v1/transfers",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await s(e);try{return(await r.post("/v1/transfers",t.transfer)).data}catch(n){o(n)}}}),F=t=>({input:t,metadata:{commandName:"GetTransfer",path:`/v1/transfers/${t.id}`,method:"GET"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await s(e);try{return(await r.get(`/v1/transfers/${t.id}`)).data}catch(n){o(n)}}}),L=t=>{let e={paymentType:t.paymentType||"ACH",status:t.transferStatus||"EXECUTION_SCHEDULED",toExecuteDate:t.executedAt||p().toISOString(!0).slice(0,10),locale:"en",dateFormat:"yyyy-MM-dd",associateClientData:!0,originatedBy:"us",accountType:t.accountType};return{input:t,metadata:{commandName:"GetTransfers",path:"/v1/transfers",method:"GET"},execute:async r=>{t.tenantId&&(r.tenantId=t.tenantId);let n=await s(r),a=[],c=t.queryLimit||200,u=0,i=0,I={...e,limit:c,offset:u};try{do{let d=await n.get("/v1/transfers",{params:I}),{totalFilteredRecords:f,pageItems:C}=d.data;a.push(...C),i=f,u+=c}while(u<i);return a}catch(d){o(d)}}}},K=t=>{let e={...t,paymentType:t.paymentType||"ACH"};return{input:t,metadata:{commandName:"MarkAsSuccess",path:"/v1/external-transfers?command=MARK_AS_SUCCESS",method:"POST"},execute:async r=>{t.tenantId&&(r.tenantId=t.tenantId);let n=await s(r);try{return(await n.post("/v1/external-transfers?command=MARK_AS_SUCCESS",e)).data}catch(a){o(a)}}}},q=t=>({input:t,metadata:{commandName:"MarkAsProcessing",path:"/v1/external-transfers?command=MARK_AS_PROCESSING",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await s(e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_PROCESSING",t)).data}catch(n){o(n)}}}),$=t=>({input:t,metadata:{commandName:"MarkAsReturned",path:"/v1/external-transfers?command=MARK_AS_RETURN",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await s(e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_RETURN",{...t})).data}catch(n){o(n)}}}),z=t=>{let e={...t.payload};return{input:t,metadata:{commandName:"LogFailTransfer",path:"/v1/external-transfers?command=LOG_FAILURE",method:"POST"},execute:async r=>{t.tenantId&&(r.tenantId=t.tenantId);let n=await s(r);try{return(await n.post("/v1/external-transfers?command=LOG_FAILURE",e)).data}catch(a){throw k.isAxiosError(a)?m({message:"LogFailTransfer command failed",statusCode:a.response?.status,code:a.code,requestId:a.response?.headers?.["x-request-id"],originalError:a}):a}}}},B=t=>({input:t,metadata:{commandName:"MarkAsFail",path:"/v1/external-transfers?command=MARK_AS_FAIL",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await s(e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_FAIL",t)).data}catch(n){o(n)}}}),H=t=>{let e={traceNumbers:t.traceNumbers};return{input:t,metadata:{commandName:"UpdateTraceNumber",path:`/v1/external-transfers/${t.externalId}`,method:"PUT"},execute:async r=>{t.tenantId&&(r.tenantId=t.tenantId);let n=await s(r);try{return(await n.put(`/v1/external-transfers/${t.externalId}`,e)).data}catch(a){o(a)}}}};var Z=t=>({input:t,metadata:{commandName:t.commandName||"CustomUpdate",path:t.url,method:"PUT"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await s(e);try{return(await r.put(t.url,{...t.updates},{params:t.params})).data}catch(n){o(n)}}}),Q=t=>({input:t,metadata:{commandName:t.commandName||"CustomCreate",path:t.url,method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await s(e);try{return(await r.post(t.url,t.data,{params:t.params})).data}catch(n){o(n)}}}),X=t=>({input:t,metadata:{commandName:t.commandName||"CustomGet",path:t.url,method:"GET"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await s(e);try{return(await r.get(t.url,{params:t.params})).data}catch(n){o(n)}}});export{O as CreateClient,l as CreatePayment,D as CreateTransfer,Q as CustomCreate,X as CustomGet,Z as CustomUpdate,M as DeleteAccount,R as DeleteClient,g as DeletePayment,w as GetAccount,U as GetAccountsOfClient,h as GetClient,S as GetClients,y as GetPayment,T as GetPayments,F as GetTransfer,L as GetTransfers,_ as GraphQL,G as ListAccountsOfClient,z as LogFailTransfer,B as MarkAsFail,q as MarkAsProcessing,$ as MarkAsReturned,K as MarkAsSuccess,E as SendAuthorizationToCore,N as UpdateAccount,v as UpdateCardID,A as UpdateClient,P as UpdateClientIdentifier,x as UpdatePayment,H as UpdateTraceNumber};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { b as CreatePaymentInput, a as Command, P as Payment, U as UpdatePaymentInput, g as PaymentFilters, c as PaymentResponse, E as UpdateClientRequest, F as ProcessOutput, G as UpdateClientIdentifierRequest, Q as UpdateClientIdentifierResponse, D as CreateClientRequest, R as CreateClientResponse, V as ListClientsRequest, W as ListClientsResponse, v as SavingAccount, X as ListAccountsOfClientRequest, z as UpdateAccountRequest, Y as GraphQLRequest } from './client-z_1PDcj6.js';
|
|
2
|
+
|
|
3
|
+
declare const CreatePayment: (params: {
|
|
4
|
+
payment: CreatePaymentInput;
|
|
5
|
+
tenantId?: string;
|
|
6
|
+
}) => Command<{
|
|
7
|
+
payment: CreatePaymentInput;
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
}, Payment>;
|
|
10
|
+
declare const GetPayment: (params: {
|
|
11
|
+
id: number;
|
|
12
|
+
tenantId?: string;
|
|
13
|
+
}) => Command<{
|
|
14
|
+
id: number;
|
|
15
|
+
tenantId?: string;
|
|
16
|
+
}, Payment>;
|
|
17
|
+
declare const UpdatePayment: (params: {
|
|
18
|
+
id: number;
|
|
19
|
+
payment: UpdatePaymentInput;
|
|
20
|
+
tenantId?: string;
|
|
21
|
+
}) => Command<{
|
|
22
|
+
id: number;
|
|
23
|
+
payment: UpdatePaymentInput;
|
|
24
|
+
tenantId?: string;
|
|
25
|
+
}, Payment>;
|
|
26
|
+
declare const GetPayments: (params: PaymentFilters, configuration: {
|
|
27
|
+
tenantId?: string;
|
|
28
|
+
}) => Command<{
|
|
29
|
+
params: PaymentFilters;
|
|
30
|
+
configuration: {
|
|
31
|
+
tenantId?: string;
|
|
32
|
+
};
|
|
33
|
+
}, PaymentResponse>;
|
|
34
|
+
declare const DeletePayment: (params: {
|
|
35
|
+
id: number;
|
|
36
|
+
tenantId?: string;
|
|
37
|
+
}) => Command<{
|
|
38
|
+
id: number;
|
|
39
|
+
tenantId?: string;
|
|
40
|
+
}, void>;
|
|
41
|
+
|
|
42
|
+
interface SimpleCard {
|
|
43
|
+
internalCardId: string,
|
|
44
|
+
cardType?: string,
|
|
45
|
+
tenantIdentifier?: string,
|
|
46
|
+
status?: string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface AuthorizationRequest {
|
|
50
|
+
card: SimpleCard,
|
|
51
|
+
payload: any,
|
|
52
|
+
tenantId?: string,
|
|
53
|
+
skipNotification?: boolean,
|
|
54
|
+
flag?: string
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface CardUpdate {
|
|
58
|
+
clientId: number,
|
|
59
|
+
businessCardIDURL: string,
|
|
60
|
+
businessCardIDQRCode: string
|
|
61
|
+
tenantId?: string
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare const SendAuthorizationToCore: (params: AuthorizationRequest) => Command<AuthorizationRequest, any>;
|
|
65
|
+
declare const UpdateCardID: (params: CardUpdate) => Command<CardUpdate, void>;
|
|
66
|
+
|
|
67
|
+
declare const GetClient: (params: {
|
|
68
|
+
clientId: number;
|
|
69
|
+
tenantId?: string;
|
|
70
|
+
riskRating?: boolean;
|
|
71
|
+
clientAddress?: boolean;
|
|
72
|
+
clientIdentifier?: boolean;
|
|
73
|
+
staffInSelectedOfficeOnly?: boolean;
|
|
74
|
+
checkIdentitiesExpiration?: boolean;
|
|
75
|
+
clientAccountAssociate?: boolean;
|
|
76
|
+
}) => Command<{
|
|
77
|
+
clientId: number;
|
|
78
|
+
tenantId?: string;
|
|
79
|
+
riskRating?: boolean;
|
|
80
|
+
clientAddress?: boolean;
|
|
81
|
+
clientIdentifier?: boolean;
|
|
82
|
+
staffInSelectedOfficeOnly?: boolean;
|
|
83
|
+
checkIdentitiesExpiration?: boolean;
|
|
84
|
+
clientAccountAssociate?: boolean;
|
|
85
|
+
}, any>;
|
|
86
|
+
declare const UpdateClient: (params: {
|
|
87
|
+
tenantId?: string;
|
|
88
|
+
clientId: number;
|
|
89
|
+
updates: UpdateClientRequest;
|
|
90
|
+
}) => Command<{
|
|
91
|
+
tenantId?: string;
|
|
92
|
+
clientId: number;
|
|
93
|
+
updates: UpdateClientRequest;
|
|
94
|
+
}, ProcessOutput>;
|
|
95
|
+
declare const UpdateClientIdentifier: (params: {
|
|
96
|
+
tenantId?: string;
|
|
97
|
+
clientId: number;
|
|
98
|
+
identifierId: string;
|
|
99
|
+
updates: UpdateClientIdentifierRequest;
|
|
100
|
+
}) => Command<{
|
|
101
|
+
tenantId?: string;
|
|
102
|
+
clientId: number;
|
|
103
|
+
identifierId: string;
|
|
104
|
+
updates: UpdateClientIdentifierRequest;
|
|
105
|
+
}, UpdateClientIdentifierResponse>;
|
|
106
|
+
declare const CreateClient: (params: {
|
|
107
|
+
tenantId?: string;
|
|
108
|
+
clientData: CreateClientRequest;
|
|
109
|
+
}) => Command<{
|
|
110
|
+
tenantId?: string;
|
|
111
|
+
clientData: CreateClientRequest;
|
|
112
|
+
}, CreateClientResponse>;
|
|
113
|
+
declare const GetClients: (params: ListClientsRequest, configuration: {
|
|
114
|
+
tenantId?: string;
|
|
115
|
+
}) => Command<{
|
|
116
|
+
params: ListClientsRequest;
|
|
117
|
+
configuration: {
|
|
118
|
+
tenantId?: string;
|
|
119
|
+
};
|
|
120
|
+
}, ListClientsResponse>;
|
|
121
|
+
declare const DeleteClient: (params: {
|
|
122
|
+
clientId: number;
|
|
123
|
+
tenantId?: string;
|
|
124
|
+
}) => Command<{
|
|
125
|
+
clientId: number;
|
|
126
|
+
tenantId?: string;
|
|
127
|
+
}, ProcessOutput>;
|
|
128
|
+
|
|
129
|
+
declare const GetAccount: (params: {
|
|
130
|
+
id: number;
|
|
131
|
+
tenantId?: string;
|
|
132
|
+
}) => Command<{
|
|
133
|
+
id: number;
|
|
134
|
+
tenantId?: string;
|
|
135
|
+
}, SavingAccount>;
|
|
136
|
+
declare const UpdateAccount: (params: {
|
|
137
|
+
clientId: number;
|
|
138
|
+
accountId: number;
|
|
139
|
+
updates: UpdateAccountRequest;
|
|
140
|
+
tenantId?: string;
|
|
141
|
+
}) => Command<{
|
|
142
|
+
clientId: number;
|
|
143
|
+
accountId: number;
|
|
144
|
+
updates: UpdateAccountRequest;
|
|
145
|
+
tenantId?: string;
|
|
146
|
+
}, any>;
|
|
147
|
+
declare const DeleteAccount: (params: {
|
|
148
|
+
accountId: number;
|
|
149
|
+
tenantId?: string;
|
|
150
|
+
}) => Command<{
|
|
151
|
+
accountId: number;
|
|
152
|
+
tenantId?: string;
|
|
153
|
+
}, ProcessOutput>;
|
|
154
|
+
declare const ListAccountsOfClient: (params?: {
|
|
155
|
+
clientId: number;
|
|
156
|
+
tenantId?: string;
|
|
157
|
+
}) => {
|
|
158
|
+
list: () => {
|
|
159
|
+
where: (field: string) => {
|
|
160
|
+
eq: (value: any) => /*elided*/ any;
|
|
161
|
+
};
|
|
162
|
+
execute: () => Command<any, ListAccountsOfClientRequest>;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
declare const GetAccountsOfClient: (clientId: number, params: ListAccountsOfClientRequest, configuration: {
|
|
166
|
+
tenantId?: string;
|
|
167
|
+
}) => Command<{
|
|
168
|
+
params: ListAccountsOfClientRequest;
|
|
169
|
+
configuration: {
|
|
170
|
+
tenantId?: string;
|
|
171
|
+
};
|
|
172
|
+
}, ListAccountsOfClientRequest>;
|
|
173
|
+
|
|
174
|
+
declare const GraphQL: (request: GraphQLRequest) => Command<GraphQLRequest, any>;
|
|
175
|
+
|
|
176
|
+
export { CreatePayment as C, DeleteClient as D, GetPayment as G, ListAccountsOfClient as L, SendAuthorizationToCore as S, UpdatePayment as U, GetPayments as a, UpdateCardID as b, GetClient as c, UpdateClient as d, UpdateClientIdentifier as e, CreateClient as f, GetClients as g, GetAccount as h, GetAccountsOfClient as i, UpdateAccount as j, DeleteAccount as k, GraphQL as l, DeletePayment as m };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { b as CreatePaymentInput, a as Command, P as Payment, U as UpdatePaymentInput, g as PaymentFilters, c as PaymentResponse, E as UpdateClientRequest, F as ProcessOutput, G as UpdateClientIdentifierRequest, Q as UpdateClientIdentifierResponse, D as CreateClientRequest, R as CreateClientResponse, V as ListClientsRequest, W as ListClientsResponse, v as SavingAccount, X as ListAccountsOfClientRequest, z as UpdateAccountRequest, Y as GraphQLRequest } from './client-z_1PDcj6.mjs';
|
|
2
|
+
|
|
3
|
+
declare const CreatePayment: (params: {
|
|
4
|
+
payment: CreatePaymentInput;
|
|
5
|
+
tenantId?: string;
|
|
6
|
+
}) => Command<{
|
|
7
|
+
payment: CreatePaymentInput;
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
}, Payment>;
|
|
10
|
+
declare const GetPayment: (params: {
|
|
11
|
+
id: number;
|
|
12
|
+
tenantId?: string;
|
|
13
|
+
}) => Command<{
|
|
14
|
+
id: number;
|
|
15
|
+
tenantId?: string;
|
|
16
|
+
}, Payment>;
|
|
17
|
+
declare const UpdatePayment: (params: {
|
|
18
|
+
id: number;
|
|
19
|
+
payment: UpdatePaymentInput;
|
|
20
|
+
tenantId?: string;
|
|
21
|
+
}) => Command<{
|
|
22
|
+
id: number;
|
|
23
|
+
payment: UpdatePaymentInput;
|
|
24
|
+
tenantId?: string;
|
|
25
|
+
}, Payment>;
|
|
26
|
+
declare const GetPayments: (params: PaymentFilters, configuration: {
|
|
27
|
+
tenantId?: string;
|
|
28
|
+
}) => Command<{
|
|
29
|
+
params: PaymentFilters;
|
|
30
|
+
configuration: {
|
|
31
|
+
tenantId?: string;
|
|
32
|
+
};
|
|
33
|
+
}, PaymentResponse>;
|
|
34
|
+
declare const DeletePayment: (params: {
|
|
35
|
+
id: number;
|
|
36
|
+
tenantId?: string;
|
|
37
|
+
}) => Command<{
|
|
38
|
+
id: number;
|
|
39
|
+
tenantId?: string;
|
|
40
|
+
}, void>;
|
|
41
|
+
|
|
42
|
+
interface SimpleCard {
|
|
43
|
+
internalCardId: string,
|
|
44
|
+
cardType?: string,
|
|
45
|
+
tenantIdentifier?: string,
|
|
46
|
+
status?: string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface AuthorizationRequest {
|
|
50
|
+
card: SimpleCard,
|
|
51
|
+
payload: any,
|
|
52
|
+
tenantId?: string,
|
|
53
|
+
skipNotification?: boolean,
|
|
54
|
+
flag?: string
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface CardUpdate {
|
|
58
|
+
clientId: number,
|
|
59
|
+
businessCardIDURL: string,
|
|
60
|
+
businessCardIDQRCode: string
|
|
61
|
+
tenantId?: string
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare const SendAuthorizationToCore: (params: AuthorizationRequest) => Command<AuthorizationRequest, any>;
|
|
65
|
+
declare const UpdateCardID: (params: CardUpdate) => Command<CardUpdate, void>;
|
|
66
|
+
|
|
67
|
+
declare const GetClient: (params: {
|
|
68
|
+
clientId: number;
|
|
69
|
+
tenantId?: string;
|
|
70
|
+
riskRating?: boolean;
|
|
71
|
+
clientAddress?: boolean;
|
|
72
|
+
clientIdentifier?: boolean;
|
|
73
|
+
staffInSelectedOfficeOnly?: boolean;
|
|
74
|
+
checkIdentitiesExpiration?: boolean;
|
|
75
|
+
clientAccountAssociate?: boolean;
|
|
76
|
+
}) => Command<{
|
|
77
|
+
clientId: number;
|
|
78
|
+
tenantId?: string;
|
|
79
|
+
riskRating?: boolean;
|
|
80
|
+
clientAddress?: boolean;
|
|
81
|
+
clientIdentifier?: boolean;
|
|
82
|
+
staffInSelectedOfficeOnly?: boolean;
|
|
83
|
+
checkIdentitiesExpiration?: boolean;
|
|
84
|
+
clientAccountAssociate?: boolean;
|
|
85
|
+
}, any>;
|
|
86
|
+
declare const UpdateClient: (params: {
|
|
87
|
+
tenantId?: string;
|
|
88
|
+
clientId: number;
|
|
89
|
+
updates: UpdateClientRequest;
|
|
90
|
+
}) => Command<{
|
|
91
|
+
tenantId?: string;
|
|
92
|
+
clientId: number;
|
|
93
|
+
updates: UpdateClientRequest;
|
|
94
|
+
}, ProcessOutput>;
|
|
95
|
+
declare const UpdateClientIdentifier: (params: {
|
|
96
|
+
tenantId?: string;
|
|
97
|
+
clientId: number;
|
|
98
|
+
identifierId: string;
|
|
99
|
+
updates: UpdateClientIdentifierRequest;
|
|
100
|
+
}) => Command<{
|
|
101
|
+
tenantId?: string;
|
|
102
|
+
clientId: number;
|
|
103
|
+
identifierId: string;
|
|
104
|
+
updates: UpdateClientIdentifierRequest;
|
|
105
|
+
}, UpdateClientIdentifierResponse>;
|
|
106
|
+
declare const CreateClient: (params: {
|
|
107
|
+
tenantId?: string;
|
|
108
|
+
clientData: CreateClientRequest;
|
|
109
|
+
}) => Command<{
|
|
110
|
+
tenantId?: string;
|
|
111
|
+
clientData: CreateClientRequest;
|
|
112
|
+
}, CreateClientResponse>;
|
|
113
|
+
declare const GetClients: (params: ListClientsRequest, configuration: {
|
|
114
|
+
tenantId?: string;
|
|
115
|
+
}) => Command<{
|
|
116
|
+
params: ListClientsRequest;
|
|
117
|
+
configuration: {
|
|
118
|
+
tenantId?: string;
|
|
119
|
+
};
|
|
120
|
+
}, ListClientsResponse>;
|
|
121
|
+
declare const DeleteClient: (params: {
|
|
122
|
+
clientId: number;
|
|
123
|
+
tenantId?: string;
|
|
124
|
+
}) => Command<{
|
|
125
|
+
clientId: number;
|
|
126
|
+
tenantId?: string;
|
|
127
|
+
}, ProcessOutput>;
|
|
128
|
+
|
|
129
|
+
declare const GetAccount: (params: {
|
|
130
|
+
id: number;
|
|
131
|
+
tenantId?: string;
|
|
132
|
+
}) => Command<{
|
|
133
|
+
id: number;
|
|
134
|
+
tenantId?: string;
|
|
135
|
+
}, SavingAccount>;
|
|
136
|
+
declare const UpdateAccount: (params: {
|
|
137
|
+
clientId: number;
|
|
138
|
+
accountId: number;
|
|
139
|
+
updates: UpdateAccountRequest;
|
|
140
|
+
tenantId?: string;
|
|
141
|
+
}) => Command<{
|
|
142
|
+
clientId: number;
|
|
143
|
+
accountId: number;
|
|
144
|
+
updates: UpdateAccountRequest;
|
|
145
|
+
tenantId?: string;
|
|
146
|
+
}, any>;
|
|
147
|
+
declare const DeleteAccount: (params: {
|
|
148
|
+
accountId: number;
|
|
149
|
+
tenantId?: string;
|
|
150
|
+
}) => Command<{
|
|
151
|
+
accountId: number;
|
|
152
|
+
tenantId?: string;
|
|
153
|
+
}, ProcessOutput>;
|
|
154
|
+
declare const ListAccountsOfClient: (params?: {
|
|
155
|
+
clientId: number;
|
|
156
|
+
tenantId?: string;
|
|
157
|
+
}) => {
|
|
158
|
+
list: () => {
|
|
159
|
+
where: (field: string) => {
|
|
160
|
+
eq: (value: any) => /*elided*/ any;
|
|
161
|
+
};
|
|
162
|
+
execute: () => Command<any, ListAccountsOfClientRequest>;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
declare const GetAccountsOfClient: (clientId: number, params: ListAccountsOfClientRequest, configuration: {
|
|
166
|
+
tenantId?: string;
|
|
167
|
+
}) => Command<{
|
|
168
|
+
params: ListAccountsOfClientRequest;
|
|
169
|
+
configuration: {
|
|
170
|
+
tenantId?: string;
|
|
171
|
+
};
|
|
172
|
+
}, ListAccountsOfClientRequest>;
|
|
173
|
+
|
|
174
|
+
declare const GraphQL: (request: GraphQLRequest) => Command<GraphQLRequest, any>;
|
|
175
|
+
|
|
176
|
+
export { CreatePayment as C, DeleteClient as D, GetPayment as G, ListAccountsOfClient as L, SendAuthorizationToCore as S, UpdatePayment as U, GetPayments as a, UpdateCardID as b, GetClient as c, UpdateClient as d, UpdateClientIdentifier as e, CreateClient as f, GetClients as g, GetAccount as h, GetAccountsOfClient as i, UpdateAccount as j, DeleteAccount as k, GraphQL as l, DeletePayment as m };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
import { M as Middleware
|
|
4
|
-
export { a as Config } from './client-
|
|
5
|
-
export { C as CreateClient, D as DeleteClient, G as GetClient, c as GetClients, d as GraphQL, S as SendAuthorizationToCore, U as UpdateCardID, a as UpdateClient, b as UpdateClientIdentifier } from './index-BHzajnME.mjs';
|
|
1
|
+
export { createClient } from './client/index.mjs';
|
|
2
|
+
export { f as CreateClient, C as CreatePayment, k as DeleteAccount, D as DeleteClient, h as GetAccount, i as GetAccountsOfClient, c as GetClient, g as GetClients, G as GetPayment, a as GetPayments, l as GraphQL, L as ListAccountsOfClient, S as SendAuthorizationToCore, j as UpdateAccount, b as UpdateCardID, d as UpdateClient, e as UpdateClientIdentifier, U as UpdatePayment } from './index-D3PYCZYG.mjs';
|
|
3
|
+
import { M as Middleware } from './client-z_1PDcj6.mjs';
|
|
4
|
+
export { a as Command, C as Config, b as CreatePaymentInput, r as CreatePaymentInputShape, l as CreatePaymentInputZod, L as ListAccountsOfClientResponseShape, w as ListAccountsOfClientResponseZod, x as ListAccountsRequestShape, y as ListAccountsRequestZod, P as Payment, i as PaymentFilterKeyZod, p as PaymentFilterShape, g as PaymentFilters, o as PaymentFiltersZod, e as PaymentRailType, j as PaymentRailZod, c as PaymentResponse, n as PaymentResponseZod, q as PaymentShape, d as PaymentStatus, h as PaymentStatusZod, f as PaymentType, k as PaymentTypeZod, v as SavingAccount, u as SavingAccountShape, t as SavingAccountZod, S as SortOrderZod, z as UpdateAccountRequest, B as UpdateAccountRequestShape, A as UpdateAccountRequestZod, U as UpdatePaymentInput, s as UpdatePaymentInputShape, m as UpdatePaymentInputZod } from './client-z_1PDcj6.mjs';
|
|
6
5
|
import 'zod';
|
|
7
6
|
import 'graphql';
|
|
8
7
|
import 'axios';
|
|
@@ -30,39 +29,7 @@ interface ApiError {
|
|
|
30
29
|
originalError?: Error;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
declare const CreatePayment: (params: {
|
|
34
|
-
payment: CreatePaymentInput;
|
|
35
|
-
tenantId?: string;
|
|
36
|
-
}) => Command<{
|
|
37
|
-
payment: CreatePaymentInput;
|
|
38
|
-
tenantId?: string;
|
|
39
|
-
}, Payment>;
|
|
40
|
-
declare const GetPayment: (params: {
|
|
41
|
-
id: number;
|
|
42
|
-
tenantId?: string;
|
|
43
|
-
}) => Command<{
|
|
44
|
-
id: number;
|
|
45
|
-
tenantId?: string;
|
|
46
|
-
}, Payment>;
|
|
47
|
-
declare const UpdatePayment: (params: {
|
|
48
|
-
id: number;
|
|
49
|
-
payment: UpdatePaymentInput;
|
|
50
|
-
tenantId?: string;
|
|
51
|
-
}) => Command<{
|
|
52
|
-
id: number;
|
|
53
|
-
payment: UpdatePaymentInput;
|
|
54
|
-
tenantId?: string;
|
|
55
|
-
}, Payment>;
|
|
56
|
-
declare const GetPayments: (params: PaymentFilters, configuration: {
|
|
57
|
-
tenantId?: string;
|
|
58
|
-
}) => Command<{
|
|
59
|
-
params: PaymentFilters;
|
|
60
|
-
configuration: {
|
|
61
|
-
tenantId?: string;
|
|
62
|
-
};
|
|
63
|
-
}, PaymentResponse>;
|
|
64
|
-
|
|
65
32
|
declare const createCommandError: ({ message, statusCode, code, requestId, originalError }: Omit<ApiError, "name">) => ApiError;
|
|
66
33
|
declare const isCommandError: (error: unknown) => error is ApiError;
|
|
67
34
|
|
|
68
|
-
export { type ApiError,
|
|
35
|
+
export { type ApiError, type Logger, type MetricsClient, Middleware, createCommandError, createLoggingMiddleware, createMetricsMiddleware, isCommandError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
import { M as Middleware
|
|
4
|
-
export { a as Config } from './client-
|
|
5
|
-
export { C as CreateClient, D as DeleteClient, G as GetClient, c as GetClients, d as GraphQL, S as SendAuthorizationToCore, U as UpdateCardID, a as UpdateClient, b as UpdateClientIdentifier } from './index-CQe-0gwX.js';
|
|
1
|
+
export { createClient } from './client/index.js';
|
|
2
|
+
export { f as CreateClient, C as CreatePayment, k as DeleteAccount, D as DeleteClient, h as GetAccount, i as GetAccountsOfClient, c as GetClient, g as GetClients, G as GetPayment, a as GetPayments, l as GraphQL, L as ListAccountsOfClient, S as SendAuthorizationToCore, j as UpdateAccount, b as UpdateCardID, d as UpdateClient, e as UpdateClientIdentifier, U as UpdatePayment } from './index-BcDxuEgp.js';
|
|
3
|
+
import { M as Middleware } from './client-z_1PDcj6.js';
|
|
4
|
+
export { a as Command, C as Config, b as CreatePaymentInput, r as CreatePaymentInputShape, l as CreatePaymentInputZod, L as ListAccountsOfClientResponseShape, w as ListAccountsOfClientResponseZod, x as ListAccountsRequestShape, y as ListAccountsRequestZod, P as Payment, i as PaymentFilterKeyZod, p as PaymentFilterShape, g as PaymentFilters, o as PaymentFiltersZod, e as PaymentRailType, j as PaymentRailZod, c as PaymentResponse, n as PaymentResponseZod, q as PaymentShape, d as PaymentStatus, h as PaymentStatusZod, f as PaymentType, k as PaymentTypeZod, v as SavingAccount, u as SavingAccountShape, t as SavingAccountZod, S as SortOrderZod, z as UpdateAccountRequest, B as UpdateAccountRequestShape, A as UpdateAccountRequestZod, U as UpdatePaymentInput, s as UpdatePaymentInputShape, m as UpdatePaymentInputZod } from './client-z_1PDcj6.js';
|
|
6
5
|
import 'zod';
|
|
7
6
|
import 'graphql';
|
|
8
7
|
import 'axios';
|
|
@@ -30,39 +29,7 @@ interface ApiError {
|
|
|
30
29
|
originalError?: Error;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
declare const CreatePayment: (params: {
|
|
34
|
-
payment: CreatePaymentInput;
|
|
35
|
-
tenantId?: string;
|
|
36
|
-
}) => Command<{
|
|
37
|
-
payment: CreatePaymentInput;
|
|
38
|
-
tenantId?: string;
|
|
39
|
-
}, Payment>;
|
|
40
|
-
declare const GetPayment: (params: {
|
|
41
|
-
id: number;
|
|
42
|
-
tenantId?: string;
|
|
43
|
-
}) => Command<{
|
|
44
|
-
id: number;
|
|
45
|
-
tenantId?: string;
|
|
46
|
-
}, Payment>;
|
|
47
|
-
declare const UpdatePayment: (params: {
|
|
48
|
-
id: number;
|
|
49
|
-
payment: UpdatePaymentInput;
|
|
50
|
-
tenantId?: string;
|
|
51
|
-
}) => Command<{
|
|
52
|
-
id: number;
|
|
53
|
-
payment: UpdatePaymentInput;
|
|
54
|
-
tenantId?: string;
|
|
55
|
-
}, Payment>;
|
|
56
|
-
declare const GetPayments: (params: PaymentFilters, configuration: {
|
|
57
|
-
tenantId?: string;
|
|
58
|
-
}) => Command<{
|
|
59
|
-
params: PaymentFilters;
|
|
60
|
-
configuration: {
|
|
61
|
-
tenantId?: string;
|
|
62
|
-
};
|
|
63
|
-
}, PaymentResponse>;
|
|
64
|
-
|
|
65
32
|
declare const createCommandError: ({ message, statusCode, code, requestId, originalError }: Omit<ApiError, "name">) => ApiError;
|
|
66
33
|
declare const isCommandError: (error: unknown) => error is ApiError;
|
|
67
34
|
|
|
68
|
-
export { type ApiError,
|
|
35
|
+
export { type ApiError, type Logger, type MetricsClient, Middleware, createCommandError, createLoggingMiddleware, createMetricsMiddleware, isCommandError };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkC5426MUQjs = require('./chunk-C5426MUQ.js');var _chunkWANY7FS3js = require('./chunk-WANY7FS3.js');var _chunkBYLL2GK4js = require('./chunk-BYLL2GK4.js');var Q=(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 j=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.CreateClient = _chunkBYLL2GK4js.A; exports.CreatePayment = _chunkBYLL2GK4js.r; exports.CreatePaymentInputShape = _chunkBYLL2GK4js.m; exports.CreatePaymentInputZod = _chunkBYLL2GK4js.n; exports.DeleteAccount = _chunkBYLL2GK4js.O; exports.DeleteClient = _chunkBYLL2GK4js.D; exports.GetAccount = _chunkBYLL2GK4js.M; exports.GetAccountsOfClient = _chunkBYLL2GK4js.Q; exports.GetClient = _chunkBYLL2GK4js.x; exports.GetClients = _chunkBYLL2GK4js.C; exports.GetPayment = _chunkBYLL2GK4js.s; exports.GetPayments = _chunkBYLL2GK4js.v; exports.GraphQL = _chunkWANY7FS3js.c; exports.ListAccountsOfClient = _chunkBYLL2GK4js.P; exports.ListAccountsOfClientResponseShape = _chunkBYLL2GK4js.G; exports.ListAccountsOfClientResponseZod = _chunkBYLL2GK4js.H; exports.ListAccountsRequestShape = _chunkBYLL2GK4js.I; exports.ListAccountsRequestZod = _chunkBYLL2GK4js.J; exports.PaymentFilterKeyZod = _chunkBYLL2GK4js.e; exports.PaymentFilterShape = _chunkBYLL2GK4js.j; exports.PaymentFiltersZod = _chunkBYLL2GK4js.k; exports.PaymentRailZod = _chunkBYLL2GK4js.g; exports.PaymentResponseZod = _chunkBYLL2GK4js.q; exports.PaymentShape = _chunkBYLL2GK4js.l; exports.PaymentStatusZod = _chunkBYLL2GK4js.f; exports.PaymentTypeZod = _chunkBYLL2GK4js.h; exports.SavingAccountShape = _chunkBYLL2GK4js.E; exports.SavingAccountZod = _chunkBYLL2GK4js.F; exports.SendAuthorizationToCore = _chunkWANY7FS3js.a; exports.SortOrderZod = _chunkBYLL2GK4js.i; exports.UpdateAccount = _chunkBYLL2GK4js.N; exports.UpdateAccountRequestShape = _chunkBYLL2GK4js.K; exports.UpdateAccountRequestZod = _chunkBYLL2GK4js.L; exports.UpdateCardID = _chunkWANY7FS3js.b; exports.UpdateClient = _chunkBYLL2GK4js.y; exports.UpdateClientIdentifier = _chunkBYLL2GK4js.z; exports.UpdatePayment = _chunkBYLL2GK4js.t; exports.UpdatePaymentInputShape = _chunkBYLL2GK4js.o; exports.UpdatePaymentInputZod = _chunkBYLL2GK4js.p; exports.createClient = _chunkC5426MUQjs.a; exports.createCommandError = _chunkBYLL2GK4js.a; exports.createLoggingMiddleware = Q; exports.createMetricsMiddleware = j; exports.isCommandError = _chunkBYLL2GK4js.b;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as _}from"./chunk-I22UNKNA.mjs";import{a as b,b as K,c as z}from"./chunk-TF7GWO4M.mjs";import{A as M,C as L,D as U,E as Z,F as E,G as v,H as I,I as q,J as G,K as N,L as O,M as F,N as $,O as T,P as k,Q as D,a as r,b as n,e as o,f as m,g as s,h as c,i as p,j as d,k as i,l as y,m as u,n as f,o as l,p as P,q as S,r as g,s as C,t as h,v as A,x,y as R,z as w}from"./chunk-ZPWW7X3U.mjs";var Q=(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 j=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{M as CreateClient,g as CreatePayment,u as CreatePaymentInputShape,f as CreatePaymentInputZod,T as DeleteAccount,U as DeleteClient,F as GetAccount,D as GetAccountsOfClient,x as GetClient,L as GetClients,C as GetPayment,A as GetPayments,z as GraphQL,k as ListAccountsOfClient,v as ListAccountsOfClientResponseShape,I as ListAccountsOfClientResponseZod,q as ListAccountsRequestShape,G as ListAccountsRequestZod,o as PaymentFilterKeyZod,d as PaymentFilterShape,i as PaymentFiltersZod,s as PaymentRailZod,S as PaymentResponseZod,y as PaymentShape,m as PaymentStatusZod,c as PaymentTypeZod,Z as SavingAccountShape,E as SavingAccountZod,b as SendAuthorizationToCore,p as SortOrderZod,$ as UpdateAccount,N as UpdateAccountRequestShape,O as UpdateAccountRequestZod,K as UpdateCardID,R as UpdateClient,w as UpdateClientIdentifier,h as UpdatePayment,l as UpdatePaymentInputShape,P as UpdatePaymentInputZod,_ as createClient,r as createCommandError,Q as createLoggingMiddleware,j as createMetricsMiddleware,n as isCommandError};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mbanq/core-sdk-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
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
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
package/dist/chunk-MDNXUIWP.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as g,c as f,d as x,e as N,f as B,g as F,h as U,i as k,k as L}from"./chunk-SQZ4PAOL.mjs";var E=t=>{let n=[];if(!t.baseUrl)n.push("baseUrl is required");else if(typeof t.baseUrl!="string")n.push("baseUrl must be a string");else try{new URL(t.baseUrl)}catch{n.push("baseUrl must be a valid URL")}return t.axiosConfig?.timeout!==void 0&&(typeof t.axiosConfig.timeout!="number"||t.axiosConfig.timeout<0)&&n.push("timeout must be a positive number"),n};import{z as e}from"zod";var _=e.enum(["originatorName","originatorAccount","originatorBankRoutingCode","recipientName","recipientAccount","recipientBankRoutingCode","reference","traceNumber","externalId","clientId","dateFormat","locale","originatedBy","paymentRail","paymentType","fromValueDate","toValueDate","fromExecuteDate","toExecuteDate","status","fromReturnDate","toReturnDate","isSettlement","orderBy","sortOrder"]),h=e.enum(["DRAFT","AML_SCREENING","AML_REJECTED","EXECUTION_SCHEDULED","EXECUTION_PROCESSING","EXECUTION_SUCCESS","EXECUTION_FAILURE","RETURNED","CANCELLED","COMPLIANCE_FAILURE","DELETED","UNKNOWN"]),C=e.enum(["ACH","SAMEDAYACH","WIRE","SWIFT","INTERNAL","FXPAY","CARD"]),P=e.enum(["CREDIT","DEBIT"]),T=e.enum(["ASC","DESC"]),Ge=_.options,Ke=h.options,He=C.options,Ye=P.options,We=T.options,z=t=>_.parse(t),V=t=>h.parse(t),j=t=>C.parse(t),q=t=>P.parse(t),M=t=>T.parse(t),$=e.string().min(1),G=e.string().min(1),K=e.string().min(1),H=e.string().min(1),Y=e.string().min(1),W=e.string().min(1),X=e.string().min(1),J=e.string().min(1),Q=e.string().min(1),Z=e.union([e.string(),e.number()]),ee=e.string(),te=e.string(),ne=e.string(),O=e.string(),w=e.string(),A=e.string(),ae=e.boolean(),re=e.string(),oe=t=>$.parse(t),ie=t=>G.parse(t),se=t=>K.parse(t),ce=t=>H.parse(t),pe=t=>Y.parse(t),me=t=>W.parse(t),de=t=>X.parse(t),ue=t=>J.parse(t),le=t=>Q.parse(t),ye=t=>Z.parse(t),ge=t=>ee.parse(t),fe=t=>te.parse(t),xe=t=>ne.parse(t),Ie=t=>O.parse(t),he=t=>w.parse(t),Ce=t=>A.parse(t),Pe=t=>ae.parse(t),Re=t=>re.parse(t),Fe={originatorName:$.optional(),originatorAccount:G.optional(),originatorBankRoutingCode:K.optional(),recipientName:H.optional(),recipientAccount:Y.optional(),recipientBankRoutingCode:W.optional(),reference:X.optional(),traceNumber:J.optional(),externalId:Q.optional(),clientId:Z.optional(),dateFormat:ee.optional(),locale:te.optional(),originatedBy:ne.optional(),paymentRail:C.optional(),paymentType:P.optional(),fromValueDate:O.optional(),toValueDate:O.optional(),fromExecuteDate:w.optional(),toExecuteDate:w.optional(),status:h.optional(),fromReturnDate:A.optional(),toReturnDate:A.optional(),isSettlement:ae.optional(),orderBy:re.optional(),sortOrder:T.optional(),limit:e.number().positive().optional().describe("Maximum number of records to return. Defaults to 20 if not specified. Set to 0 to return all records."),offset:e.number().min(0).optional()},Xe=e.object(Fe).partial();var Ue={id:e.number(),clientId:e.number(),amount:e.number().positive(),correlationId:e.string(),paymentType:P,paymentRail:C,recipient:e.object({cardId:e.string().optional(),recipientType:e.string(),address:e.object({line1:e.string().optional(),line2:e.string().optional(),stateCode:e.string().optional(),countryCode:e.string(),postalCode:e.string().optional()}),name:e.string()}),originator:e.object({accountId:e.string().optional(),recipientType:e.string(),address:e.object({line1:e.string().optional(),line2:e.string().optional(),stateCode:e.string().optional(),countryCode:e.string(),postalCode:e.string().optional()}),name:e.string()}),executedAt:e.string(),createdAt:e.string(),externalId:e.string(),status:h,paymentRailMetaData:e.record(e.string(),e.any()).optional(),currencyData:e.object({code:e.string(),name:e.string(),decimalPlaces:e.number(),displaySymbol:e.string(),nameCode:e.string(),currencyCodeInDigit:e.number(),isBaseCurrency:e.boolean()}),currency:e.string().min(3).max(3)},Se=e.object(Ue).catchall(e.any()),be=e.object({streetAddress:e.string().optional(),city:e.string().optional(),state:e.string().optional(),country:e.string().optional(),postalCode:e.string().optional()}).optional(),ke=e.object({name:e.string().optional(),identifier:e.string().optional(),address:be}).optional(),v=e.object({name:e.string(),identifier:e.string(),accountType:e.enum(["CHECKING","SAVINGS"]).optional(),address:be,agent:ke}),Le={amount:e.number().positive(),currency:e.string().min(3).max(3),paymentRail:C,paymentType:P,debtor:v,creditor:v,clientId:e.string().optional(),correspondent:v.optional(),exchangeRate:e.number().positive().optional(),externalId:e.string().optional(),reference:e.union([e.string(),e.array(e.string())]).optional(),paymentRailMetaData:e.record(e.string(),e.any()).optional(),chargeBearer:e.enum(["OUR","BEN","SHA"]).optional(),purposeCode:e.string().optional(),valueDate:e.string().optional(),executionDate:e.string().optional()},_e=e.object(Le).catchall(e.any()).refine(t=>(t.paymentRail==="WIRE"||t.paymentRail==="SWIFT")&&t.creditor?t.creditor.address&&t.creditor.address.state&&t.creditor.address.country:!0,{message:"For WIRE transfers, recipient address with state and country is mandatory"}),ze={amount:e.number().positive().optional(),correspondent:e.object({name:e.string().optional(),identifier:e.string().optional(),accountType:e.string().optional()}).optional(),creditor:e.object({name:e.string().optional(),identifier:e.string().optional(),accountType:e.string().optional(),agent:e.object({name:e.string().optional(),identifier:e.string().optional()}).optional()}).optional(),debtor:e.object({name:e.string().optional(),identifier:e.string().optional(),accountType:e.string().optional(),agent:e.object({name:e.string().optional(),identifier:e.string().optional()}).optional()}).optional(),exchangeRate:e.number().positive().optional(),externalId:e.string().optional(),errorCode:e.string().optional(),errorMessage:e.string().optional(),reference:e.union([e.string(),e.array(e.string())]).optional(),paymentRailMetaData:e.record(e.string(),e.any()).optional(),status:h.optional()},Ve=e.object(ze).catchall(e.any()),Je=e.object({totalFilteredRecords:e.number(),pageItems:e.array(Se)}),S=t=>Se.parse(t),De=t=>_e.parse(t),Ee=t=>Ve.parse(t);var Qe=e.object({id:e.string(),clientId:e.number(),resourceId:e.number(),resourceIdentifier:e.string()});import{ZodError as b}from"zod";var je=t=>{try{z(t)}catch(n){throw n instanceof b?g({message:`Invalid filter key: '${t}'. ${n.message}`,code:"invalid_filter_key"}):n}},qe=(t,n)=>{try{switch(t){case"status":V(n);break;case"paymentRail":j(n);break;case"paymentType":q(n);break;case"sortOrder":M(n);break;case"originatorName":oe(n);break;case"originatorAccount":ie(n);break;case"originatorBankRoutingCode":se(n);break;case"recipientName":ce(n);break;case"recipientAccount":pe(n);break;case"recipientBankRoutingCode":me(n);break;case"reference":de(n);break;case"traceNumber":ue(n);break;case"externalId":le(n);break;case"clientId":ye(n);break;case"dateFormat":ge(n);break;case"locale":fe(n);break;case"originatedBy":xe(n);break;case"fromValueDate":case"toValueDate":Ie(n);break;case"fromExecuteDate":case"toExecuteDate":he(n);break;case"fromReturnDate":case"toReturnDate":Ce(n);break;case"isSettlement":Pe(n);break;case"orderBy":Re(n);break;default:break}}catch(i){throw i instanceof b?g({message:`Invalid value for '${t}': '${n}'. ${i.message}`,code:`invalid_${t}_value`}):i}},ve=t=>({input:t,metadata:{commandName:"CreatePayment",path:"/v1/payments",method:"POST"},execute:async n=>{try{De(t.payment)}catch(a){throw a instanceof b?g({message:`Invalid payment data: ${a.message}`,code:"invalid_payment_input"}):a}t.tenantId&&(n.tenantId=t.tenantId);let i=await x(n);try{let a=await i.post("/v1/payments",t.payment);return S(a.data)}catch(a){f(a)}}}),Oe=t=>({input:t,metadata:{commandName:"GetPayment",path:`/v1/payments/${t.id}`,method:"GET"},execute:async n=>{t.tenantId&&(n.tenantId=t.tenantId);let i=await x(n);try{let a=await i.get(`/v1/payments/${t.id}`);return S(a.data)}catch(a){f(a)}}}),we=t=>({input:t,metadata:{commandName:"UpdatePayment",path:`/v1/payments/${t.id}`,method:"PUT"},execute:async n=>{try{Ee(t.payment)}catch(a){throw a instanceof b?g({message:`Invalid payment update data: ${a.message}`,code:"invalid_payment_update_input"}):a}t.tenantId&&(n.tenantId=t.tenantId);let i=await x(n);try{let a=await i.put(`/v1/payments/${t.id}`,t.payment);return S(a.data)}catch(a){f(a)}}}),R=(t,n,i,a)=>{if(n!==void 0&&n!==0&&n<=0)throw g({message:`Invalid limit: ${n}. Limit must be positive or 0 for fetching all records.`,code:"invalid_limit"});if(i!==void 0&&i<0)throw g({message:`Invalid offset: ${i}. Offset must be non-negative.`,code:"invalid_offset"});return{where:l=>(je(l),{eq:c=>(qe(l,c),R({...t,[l]:c},n,i,a))}),limit:l=>R(t,l,i,a),offset:l=>R(t,n,l,a),all:()=>R(t,0,i,a),execute:()=>{let l={locale:"en",originatedBy:"us",orderBy:"id",sortOrder:"DESC"},c={...l,...t,limit:n||200,offset:i||0};return{input:{filters:t,limit:n,offset:i,tenantId:a},metadata:{commandName:"ListPayments",path:"/v1/payments",method:"GET"},execute:async s=>{a&&(s.tenantId=a);let o=await x(s);try{if(n===0){let r=[],d=i||0,m=0;do{let y={...l,...t,limit:200,offset:d},D=await o.get("/v1/payments",{params:y}),{totalFilteredRecords:Ne,pageItems:Be}=D.data;r.push(...Be),m=Ne,d+=200}while(d<m);return{totalFilteredRecords:m,pageItems:r}}else return(await o.get("/v1/payments",{params:c})).data}catch(r){f(r)}}}}}},Ae=t=>({list:()=>R({},void 0,void 0,t?.tenantId)}),rt=(t,n)=>({input:{params:t,configuration:n},metadata:{commandName:"GetPayments",path:"/v1/payments",method:"GET"},execute:async i=>{n.tenantId&&(i.tenantId=n.tenantId);let a=await x(i),u=[],I=t.limit||20,l=t.offset||0,c=0,r={...{locale:"en",originatedBy:"us",orderBy:"id",sortOrder:"DESC"},...(p=>{let m=["fromValueDate","toValueDate","fromExecuteDate","toExecuteDate","fromReturnDate","toReturnDate"].some(D=>p[D]!==void 0),y={...p};return m&&y.dateFormat===void 0&&(y.dateFormat="yyyy-MM-dd"),y})(t),limit:I,offset:l};try{if(t.limit===0){do{let p=await a.get("/v1/payments",{params:r}),{totalFilteredRecords:d,pageItems:m}=p.data;u.push(...m),c=d,l+=I}while(l<c);return{totalFilteredRecords:c,pageItems:u}}else return(await a.get("/v1/payments",{params:r})).data}catch(p){f(p)}}}),Te=t=>({input:t,metadata:{commandName:"DeletePayment",path:`/v1/payments/${t.id}`,method:"DELETE"},execute:async n=>{t.tenantId&&(n.tenantId=t.tenantId);let i=await x(n);try{await i.delete(`/v1/payments/${t.id}`)}catch(a){f(a)}}});var mt=t=>{let n=E(t);if(n.length>0)throw g({message:`Invalid configuration: ${n.join(", ")}`,code:"invalid_config"});let i=async(c,s,o)=>{if(t.middlewares)for(let r of t.middlewares)c==="before"&&r.before?await r.before(s):c==="after"&&r.after?await r.after(s,o):c==="onError"&&r.onError&&await r.onError(s,o)},a={...t},u=async c=>{try{await i("before",c);let s=await c.execute(a);return await i("after",c,s),s}catch(s){throw await i("onError",c,s),s}},I=c=>{let s=c||a.tenantId;return{payment:{create:o=>{let r=ve({payment:o,tenantId:s});return{execute:async()=>u(r)}},get:o=>{let r=Oe({id:o,tenantId:s});return{execute:async()=>u(r)}},update:(o,r)=>{let p=we({id:o,payment:r,tenantId:s});return{execute:async()=>u(p)}},delete:o=>{let r=Te({id:o,tenantId:s});return{execute:async()=>u(r)}},list:()=>{let r=Ae({tenantId:s}).list(),p=d=>({where:d.where,limit:m=>{let y=d.limit(m);return p(y)},offset:m=>{let y=d.offset(m);return p(y)},all:()=>{let m=d.all();return p(m)},execute:async()=>{let m=d.execute();return u(m)}});return p(r)}},client:{create:o=>{let r=U({clientData:o,tenantId:s});return{execute:async()=>u(r)}},get:o=>{let r=N({clientId:o,tenantId:s});return{execute:async()=>u(r)}},update:(o,r)=>{let p=B({clientId:o,updates:r,tenantId:s});return{execute:async()=>u(p)}},updateDocumentRecord:(o,r)=>{let p=F({clientId:o,identifierId:r.id,updates:r,tenantId:s});return{execute:async()=>u(p)}},delete:o=>{let r=L({clientId:o,tenantId:s});return{execute:async()=>u(r)}},list:()=>{let r=k({tenantId:s}).list(),p=d=>({where:d.where,limit:m=>{let y=d.limit(m);return p(y)},offset:m=>{let y=d.offset(m);return p(y)},all:()=>{let m=d.all();return p(m)},execute:async()=>{let m=d.execute();return u(m)}});return p(r)}}}};return{setConfig:c=>{a=c},updateConfig:c=>{let s={...a,...c,axiosConfig:{...a.axiosConfig,...c.axiosConfig,headers:{...a.axiosConfig?.headers,...c.axiosConfig?.headers}}},o=E(s);if(o.length>0)throw g({message:`Invalid configuration: ${o.join(", ")}`,code:"invalid_config"});a=s},resetConfig:()=>{a=t},request:u,tenant:c=>I(c),...I()}};export{_ as a,h as b,C as c,P as d,T as e,Fe as f,Xe as g,Ue as h,Le as i,_e as j,ze as k,Ve as l,Je as m,ve as n,Oe as o,we as p,rt as q,mt as r};
|