@mbanq/core-sdk-js 0.2.1 → 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-SQZ4PAOL.mjs +0 -1
- package/dist/chunk-UD2TOWHP.js +0 -1
- package/dist/chunk-VHSZ6TM7.mjs +0 -1
- package/dist/chunk-YSKKRBQD.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-SQZ4PAOL.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import F from"axios";var p=({message:t,statusCode:i,code:n,requestId:a,originalError:r})=>({name:"CommandError",message:t,statusCode:i,code:n,requestId:a,originalError:r}),ye=t=>typeof t=="object"&&t!==null&&"name"in t&&t.name==="CommandError",$=t=>{if(!t||typeof t!="object")return t;let i={...t};if(i.config&&typeof i.config=="object"){let n=i.config;if(n.httpsAgent&&typeof n.httpsAgent=="object"){let a=n.httpsAgent;delete a.sockets,delete a.freeSockets,delete a._sessionCache}}return i},u=t=>{if(F.isAxiosError(t)){let i=t.response?.data?.message,n=t.response?.status?`Request failed with status code ${t.response.status}`:t.message||"Request failed";throw p({message:i||n,statusCode:t.response?.status,code:t.code,requestId:t.response?.headers?.["x-request-id"],originalError:$(t)})}throw t};import e from"zod";var h=e.object({id:e.number(),code:e.string(),value:e.string()}),I=e.object({id:e.number(),code:e.string(),value:e.string()}),S=e.object({active:e.boolean(),mandatory:e.boolean(),systemDefined:e.boolean()}),x=e.object({id:e.number()}),R=e.object({id:e.number(),name:e.string().optional()}),D=e.object({active:e.boolean()}),v=e.object({submittedOnDate:e.array(e.number()),submittedByUsername:e.string().optional(),submittedByFirstname:e.string().optional(),submittedByLastname:e.string().optional(),activatedOnDate:e.array(e.number()).optional(),activatedByUsername:e.string().optional(),activatedByFirstname:e.string().optional(),activatedByLastname:e.string().optional()}),P=e.object({}).catchall(e.any()),M=e.object({}).catchall(e.any()),G=e.object({}).catchall(e.any()),A=e.object({constitution:P,mainBusinessLine:M,countryOfIncorporation:G}).catchall(e.any()),E=e.object({isExternalCardDebitDisable:e.boolean(),isExternalCardCreditDisable:e.boolean(),isAchDebitOutgoingDisable:e.boolean(),isAchCreditOutgoingDisable:e.boolean(),isAchDebitIncomingDisable:e.boolean(),isAchCreditIncomingDisable:e.boolean(),isInternalCreditDisable:e.boolean(),isInternalDebitDisable:e.boolean(),isWireCreditOutgoingDisable:e.boolean(),isWireCreditIncomingDisable:e.boolean(),isSwiftCreditOutgoingDisable:e.boolean(),isSwiftCreditIncomingDisable:e.boolean(),isFxpayCreditOutgoingDisable:e.boolean(),isAllocateToSubAccountDisable:e.boolean(),isInternalCreditOwnDisable:e.boolean(),type:e.string(),resourceId:e.number(),id:e.number()}).catchall(e.any()),w=e.object({}).catchall(e.any()),O=e.object({id:e.number(),accountNo:e.string(),status:I,subStatus:S,active:e.boolean(),activationDate:e.array(e.number()).optional(),firstname:e.string(),lastname:e.string(),displayName:e.string(),mobileNo:e.string(),emailAddress:e.string(),dateOfBirth:e.array(e.number()),gender:x,clientTypes:e.array(e.any()),clientClassification:R,occupation:D,isStaff:e.boolean(),skipAvs:e.boolean(),officeId:e.number(),officeName:e.string(),imageId:e.string().optional(),imagePresent:e.boolean().optional(),timeline:v,legalForm:h,clientVerificationStatus:e.string(),updatedAt:e.string(),isBlockExternalCardsAddition:e.boolean(),clientNonPersonDetails:A,clientTransferOptionData:E,authorizations:e.array(e.number()).optional(),mobileCountryCode:e.string(),clientKycStatus:w,ofLoanCycle:e.number(),ofLoanActive:e.number(),activeDepositAccount:e.number(),onBoardingStatus:e.string().optional()}).catchall(e.any()),K=e.object({riskScore:e.number(),rating:e.string()}).catchall(e.any()),W=e.object({street:e.string(),city:e.string(),state:e.string(),zipCode:e.string()}).catchall(e.any()),_=e.object({type:e.string(),value:e.string()}).catchall(e.any()),V={firstname:e.string(),middlename:e.string().optional(),lastname:e.string(),fullname:e.string().optional(),dob:e.string(),genderId:e.number(),locale:e.string(),officeId:e.number(),mobileCountryCode:e.string(),mobileNo:e.string(),emailAddress:e.string().email(),legalFormId:e.number(),externalId:e.string().optional(),isOptedForMLALStatus:e.boolean().optional(),currentMLALStatus:e.string().optional(),isStaff:e.boolean().optional(),staffId:e.number().optional(),clientClassificationId:e.number().optional(),savingsProductId:e.number().optional(),active:e.boolean().optional(),dateFormat:e.string(),activationDate:e.string().optional(),submittedOnDate:e.string(),dateOfBirth:e.string()},xe=e.object(V).catchall(e.any()),J={clientId:e.number(),status:e.string()},Re=e.object(J).catchall(e.any()),H={firstname:e.string().optional(),middlename:e.string().optional(),fullname:e.string().optional(),genderId:e.number().optional(),lastname:e.string().optional(),occupationId:e.number().optional(),mobileCountryCode:e.string().optional(),mobileNo:e.string().optional(),emailAddress:e.string().email().optional(),externalId:e.string().optional(),clientClassificationId:e.number().optional(),dateOfBirth:e.string().optional(),dateFormat:e.string().optional()},De=e.object(H).catchall(e.any()),Q={documentTypeId:e.string(),documentKey:e.string(),status:e.string(),description:e.string().optional(),issuedBy:e.string().optional(),locale:e.string().optional(),dateFormat:e.string().optional(),expiryDate:e.string().optional(),nationality:e.number().optional(),issuedDate:e.string().optional()},ve=e.object(Q).catchall(e.any()),Z={id:e.number(),officeId:e.number(),clientId:e.number(),resourceId:e.number(),changes:e.record(e.string(),e.any()),isScheduledTransfer:e.boolean(),isSkipNotification:e.boolean()},Ae=e.object(Z).catchall(e.any()),X={developerMessage:e.string(),defaultUserMessage:e.string(),userMessageGlobalisationCode:e.string(),parameterName:e.string().optional(),value:e.any().nullable(),args:e.array(e.object({value:e.any()})).optional()},Y=e.object(X),ee={developerMessage:e.string(),httpStatusCode:e.string(),defaultUserMessage:e.string(),userMessageGlobalisationCode:e.string(),errors:e.array(Y).optional()},Ee=e.object(ee).catchall(e.any()),te={tenantId:e.string().optional(),offset:e.number().optional(),limit:e.number().optional(),orderBy:e.string().optional(),sortOrder:e.string().optional(),officeId:e.number().optional(),displayName:e.string().optional(),firstname:e.string().optional(),lastname:e.string().optional(),externalId:e.string().optional(),orphansOnly:e.boolean().optional(),clientStatus:e.string().optional(),mobileNo:e.string().optional(),createdStartDate:e.string().optional(),creationEndDate:e.string().optional(),activatedStartDate:e.string().optional(),activatedEndDate:e.string().optional(),closedStartDate:e.string().optional(),closedEndDate:e.string().optional()},we=e.object(te),Oe={id:e.number(),accountNo:e.string(),status:I,subStatus:S,active:e.boolean(),activationDate:e.array(e.number()).optional(),firstname:e.string(),lastname:e.string(),displayName:e.string(),mobileNo:e.string(),emailAddress:e.string(),dateOfBirth:e.array(e.number()),gender:x,clientTypes:e.array(e.any()),clientClassification:R,occupation:D,isStaff:e.boolean(),skipAvs:e.boolean(),officeId:e.number(),officeName:e.string(),imageId:e.string().optional(),imagePresent:e.boolean().optional(),timeline:v,legalForm:h,clientVerificationStatus:e.string(),updatedAt:e.string(),isBlockExternalCardsAddition:e.boolean(),clientNonPersonDetails:A,clientTransferOptionData:E,authorizations:e.array(e.number()).optional(),mobileCountryCode:e.string(),clientKycStatus:w,ofLoanCycle:e.number(),ofLoanActive:e.number(),activeDepositAccount:e.number(),onBoardingStatus:e.string().optional()},ne={totalFilteredRecords:e.number(),pageItems:e.array(O)},ke=e.object(ne).catchall(e.any()),ie={clientData:O.optional(),riskRatingData:K.optional(),clientAddressData:W.optional(),clientIdentifierData:_.optional()},qe=e.object(ie);var ae=e.enum(["offset","limit","orderBy","sortOrder","officeId","displayName","firstname","lastname","externalId","orphansOnly","clientStatus","mobileNo","createdStartDate","creationEndDate","activatedStartDate","activatedEndDate","closedStartDate","closedEndDate"]),oe=e.enum(["displayName","accountNo","officeId","officeName"]),re=e.enum(["ASC","DESC"]),se=e.enum(["ACTIVE","PENDING","INACTIVE"]),b=t=>ae.parse(t),le=t=>oe.parse(t),ce=t=>re.parse(t),de=t=>se.parse(t),k=t=>{try{for(let[i,n]of Object.entries(t))if(b(i),n!=null)switch(i){case"orderBy":le(n);break;case"sortOrder":ce(n);break;case"clientStatus":de(n);break;case"offset":case"limit":case"officeId":e.number().min(0).parse(n);break;case"orphansOnly":e.boolean().parse(n);break;case"displayName":case"firstname":case"lastname":case"externalId":case"mobileNo":case"createdStartDate":case"creationEndDate":case"activatedStartDate":case"activatedEndDate":case"closedStartDate":case"closedEndDate":e.string().min(1).parse(n);break}}catch(i){throw i instanceof e.ZodError?p({message:`Validation error: ${i.errors.map(n=>n.message).join(", ")}`,code:"validation_error"}):i}};import me from"axios";import{v4 as fe}from"uuid";import*as j from"https";import pe from"axios";import ue from"jsonwebtoken";var q=(t,i)=>{if(!t)throw p({message:"Missing JWT secret",code:"missing_jwt_secret"});return ue.sign({signee:i},t,{algorithm:"HS512",expiresIn:"1d"})||""},U=async(t,i,n,a)=>{let r={method:"POST",url:`${i}/oauth/token`,headers:{"Content-Type":"application/x-www-form-urlencoded",tenantId:n},data:a},{data:{access_token:d}}=await pe.request(r);return t=d,t};var L={token:""},Ce=t=>t&&(t.startsWith("Bearer ")?t:`Bearer ${t}`),m=async t=>{let n=me.create({timeout:t.axiosConfig?.timeout||29e3,baseURL:t.baseUrl,headers:{"Content-Type":"application/json; charset=utf-8","JWT-Token":t?.secret?`${q(t?.secret,t?.signee||"")}`:void 0,Authorization:t.bearerToken!==void 0?Ce(t.bearerToken):t.credential?`Bearer ${L.token||await U(L.token,t.baseUrl,t.tenantId,t.credential)}`:void 0,"trace-id":t.traceId||`RequestUUID=${fe()}`,tenantId:t.tenantId},httpsAgent:new j.Agent({rejectUnauthorized:!0,keepAlive:t.axiosConfig?.keepAlive})});return t.logger&&t.logger(n),n};var Ye=t=>({input:t,metadata:{commandName:"GetClient",path:`/v1/clients/${t.clientId}`,method:"GET"},execute:async i=>{t.tenantId&&(i.tenantId=t.tenantId);let n=await m(i);try{let a={},r=new URLSearchParams;t.staffInSelectedOfficeOnly&&r.append("staffInSelectedOfficeOnly","true"),t.checkIdentitiesExpiration&&r.append("checkIdentitiesExpiration","true"),t.clientAccountAssociate&&r.append("clientAccountAssociate","true");let d=r.toString(),o=`/v1/clients/${t.clientId}${d?`?${d}`:""}`,s=await n.get(o);if(a.clientData=s,t.riskRating){let l=await n.get(`/v1/clients/${t.clientId}/riskrating`);a.riskRatingData=l}if(t.clientAddress){let l=await n.get(`/v1/client/${t.clientId}/addresses`);a.clientAddressData=l}if(t.clientIdentifier){let l=await n.get(`/v1/clients/${t.clientId}/identifiers?unmaskValue=true`);a.clientIdentifierData=l}return a}catch(a){u(a)}}}),et=t=>({input:t,metadata:{commandName:"UpdateClient",path:`/v1/clients/${t.clientId}`,method:"PUT"},execute:async i=>{t.tenantId&&(i.tenantId=t.tenantId);let n=await m(i);try{return(await n.put(`/v1/clients/${t.clientId}`,{...t.updates})).data}catch(a){u(a)}}}),tt=t=>({input:t,metadata:{commandName:"UpdateClientIdentifier",path:`/v1/clients/${t.clientId}/identifiers/${t.identifierId}`,method:"PUT"},execute:async i=>{t.tenantId&&(i.tenantId=t.tenantId);let n=await m(i);try{return(await n.put(`/v1/clients/${t.clientId}/identifiers/${t.identifierId}`,{...t.updates})).data}catch(a){u(a)}}}),nt=t=>({input:t,metadata:{commandName:"CreateClient",path:"/v1/clients",method:"POST"},execute:async i=>{t.tenantId&&(i.tenantId=t.tenantId);let n=await m(i);try{return(await n.post("/v1/clients",t.clientData)).data}catch(a){u(a)}}}),C=(t,i,n,a)=>{if(i!==void 0&&i!==0&&i<=0)throw p({message:`Invalid limit: ${i}. Limit must be positive or 0 for fetching all records.`,code:"invalid_limit"});if(n!==void 0&&n<0)throw p({message:`Invalid offset: ${n}. Offset must be non-negative.`,code:"invalid_offset"});return{where:o=>(b(o),{eq:s=>(k({[o]:s}),C({...t,[o]:s},i,n,a))}),limit:o=>C(t,o,n,a),offset:o=>C(t,i,o,a),all:()=>C(t,0,n,a),execute:()=>{let o={...t,limit:i||200,offset:n||0};return{input:{filters:t,limit:i,offset:n,tenantId:a},metadata:{commandName:"ListClients",path:"/v1/clients",method:"GET"},execute:async s=>{a&&(s.tenantId=a);let l=await m(s);try{if(i===0){let c=[],f=n||0,g=0;do{let T={...t,limit:200,offset:f},N=await l.get("/v1/clients",{params:T}),{totalFilteredRecords:z,pageItems:B}=N.data;c.push(...B),g=z,f+=200}while(f<g);return{totalFilteredRecords:g,pageItems:c}}else return(await l.get("/v1/clients",{params:o})).data}catch(c){u(c)}}}}}},it=t=>({list:()=>C({},void 0,void 0,t?.tenantId)}),at=(t,i)=>({input:{params:t,configuration:i},metadata:{commandName:"GetClients",path:"/v1/clients",method:"GET"},execute:async n=>{i.tenantId&&(n.tenantId=i.tenantId);let a=await m(n),r=[],d=t.limit||200,o=t.offset||0,s=0,l={...t,limit:d,offset:o};try{if(t.limit===0){do{let c=await a.get("/v1/clients",{params:l}),{totalFilteredRecords:y,pageItems:f}=c.data;r.push(...f),s=y,o+=d}while(o<s);return{totalFilteredRecords:s,pageItems:r}}else return(await a.get("/v1/clients",{params:l})).data}catch(c){u(c)}}}),ot=t=>({input:t,metadata:{commandName:"DeleteClient",path:`/v1/clients/${t.clientId}`,method:"DELETE"},execute:async i=>{t.tenantId&&(i.tenantId=t.tenantId);let n=await m(i);try{return(await n.delete(`/v1/clients/${t.clientId}`)).data}catch(a){u(a)}}});export{p as a,ye as b,u as c,m as d,Ye as e,et as f,tt as g,nt as h,it as i,at as j,ot as k};
|