@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.
@@ -1,5 +1,5 @@
1
- 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';
2
- import { d as PaymentRail, C as Command, P as ProcessOutput, e as MarkAsReturnInput, T as Transfer, G as GetTransferInput, f as UpdateTraceNumbersInput, g as CreateTransferInput, h as CreateTransferOutput } from '../client-DhU5QMWd.mjs';
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';
@@ -1,5 +1,5 @@
1
- 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';
2
- import { d as PaymentRail, C as Command, P as ProcessOutput, e as MarkAsReturnInput, T as Transfer, G as GetTransferInput, f as UpdateTraceNumbersInput, g as CreateTransferInput, h as CreateTransferOutput } from '../client-DhU5QMWd.js';
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';
@@ -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 _chunkS3G3HESYjs = require('../chunk-S3G3HESY.js');var _chunkUD2TOWHPjs = require('../chunk-UD2TOWHP.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 w=t=>({input:t,metadata:{commandName:"CreateTransfer",path:"/v1/transfers",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkUD2TOWHPjs.d.call(void 0, e);try{return(await r.post("/v1/transfers",t.transfer)).data}catch(n){_chunkUD2TOWHPjs.c.call(void 0, n)}}}),N= 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 _chunkUD2TOWHPjs.d.call(void 0, e);try{return(await r.get(`/v1/transfers/${t.id}`)).data}catch(n){_chunkUD2TOWHPjs.c.call(void 0, n)}}}),M= 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 _chunkUD2TOWHPjs.d.call(void 0, r),a=[],c=t.queryLimit||200,d=0,i=0,I={...e,limit:c,offset:d};try{do{let u=await n.get("/v1/transfers",{params:I}),{totalFilteredRecords:f,pageItems:C}=u.data;a.push(...C),i=f,d+=c}while(d<i);return a}catch(u){_chunkUD2TOWHPjs.c.call(void 0, u)}}}},E= 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 _chunkUD2TOWHPjs.d.call(void 0, r);try{return(await n.post("/v1/external-transfers?command=MARK_AS_SUCCESS",e)).data}catch(a){_chunkUD2TOWHPjs.c.call(void 0, a)}}}},U= 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 _chunkUD2TOWHPjs.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_PROCESSING",t)).data}catch(n){_chunkUD2TOWHPjs.c.call(void 0, n)}}}),G= 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 _chunkUD2TOWHPjs.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_RETURN",{...t})).data}catch(n){_chunkUD2TOWHPjs.c.call(void 0, n)}}}),v= 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 _chunkUD2TOWHPjs.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)?_chunkUD2TOWHPjs.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}}}},_= 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 _chunkUD2TOWHPjs.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_FAIL",t)).data}catch(n){_chunkUD2TOWHPjs.c.call(void 0, n)}}}),b= 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 _chunkUD2TOWHPjs.d.call(void 0, r);try{return(await n.put(`/v1/external-transfers/${t.externalId}`,e)).data}catch(a){_chunkUD2TOWHPjs.c.call(void 0, a)}}}};var k=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 _chunkUD2TOWHPjs.d.call(void 0, e);try{return(await r.put(t.url,{...t.updates},{params:t.params})).data}catch(n){_chunkUD2TOWHPjs.c.call(void 0, n)}}}),F= 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 _chunkUD2TOWHPjs.d.call(void 0, e);try{return(await r.post(t.url,t.data,{params:t.params})).data}catch(n){_chunkUD2TOWHPjs.c.call(void 0, n)}}}),L= 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 _chunkUD2TOWHPjs.d.call(void 0, e);try{return(await r.get(t.url,{params:t.params})).data}catch(n){_chunkUD2TOWHPjs.c.call(void 0, n)}}});exports.CreateClient = _chunkUD2TOWHPjs.h; exports.CreateTransfer = w; exports.CustomCreate = F; exports.CustomGet = L; exports.CustomUpdate = k; exports.DeleteClient = _chunkUD2TOWHPjs.k; exports.GetClient = _chunkUD2TOWHPjs.e; exports.GetClients = _chunkUD2TOWHPjs.j; exports.GetTransfer = N; exports.GetTransfers = M; exports.GraphQL = _chunkS3G3HESYjs.c; exports.LogFailTransfer = v; exports.MarkAsFail = _; exports.MarkAsProcessing = U; exports.MarkAsReturned = G; exports.MarkAsSuccess = E; exports.SendAuthorizationToCore = _chunkS3G3HESYjs.a; exports.UpdateCardID = _chunkS3G3HESYjs.b; exports.UpdateClient = _chunkUD2TOWHPjs.f; exports.UpdateClientIdentifier = _chunkUD2TOWHPjs.g; exports.UpdateTraceNumber = b;
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;
@@ -1 +1 @@
1
- import{a as A,b as P,c as O}from"../chunk-MNWURBTP.mjs";import{a as m,c as o,d as s,e as l,f as x,g as y,h as T,j as g,k as h}from"../chunk-SQZ4PAOL.mjs";import R from"axios";import S from"moment-timezone";var p=(t=new Date,e=!1,r=process.env.TIMEZONE??"Europe/Berlin")=>S(t.getTime()).tz(r).utc(!e);var w=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)}}}),N=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)}}}),M=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,d=0,i=0,I={...e,limit:c,offset:d};try{do{let u=await n.get("/v1/transfers",{params:I}),{totalFilteredRecords:f,pageItems:C}=u.data;a.push(...C),i=f,d+=c}while(d<i);return a}catch(u){o(u)}}}},E=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)}}}},U=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)}}}),G=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)}}}),v=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 R.isAxiosError(a)?m({message:"LogFailTransfer command failed",statusCode:a.response?.status,code:a.code,requestId:a.response?.headers?.["x-request-id"],originalError:a}):a}}}},_=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)}}}),b=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 k=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)}}}),F=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)}}}),L=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{T as CreateClient,w as CreateTransfer,F as CustomCreate,L as CustomGet,k as CustomUpdate,h as DeleteClient,l as GetClient,g as GetClients,N as GetTransfer,M as GetTransfers,O as GraphQL,v as LogFailTransfer,_ as MarkAsFail,U as MarkAsProcessing,G as MarkAsReturned,E as MarkAsSuccess,A as SendAuthorizationToCore,P as UpdateCardID,x as UpdateClient,y as UpdateClientIdentifier,b as UpdateTraceNumber};
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
- import { C as CreatePaymentInput, P as Payment, U as UpdatePaymentInput, a as PaymentFilters, b as PaymentResponse } from './index-BC3pkS--.mjs';
2
- export { q as CreatePaymentInputShape, k as CreatePaymentInputZod, h as PaymentFilterKeyZod, o as PaymentFilterShape, n as PaymentFiltersZod, e as PaymentRailType, i as PaymentRailZod, m as PaymentResponseZod, p as PaymentShape, d as PaymentStatus, g as PaymentStatusZod, f as PaymentType, j as PaymentTypeZod, S as SortOrderZod, r as UpdatePaymentInputShape, l as UpdatePaymentInputZod, c as createClient } from './index-BC3pkS--.mjs';
3
- import { M as Middleware, C as Command } from './client-DhU5QMWd.mjs';
4
- export { a as Config } from './client-DhU5QMWd.mjs';
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, Command, CreatePayment, CreatePaymentInput, GetPayment, GetPayments, type Logger, type MetricsClient, Middleware, Payment, PaymentFilters, PaymentResponse, UpdatePayment, UpdatePaymentInput, createCommandError, createLoggingMiddleware, createMetricsMiddleware, isCommandError };
35
+ export { type ApiError, type Logger, type MetricsClient, Middleware, createCommandError, createLoggingMiddleware, createMetricsMiddleware, isCommandError };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { C as CreatePaymentInput, P as Payment, U as UpdatePaymentInput, a as PaymentFilters, b as PaymentResponse } from './index-UyJmi0Vg.js';
2
- export { q as CreatePaymentInputShape, k as CreatePaymentInputZod, h as PaymentFilterKeyZod, o as PaymentFilterShape, n as PaymentFiltersZod, e as PaymentRailType, i as PaymentRailZod, m as PaymentResponseZod, p as PaymentShape, d as PaymentStatus, g as PaymentStatusZod, f as PaymentType, j as PaymentTypeZod, S as SortOrderZod, r as UpdatePaymentInputShape, l as UpdatePaymentInputZod, c as createClient } from './index-UyJmi0Vg.js';
3
- import { M as Middleware, C as Command } from './client-DhU5QMWd.js';
4
- export { a as Config } from './client-DhU5QMWd.js';
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, Command, CreatePayment, CreatePaymentInput, GetPayment, GetPayments, type Logger, type MetricsClient, Middleware, Payment, PaymentFilters, PaymentResponse, UpdatePayment, UpdatePaymentInput, createCommandError, createLoggingMiddleware, createMetricsMiddleware, isCommandError };
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 _chunkYSKKRBQDjs = require('./chunk-YSKKRBQD.js');var _chunkS3G3HESYjs = require('./chunk-S3G3HESY.js');var _chunkUD2TOWHPjs = require('./chunk-UD2TOWHP.js');var R=(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 $=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 = _chunkUD2TOWHPjs.h; exports.CreatePayment = _chunkYSKKRBQDjs.n; exports.CreatePaymentInputShape = _chunkYSKKRBQDjs.i; exports.CreatePaymentInputZod = _chunkYSKKRBQDjs.j; exports.DeleteClient = _chunkUD2TOWHPjs.k; exports.GetClient = _chunkUD2TOWHPjs.e; exports.GetClients = _chunkUD2TOWHPjs.j; exports.GetPayment = _chunkYSKKRBQDjs.o; exports.GetPayments = _chunkYSKKRBQDjs.q; exports.GraphQL = _chunkS3G3HESYjs.c; exports.PaymentFilterKeyZod = _chunkYSKKRBQDjs.a; exports.PaymentFilterShape = _chunkYSKKRBQDjs.f; exports.PaymentFiltersZod = _chunkYSKKRBQDjs.g; exports.PaymentRailZod = _chunkYSKKRBQDjs.c; exports.PaymentResponseZod = _chunkYSKKRBQDjs.m; exports.PaymentShape = _chunkYSKKRBQDjs.h; exports.PaymentStatusZod = _chunkYSKKRBQDjs.b; exports.PaymentTypeZod = _chunkYSKKRBQDjs.d; exports.SendAuthorizationToCore = _chunkS3G3HESYjs.a; exports.SortOrderZod = _chunkYSKKRBQDjs.e; exports.UpdateCardID = _chunkS3G3HESYjs.b; exports.UpdateClient = _chunkUD2TOWHPjs.f; exports.UpdateClientIdentifier = _chunkUD2TOWHPjs.g; exports.UpdatePayment = _chunkYSKKRBQDjs.p; exports.UpdatePaymentInputShape = _chunkYSKKRBQDjs.k; exports.UpdatePaymentInputZod = _chunkYSKKRBQDjs.l; exports.createClient = _chunkYSKKRBQDjs.r; exports.createCommandError = _chunkUD2TOWHPjs.a; exports.createLoggingMiddleware = R; exports.createMetricsMiddleware = $; exports.isCommandError = _chunkUD2TOWHPjs.b;
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 o,b as m,c as d,d as p,e as i,f as s,g as y,h as c,i as P,j as f,k as u,l,m as g,n as C,o as S,p as x,q as h,r as N}from"./chunk-VHSZ6TM7.mjs";import{a as v,b as F,c as L}from"./chunk-MNWURBTP.mjs";import{a as r,b as n,e as w,f as M,g as E,h as I,j as Z,k as U}from"./chunk-SQZ4PAOL.mjs";var R=(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 $=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{I as CreateClient,C as CreatePayment,P as CreatePaymentInputShape,f as CreatePaymentInputZod,U as DeleteClient,w as GetClient,Z as GetClients,S as GetPayment,h as GetPayments,L as GraphQL,o as PaymentFilterKeyZod,s as PaymentFilterShape,y as PaymentFiltersZod,d as PaymentRailZod,g as PaymentResponseZod,c as PaymentShape,m as PaymentStatusZod,p as PaymentTypeZod,v as SendAuthorizationToCore,i as SortOrderZod,F as UpdateCardID,M as UpdateClient,E as UpdateClientIdentifier,x as UpdatePayment,u as UpdatePaymentInputShape,l as UpdatePaymentInputZod,N as createClient,r as createCommandError,R as createLoggingMiddleware,$ as createMetricsMiddleware,n as isCommandError};
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.2.1",
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": {
@@ -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};