@mbanq/core-sdk-js 0.4.1 → 0.5.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 { 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-Dxa-lc7x.mjs';
2
- import { I as UpdateRecipientRequest, a as Command, R as Recipient, J as PaymentRail, F as ProcessOutput, K as MarkAsReturnInput, T as Transfer, N as GetTransferInput, O as UpdateTraceNumbersInput, Q as CreateTransferInput, V as CreateTransferOutput, H as CreateRecipientRequest, W as RecipientRequest, X as Recipients } from '../client-BUCNGFJy.mjs';
1
+ export { f as CreateClient, C as CreatePayment, k as DeleteAccount, D as DeleteClient, n as DeletePayment, h as GetAccount, i as GetAccountsOfClient, c as GetClient, g as GetClients, G as GetPayment, a as GetPayments, m as GetUserDetail, 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 '../user-D60hmfvO.mjs';
2
+ import { I as UpdateRecipientRequest, a as Command, R as Recipient, J as PaymentRail, F as ProcessOutput, K as MarkAsReturnInput, T as Transfer, N as GetTransferInput, O as UpdateTraceNumbersInput, Q as CreateTransferInput, V as CreateTransferOutput, H as CreateRecipientRequest, W as RecipientRequest, X as Recipients } from '../client-CHyhpYj2.mjs';
3
3
  import 'zod';
4
4
  import 'graphql';
5
5
  import 'axios';
@@ -1,5 +1,5 @@
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-DD8EyNPZ.js';
2
- import { I as UpdateRecipientRequest, a as Command, R as Recipient, J as PaymentRail, F as ProcessOutput, K as MarkAsReturnInput, T as Transfer, N as GetTransferInput, O as UpdateTraceNumbersInput, Q as CreateTransferInput, V as CreateTransferOutput, H as CreateRecipientRequest, W as RecipientRequest, X as Recipients } from '../client-BUCNGFJy.js';
1
+ export { f as CreateClient, C as CreatePayment, k as DeleteAccount, D as DeleteClient, n as DeletePayment, h as GetAccount, i as GetAccountsOfClient, c as GetClient, g as GetClients, G as GetPayment, a as GetPayments, m as GetUserDetail, 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 '../user-DgjDSbhD.js';
2
+ import { I as UpdateRecipientRequest, a as Command, R as Recipient, J as PaymentRail, F as ProcessOutput, K as MarkAsReturnInput, T as Transfer, N as GetTransferInput, O as UpdateTraceNumbersInput, Q as CreateTransferInput, V as CreateTransferOutput, H as CreateRecipientRequest, W as RecipientRequest, X as Recipients } from '../client-CHyhpYj2.js';
3
3
  import 'zod';
4
4
  import 'graphql';
5
5
  import 'axios';
@@ -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 _chunkZOZRUFBNjs = require('../chunk-ZOZRUFBN.js');var _chunkAVRYYGRQjs = require('../chunk-AVRYYGRQ.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 $=t=>({input:t,metadata:{commandName:"CreateTransfer",path:"/v1/transfers",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkAVRYYGRQjs.d.call(void 0, e);try{return(await r.post("/v1/transfers",t.transfer)).data}catch(n){_chunkAVRYYGRQjs.c.call(void 0, n)}}}),z= 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 _chunkAVRYYGRQjs.d.call(void 0, e);try{return(await r.get(`/v1/transfers/${t.id}`)).data}catch(n){_chunkAVRYYGRQjs.c.call(void 0, n)}}}),B= 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 _chunkAVRYYGRQjs.d.call(void 0, r),a=[],u=t.queryLimit||200,c=0,i=0,I={...e,limit:u,offset:c};try{do{let d=await n.get("/v1/transfers",{params:I}),{totalFilteredRecords:f,pageItems:C}=d.data;a.push(...C),i=f,c+=u}while(c<i);return a}catch(d){_chunkAVRYYGRQjs.c.call(void 0, d)}}}},H= 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 _chunkAVRYYGRQjs.d.call(void 0, r);try{return(await n.post("/v1/external-transfers?command=MARK_AS_SUCCESS",e)).data}catch(a){_chunkAVRYYGRQjs.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 _chunkAVRYYGRQjs.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_PROCESSING",t)).data}catch(n){_chunkAVRYYGRQjs.c.call(void 0, n)}}}),Z= 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 _chunkAVRYYGRQjs.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_RETURN",{...t})).data}catch(n){_chunkAVRYYGRQjs.c.call(void 0, n)}}}),X= 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 _chunkAVRYYGRQjs.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)?_chunkAVRYYGRQjs.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}}}},j= 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 _chunkAVRYYGRQjs.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_FAIL",t)).data}catch(n){_chunkAVRYYGRQjs.c.call(void 0, n)}}}),J= 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 _chunkAVRYYGRQjs.d.call(void 0, r);try{return(await n.put(`/v1/external-transfers/${t.externalId}`,e)).data}catch(a){_chunkAVRYYGRQjs.c.call(void 0, a)}}}};var V=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 _chunkAVRYYGRQjs.d.call(void 0, e);try{return(await r.put(t.url,{...t.updates},{params:t.params})).data}catch(n){_chunkAVRYYGRQjs.c.call(void 0, n)}}}),W= 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 _chunkAVRYYGRQjs.d.call(void 0, e);try{return(await r.post(t.url,t.data,{params:t.params})).data}catch(n){_chunkAVRYYGRQjs.c.call(void 0, n)}}}),Y= 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 _chunkAVRYYGRQjs.d.call(void 0, e);try{return(await r.get(t.url,{params:t.params})).data}catch(n){_chunkAVRYYGRQjs.c.call(void 0, n)}}});exports.CreateClient = _chunkAVRYYGRQjs.A; exports.CreatePayment = _chunkAVRYYGRQjs.r; exports.CreateRecipient = _chunkAVRYYGRQjs.S; exports.CreateTransfer = $; exports.CustomCreate = W; exports.CustomGet = Y; exports.CustomUpdate = V; exports.DeleteAccount = _chunkAVRYYGRQjs.O; exports.DeleteClient = _chunkAVRYYGRQjs.D; exports.DeletePayment = _chunkAVRYYGRQjs.w; exports.DeleteRecipient = _chunkAVRYYGRQjs.T; exports.GetAccount = _chunkAVRYYGRQjs.M; exports.GetAccountsOfClient = _chunkAVRYYGRQjs.Q; exports.GetClient = _chunkAVRYYGRQjs.x; exports.GetClients = _chunkAVRYYGRQjs.C; exports.GetPayment = _chunkAVRYYGRQjs.s; exports.GetPayments = _chunkAVRYYGRQjs.v; exports.GetRecipient = _chunkAVRYYGRQjs.R; exports.GetRecipients = _chunkAVRYYGRQjs.V; exports.GetTransfer = z; exports.GetTransfers = B; exports.GraphQL = _chunkAVRYYGRQjs.W; exports.ListAccountsOfClient = _chunkAVRYYGRQjs.P; exports.LogFailTransfer = X; exports.MarkAsFail = j; exports.MarkAsProcessing = Q; exports.MarkAsReturned = Z; exports.MarkAsSuccess = H; exports.SendAuthorizationToCore = _chunkZOZRUFBNjs.a; exports.UpdateAccount = _chunkAVRYYGRQjs.N; exports.UpdateCardID = _chunkZOZRUFBNjs.b; exports.UpdateClient = _chunkAVRYYGRQjs.y; exports.UpdateClientIdentifier = _chunkAVRYYGRQjs.z; exports.UpdatePayment = _chunkAVRYYGRQjs.t; exports.UpdateRecipient = _chunkAVRYYGRQjs.X; exports.UpdateTraceNumber = J;
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 _chunkZJN6HYOWjs = require('../chunk-ZJN6HYOW.js');var _chunkNKXRKPECjs = require('../chunk-NKXRKPEC.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 z=t=>({input:t,metadata:{commandName:"CreateTransfer",path:"/v1/transfers",method:"POST"},execute:async e=>{t.tenantId&&(e.tenantId=t.tenantId);let r=await _chunkNKXRKPECjs.d.call(void 0, e);try{return(await r.post("/v1/transfers",t.transfer)).data}catch(n){_chunkNKXRKPECjs.c.call(void 0, n)}}}),B= 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 _chunkNKXRKPECjs.d.call(void 0, e);try{return(await r.get(`/v1/transfers/${t.id}`)).data}catch(n){_chunkNKXRKPECjs.c.call(void 0, n)}}}),H= 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 _chunkNKXRKPECjs.d.call(void 0, r),a=[],u=t.queryLimit||200,c=0,i=0,I={...e,limit:u,offset:c};try{do{let d=await n.get("/v1/transfers",{params:I}),{totalFilteredRecords:f,pageItems:C}=d.data;a.push(...C),i=f,c+=u}while(c<i);return a}catch(d){_chunkNKXRKPECjs.c.call(void 0, d)}}}},Q= 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 _chunkNKXRKPECjs.d.call(void 0, r);try{return(await n.post("/v1/external-transfers?command=MARK_AS_SUCCESS",e)).data}catch(a){_chunkNKXRKPECjs.c.call(void 0, a)}}}},Z= 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 _chunkNKXRKPECjs.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_PROCESSING",t)).data}catch(n){_chunkNKXRKPECjs.c.call(void 0, n)}}}),X= 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 _chunkNKXRKPECjs.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_RETURN",{...t})).data}catch(n){_chunkNKXRKPECjs.c.call(void 0, n)}}}),j= 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 _chunkNKXRKPECjs.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)?_chunkNKXRKPECjs.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}}}},J= 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 _chunkNKXRKPECjs.d.call(void 0, e);try{return(await r.post("/v1/external-transfers?command=MARK_AS_FAIL",t)).data}catch(n){_chunkNKXRKPECjs.c.call(void 0, n)}}}),V= 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 _chunkNKXRKPECjs.d.call(void 0, r);try{return(await n.put(`/v1/external-transfers/${t.externalId}`,e)).data}catch(a){_chunkNKXRKPECjs.c.call(void 0, a)}}}};var W=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 _chunkNKXRKPECjs.d.call(void 0, e);try{return(await r.put(t.url,{...t.updates},{params:t.params})).data}catch(n){_chunkNKXRKPECjs.c.call(void 0, n)}}}),Y= 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 _chunkNKXRKPECjs.d.call(void 0, e);try{return(await r.post(t.url,t.data,{params:t.params})).data}catch(n){_chunkNKXRKPECjs.c.call(void 0, n)}}}),tt= 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 _chunkNKXRKPECjs.d.call(void 0, e);try{return(await r.get(t.url,{params:t.params})).data}catch(n){_chunkNKXRKPECjs.c.call(void 0, n)}}});exports.CreateClient = _chunkNKXRKPECjs.A; exports.CreatePayment = _chunkNKXRKPECjs.r; exports.CreateRecipient = _chunkNKXRKPECjs.S; exports.CreateTransfer = z; exports.CustomCreate = Y; exports.CustomGet = tt; exports.CustomUpdate = W; exports.DeleteAccount = _chunkNKXRKPECjs.O; exports.DeleteClient = _chunkNKXRKPECjs.D; exports.DeletePayment = _chunkNKXRKPECjs.w; exports.DeleteRecipient = _chunkNKXRKPECjs.T; exports.GetAccount = _chunkNKXRKPECjs.M; exports.GetAccountsOfClient = _chunkNKXRKPECjs.Q; exports.GetClient = _chunkNKXRKPECjs.x; exports.GetClients = _chunkNKXRKPECjs.C; exports.GetPayment = _chunkNKXRKPECjs.s; exports.GetPayments = _chunkNKXRKPECjs.v; exports.GetRecipient = _chunkNKXRKPECjs.R; exports.GetRecipients = _chunkNKXRKPECjs.V; exports.GetTransfer = B; exports.GetTransfers = H; exports.GetUserDetail = _chunkNKXRKPECjs.Y; exports.GraphQL = _chunkNKXRKPECjs.W; exports.ListAccountsOfClient = _chunkNKXRKPECjs.P; exports.LogFailTransfer = j; exports.MarkAsFail = J; exports.MarkAsProcessing = Z; exports.MarkAsReturned = X; exports.MarkAsSuccess = Q; exports.SendAuthorizationToCore = _chunkZJN6HYOWjs.a; exports.UpdateAccount = _chunkNKXRKPECjs.N; exports.UpdateCardID = _chunkZJN6HYOWjs.b; exports.UpdateClient = _chunkNKXRKPECjs.y; exports.UpdateClientIdentifier = _chunkNKXRKPECjs.z; exports.UpdatePayment = _chunkNKXRKPECjs.t; exports.UpdateRecipient = _chunkNKXRKPECjs.X; exports.UpdateTraceNumber = V;
@@ -1 +1 @@
1
- import{a as L,b as F}from"../chunk-TIFVVBDZ.mjs";import{A as R,C as O,D as S,M as w,N as G,O as N,P as U,Q as M,R as E,S as v,T as _,V as b,W as k,X as D,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-ZRBPB43P.mjs";import q from"axios";import K from"moment-timezone";var p=(t=new Date,e=!1,r=process.env.TIMEZONE??"Europe/Berlin")=>K(t.getTime()).tz(r).utc(!e);var $=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)}}}),z=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)}}}),B=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=[],u=t.queryLimit||200,c=0,i=0,I={...e,limit:u,offset:c};try{do{let d=await n.get("/v1/transfers",{params:I}),{totalFilteredRecords:f,pageItems:C}=d.data;a.push(...C),i=f,c+=u}while(c<i);return a}catch(d){o(d)}}}},H=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)}}}),Z=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)}}}),X=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 q.isAxiosError(a)?m({message:"LogFailTransfer command failed",statusCode:a.response?.status,code:a.code,requestId:a.response?.headers?.["x-request-id"],originalError:a}):a}}}},j=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)}}}),J=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 V=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)}}}),W=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)}}}),Y=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{R as CreateClient,l as CreatePayment,v as CreateRecipient,$ as CreateTransfer,W as CustomCreate,Y as CustomGet,V as CustomUpdate,N as DeleteAccount,S as DeleteClient,g as DeletePayment,_ as DeleteRecipient,w as GetAccount,M as GetAccountsOfClient,h as GetClient,O as GetClients,y as GetPayment,T as GetPayments,E as GetRecipient,b as GetRecipients,z as GetTransfer,B as GetTransfers,k as GraphQL,U as ListAccountsOfClient,X as LogFailTransfer,j as MarkAsFail,Q as MarkAsProcessing,Z as MarkAsReturned,H as MarkAsSuccess,L as SendAuthorizationToCore,G as UpdateAccount,F as UpdateCardID,A as UpdateClient,P as UpdateClientIdentifier,x as UpdatePayment,D as UpdateRecipient,J as UpdateTraceNumber};
1
+ import{a as F,b as K}from"../chunk-VKDW7GQQ.mjs";import{A as R,C as O,D as S,M as G,N as w,O as N,P as U,Q as M,R as E,S as v,T as _,V as D,W as b,X as k,Y as L,a as m,c as o,d as s,r as l,s as x,t as y,v as T,w as g,x as h,y as A,z as P}from"../chunk-PEZBB7Q7.mjs";import $ from"axios";import q from"moment-timezone";var p=(t=new Date,e=!1,r=process.env.TIMEZONE??"Europe/Berlin")=>q(t.getTime()).tz(r).utc(!e);var z=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)}}}),B=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)}}}),H=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=[],u=t.queryLimit||200,c=0,i=0,I={...e,limit:u,offset:c};try{do{let d=await n.get("/v1/transfers",{params:I}),{totalFilteredRecords:f,pageItems:C}=d.data;a.push(...C),i=f,c+=u}while(c<i);return a}catch(d){o(d)}}}},Q=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)}}}},Z=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)}}}),X=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)}}}),j=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 $.isAxiosError(a)?m({message:"LogFailTransfer command failed",statusCode:a.response?.status,code:a.code,requestId:a.response?.headers?.["x-request-id"],originalError:a}):a}}}},J=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)}}}),V=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 W=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)}}}),Y=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)}}}),tt=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{R as CreateClient,l as CreatePayment,v as CreateRecipient,z as CreateTransfer,Y as CustomCreate,tt as CustomGet,W as CustomUpdate,N as DeleteAccount,S as DeleteClient,g as DeletePayment,_ as DeleteRecipient,G as GetAccount,M as GetAccountsOfClient,h as GetClient,O as GetClients,x as GetPayment,T as GetPayments,E as GetRecipient,D as GetRecipients,B as GetTransfer,H as GetTransfers,L as GetUserDetail,b as GraphQL,U as ListAccountsOfClient,j as LogFailTransfer,J as MarkAsFail,Z as MarkAsProcessing,X as MarkAsReturned,Q as MarkAsSuccess,F as SendAuthorizationToCore,w as UpdateAccount,K as UpdateCardID,A as UpdateClient,P as UpdateClientIdentifier,y as UpdatePayment,k as UpdateRecipient,V as UpdateTraceNumber};
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
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-Dxa-lc7x.mjs';
3
- import { M as Middleware } from './client-BUCNGFJy.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-BUCNGFJy.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, m as GetUserDetail, 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 './user-D60hmfvO.mjs';
3
+ import { M as Middleware } from './client-CHyhpYj2.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-CHyhpYj2.mjs';
5
5
  import 'zod';
6
6
  import 'graphql';
7
7
  import 'axios';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
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-DD8EyNPZ.js';
3
- import { M as Middleware } from './client-BUCNGFJy.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-BUCNGFJy.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, m as GetUserDetail, 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 './user-DgjDSbhD.js';
3
+ import { M as Middleware } from './client-CHyhpYj2.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-CHyhpYj2.js';
5
5
  import 'zod';
6
6
  import 'graphql';
7
7
  import 'axios';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5DOBPPELjs = require('./chunk-5DOBPPEL.js');var _chunkZOZRUFBNjs = require('./chunk-ZOZRUFBN.js');var _chunkAVRYYGRQjs = require('./chunk-AVRYYGRQ.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 = _chunkAVRYYGRQjs.A; exports.CreatePayment = _chunkAVRYYGRQjs.r; exports.CreatePaymentInputShape = _chunkAVRYYGRQjs.m; exports.CreatePaymentInputZod = _chunkAVRYYGRQjs.n; exports.DeleteAccount = _chunkAVRYYGRQjs.O; exports.DeleteClient = _chunkAVRYYGRQjs.D; exports.GetAccount = _chunkAVRYYGRQjs.M; exports.GetAccountsOfClient = _chunkAVRYYGRQjs.Q; exports.GetClient = _chunkAVRYYGRQjs.x; exports.GetClients = _chunkAVRYYGRQjs.C; exports.GetPayment = _chunkAVRYYGRQjs.s; exports.GetPayments = _chunkAVRYYGRQjs.v; exports.GraphQL = _chunkAVRYYGRQjs.W; exports.ListAccountsOfClient = _chunkAVRYYGRQjs.P; exports.ListAccountsOfClientResponseShape = _chunkAVRYYGRQjs.G; exports.ListAccountsOfClientResponseZod = _chunkAVRYYGRQjs.H; exports.ListAccountsRequestShape = _chunkAVRYYGRQjs.I; exports.ListAccountsRequestZod = _chunkAVRYYGRQjs.J; exports.PaymentFilterKeyZod = _chunkAVRYYGRQjs.e; exports.PaymentFilterShape = _chunkAVRYYGRQjs.j; exports.PaymentFiltersZod = _chunkAVRYYGRQjs.k; exports.PaymentRailZod = _chunkAVRYYGRQjs.g; exports.PaymentResponseZod = _chunkAVRYYGRQjs.q; exports.PaymentShape = _chunkAVRYYGRQjs.l; exports.PaymentStatusZod = _chunkAVRYYGRQjs.f; exports.PaymentTypeZod = _chunkAVRYYGRQjs.h; exports.SavingAccountShape = _chunkAVRYYGRQjs.E; exports.SavingAccountZod = _chunkAVRYYGRQjs.F; exports.SendAuthorizationToCore = _chunkZOZRUFBNjs.a; exports.SortOrderZod = _chunkAVRYYGRQjs.i; exports.UpdateAccount = _chunkAVRYYGRQjs.N; exports.UpdateAccountRequestShape = _chunkAVRYYGRQjs.K; exports.UpdateAccountRequestZod = _chunkAVRYYGRQjs.L; exports.UpdateCardID = _chunkZOZRUFBNjs.b; exports.UpdateClient = _chunkAVRYYGRQjs.y; exports.UpdateClientIdentifier = _chunkAVRYYGRQjs.z; exports.UpdatePayment = _chunkAVRYYGRQjs.t; exports.UpdatePaymentInputShape = _chunkAVRYYGRQjs.o; exports.UpdatePaymentInputZod = _chunkAVRYYGRQjs.p; exports.createClient = _chunk5DOBPPELjs.a; exports.createCommandError = _chunkAVRYYGRQjs.a; exports.createLoggingMiddleware = Q; exports.createMetricsMiddleware = j; exports.isCommandError = _chunkAVRYYGRQjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHUUKIV67js = require('./chunk-HUUKIV67.js');var _chunkZJN6HYOWjs = require('./chunk-ZJN6HYOW.js');var _chunkNKXRKPECjs = require('./chunk-NKXRKPEC.js');var j=(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 B=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 = _chunkNKXRKPECjs.A; exports.CreatePayment = _chunkNKXRKPECjs.r; exports.CreatePaymentInputShape = _chunkNKXRKPECjs.m; exports.CreatePaymentInputZod = _chunkNKXRKPECjs.n; exports.DeleteAccount = _chunkNKXRKPECjs.O; exports.DeleteClient = _chunkNKXRKPECjs.D; exports.GetAccount = _chunkNKXRKPECjs.M; exports.GetAccountsOfClient = _chunkNKXRKPECjs.Q; exports.GetClient = _chunkNKXRKPECjs.x; exports.GetClients = _chunkNKXRKPECjs.C; exports.GetPayment = _chunkNKXRKPECjs.s; exports.GetPayments = _chunkNKXRKPECjs.v; exports.GetUserDetail = _chunkNKXRKPECjs.Y; exports.GraphQL = _chunkNKXRKPECjs.W; exports.ListAccountsOfClient = _chunkNKXRKPECjs.P; exports.ListAccountsOfClientResponseShape = _chunkNKXRKPECjs.G; exports.ListAccountsOfClientResponseZod = _chunkNKXRKPECjs.H; exports.ListAccountsRequestShape = _chunkNKXRKPECjs.I; exports.ListAccountsRequestZod = _chunkNKXRKPECjs.J; exports.PaymentFilterKeyZod = _chunkNKXRKPECjs.e; exports.PaymentFilterShape = _chunkNKXRKPECjs.j; exports.PaymentFiltersZod = _chunkNKXRKPECjs.k; exports.PaymentRailZod = _chunkNKXRKPECjs.g; exports.PaymentResponseZod = _chunkNKXRKPECjs.q; exports.PaymentShape = _chunkNKXRKPECjs.l; exports.PaymentStatusZod = _chunkNKXRKPECjs.f; exports.PaymentTypeZod = _chunkNKXRKPECjs.h; exports.SavingAccountShape = _chunkNKXRKPECjs.E; exports.SavingAccountZod = _chunkNKXRKPECjs.F; exports.SendAuthorizationToCore = _chunkZJN6HYOWjs.a; exports.SortOrderZod = _chunkNKXRKPECjs.i; exports.UpdateAccount = _chunkNKXRKPECjs.N; exports.UpdateAccountRequestShape = _chunkNKXRKPECjs.K; exports.UpdateAccountRequestZod = _chunkNKXRKPECjs.L; exports.UpdateCardID = _chunkZJN6HYOWjs.b; exports.UpdateClient = _chunkNKXRKPECjs.y; exports.UpdateClientIdentifier = _chunkNKXRKPECjs.z; exports.UpdatePayment = _chunkNKXRKPECjs.t; exports.UpdatePaymentInputShape = _chunkNKXRKPECjs.o; exports.UpdatePaymentInputZod = _chunkNKXRKPECjs.p; exports.createClient = _chunkHUUKIV67js.a; exports.createCommandError = _chunkNKXRKPECjs.a; exports.createLoggingMiddleware = j; exports.createMetricsMiddleware = B; exports.isCommandError = _chunkNKXRKPECjs.b;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a as b}from"./chunk-67S4CQFY.mjs";import{a as K,b as z}from"./chunk-TIFVVBDZ.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,W as _,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-ZRBPB43P.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,_ 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,K as SendAuthorizationToCore,p as SortOrderZod,$ as UpdateAccount,N as UpdateAccountRequestShape,O as UpdateAccountRequestZod,z as UpdateCardID,R as UpdateClient,w as UpdateClientIdentifier,h as UpdatePayment,l as UpdatePaymentInputShape,P as UpdatePaymentInputZod,b as createClient,r as createCommandError,Q as createLoggingMiddleware,j as createMetricsMiddleware,n as isCommandError};
1
+ import{a as K}from"./chunk-ICLPMQUX.mjs";import{a as z,b as Q}from"./chunk-VKDW7GQQ.mjs";import{A as M,C as U,D as L,E as Z,F as E,G as v,H as I,I as G,J as q,K as N,L as O,M as F,N as $,O as T,P as k,Q as D,W as _,Y as b,a as r,b as n,e as o,f as m,g as s,h as c,i as p,j as i,k as d,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-PEZBB7Q7.mjs";var j=(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 B=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,L as DeleteClient,F as GetAccount,D as GetAccountsOfClient,x as GetClient,U as GetClients,C as GetPayment,A as GetPayments,b as GetUserDetail,_ as GraphQL,k as ListAccountsOfClient,v as ListAccountsOfClientResponseShape,I as ListAccountsOfClientResponseZod,G as ListAccountsRequestShape,q as ListAccountsRequestZod,o as PaymentFilterKeyZod,i as PaymentFilterShape,d as PaymentFiltersZod,s as PaymentRailZod,S as PaymentResponseZod,y as PaymentShape,m as PaymentStatusZod,c as PaymentTypeZod,Z as SavingAccountShape,E as SavingAccountZod,z as SendAuthorizationToCore,p as SortOrderZod,$ as UpdateAccount,N as UpdateAccountRequestShape,O as UpdateAccountRequestZod,Q as UpdateCardID,R as UpdateClient,w as UpdateClientIdentifier,h as UpdatePayment,l as UpdatePaymentInputShape,P as UpdatePaymentInputZod,K as createClient,r as createCommandError,j as createLoggingMiddleware,B as createMetricsMiddleware,n as isCommandError};
@@ -1,4 +1,5 @@
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, Y as UpdateClientIdentifierResponse, D as CreateClientRequest, Z as CreateClientResponse, _ as ListClientsRequest, $ as ListClientsResponse, v as SavingAccount, a0 as ListAccountsOfClientRequest, z as UpdateAccountRequest, a1 as GraphQLRequest } from './client-BUCNGFJy.mjs';
1
+ import { b as CreatePaymentInput, a as Command, Y as ProcessOutput, P as Payment, U as UpdatePaymentInput, g as PaymentFilters, c as PaymentResponse, E as UpdateClientRequest, F as ProcessOutput$1, G as UpdateClientIdentifierRequest, Z as UpdateClientIdentifierResponse, D as CreateClientRequest, _ as CreateClientResponse, $ as ListClientsRequest, a0 as ListClientsResponse, v as SavingAccount, a1 as ListAccountsOfClientRequest, z as UpdateAccountRequest, a2 as GraphQLRequest } from './client-CHyhpYj2.mjs';
2
+ import { z } from 'zod';
2
3
 
3
4
  declare const CreatePayment: (params: {
4
5
  payment: CreatePaymentInput;
@@ -6,7 +7,7 @@ declare const CreatePayment: (params: {
6
7
  }) => Command<{
7
8
  payment: CreatePaymentInput;
8
9
  tenantId?: string;
9
- }, Payment>;
10
+ }, ProcessOutput>;
10
11
  declare const GetPayment: (params: {
11
12
  id: number;
12
13
  tenantId?: string;
@@ -91,7 +92,7 @@ declare const UpdateClient: (params: {
91
92
  tenantId?: string;
92
93
  clientId: number;
93
94
  updates: UpdateClientRequest;
94
- }, ProcessOutput>;
95
+ }, ProcessOutput$1>;
95
96
  declare const UpdateClientIdentifier: (params: {
96
97
  tenantId?: string;
97
98
  clientId: number;
@@ -124,7 +125,7 @@ declare const DeleteClient: (params: {
124
125
  }) => Command<{
125
126
  clientId: number;
126
127
  tenantId?: string;
127
- }, ProcessOutput>;
128
+ }, ProcessOutput$1>;
128
129
 
129
130
  declare const GetAccount: (params: {
130
131
  id: number;
@@ -150,7 +151,7 @@ declare const DeleteAccount: (params: {
150
151
  }) => Command<{
151
152
  accountId: number;
152
153
  tenantId?: string;
153
- }, ProcessOutput>;
154
+ }, ProcessOutput$1>;
154
155
  declare const ListAccountsOfClient: (params?: {
155
156
  clientId: number;
156
157
  tenantId?: string;
@@ -173,4 +174,84 @@ declare const GetAccountsOfClient: (clientId: number, params: ListAccountsOfClie
173
174
 
174
175
  declare const GraphQL: (request: GraphQLRequest) => Command<GraphQLRequest, any>;
175
176
 
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 };
177
+ declare const UserDetailSchema: z.ZodObject<{
178
+ username: z.ZodString;
179
+ userId: z.ZodNumber;
180
+ accessToken: z.ZodString;
181
+ authenticated: z.ZodBoolean;
182
+ officeId: z.ZodNumber;
183
+ officeName: z.ZodString;
184
+ roles: z.ZodArray<z.ZodObject<{
185
+ id: z.ZodNumber;
186
+ name: z.ZodString;
187
+ description: z.ZodString;
188
+ disabled: z.ZodBoolean;
189
+ isSelfService: z.ZodBoolean;
190
+ position: z.ZodNumber;
191
+ }, "strip", z.ZodTypeAny, {
192
+ name: string;
193
+ id: number;
194
+ description: string;
195
+ disabled: boolean;
196
+ isSelfService: boolean;
197
+ position: number;
198
+ }, {
199
+ name: string;
200
+ id: number;
201
+ description: string;
202
+ disabled: boolean;
203
+ isSelfService: boolean;
204
+ position: number;
205
+ }>, "many">;
206
+ permissions: z.ZodArray<z.ZodString, "many">;
207
+ shouldRenewPassword: z.ZodBoolean;
208
+ isTwoFactorAuthenticationRequired: z.ZodBoolean;
209
+ isSelfServiceUser: z.ZodBoolean;
210
+ }, "strip", z.ZodTypeAny, {
211
+ officeId: number;
212
+ officeName: string;
213
+ username: string;
214
+ userId: number;
215
+ accessToken: string;
216
+ authenticated: boolean;
217
+ roles: {
218
+ name: string;
219
+ id: number;
220
+ description: string;
221
+ disabled: boolean;
222
+ isSelfService: boolean;
223
+ position: number;
224
+ }[];
225
+ permissions: string[];
226
+ shouldRenewPassword: boolean;
227
+ isTwoFactorAuthenticationRequired: boolean;
228
+ isSelfServiceUser: boolean;
229
+ }, {
230
+ officeId: number;
231
+ officeName: string;
232
+ username: string;
233
+ userId: number;
234
+ accessToken: string;
235
+ authenticated: boolean;
236
+ roles: {
237
+ name: string;
238
+ id: number;
239
+ description: string;
240
+ disabled: boolean;
241
+ isSelfService: boolean;
242
+ position: number;
243
+ }[];
244
+ permissions: string[];
245
+ shouldRenewPassword: boolean;
246
+ isTwoFactorAuthenticationRequired: boolean;
247
+ isSelfServiceUser: boolean;
248
+ }>;
249
+ type UserDetail = z.infer<typeof UserDetailSchema>;
250
+
251
+ declare const GetUserDetail: (params?: {
252
+ tenantId?: string;
253
+ }) => Command<{
254
+ tenantId?: string;
255
+ }, UserDetail>;
256
+
257
+ 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, GetUserDetail as m, DeletePayment as n };
@@ -1,4 +1,5 @@
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, Y as UpdateClientIdentifierResponse, D as CreateClientRequest, Z as CreateClientResponse, _ as ListClientsRequest, $ as ListClientsResponse, v as SavingAccount, a0 as ListAccountsOfClientRequest, z as UpdateAccountRequest, a1 as GraphQLRequest } from './client-BUCNGFJy.js';
1
+ import { b as CreatePaymentInput, a as Command, Y as ProcessOutput, P as Payment, U as UpdatePaymentInput, g as PaymentFilters, c as PaymentResponse, E as UpdateClientRequest, F as ProcessOutput$1, G as UpdateClientIdentifierRequest, Z as UpdateClientIdentifierResponse, D as CreateClientRequest, _ as CreateClientResponse, $ as ListClientsRequest, a0 as ListClientsResponse, v as SavingAccount, a1 as ListAccountsOfClientRequest, z as UpdateAccountRequest, a2 as GraphQLRequest } from './client-CHyhpYj2.js';
2
+ import { z } from 'zod';
2
3
 
3
4
  declare const CreatePayment: (params: {
4
5
  payment: CreatePaymentInput;
@@ -6,7 +7,7 @@ declare const CreatePayment: (params: {
6
7
  }) => Command<{
7
8
  payment: CreatePaymentInput;
8
9
  tenantId?: string;
9
- }, Payment>;
10
+ }, ProcessOutput>;
10
11
  declare const GetPayment: (params: {
11
12
  id: number;
12
13
  tenantId?: string;
@@ -91,7 +92,7 @@ declare const UpdateClient: (params: {
91
92
  tenantId?: string;
92
93
  clientId: number;
93
94
  updates: UpdateClientRequest;
94
- }, ProcessOutput>;
95
+ }, ProcessOutput$1>;
95
96
  declare const UpdateClientIdentifier: (params: {
96
97
  tenantId?: string;
97
98
  clientId: number;
@@ -124,7 +125,7 @@ declare const DeleteClient: (params: {
124
125
  }) => Command<{
125
126
  clientId: number;
126
127
  tenantId?: string;
127
- }, ProcessOutput>;
128
+ }, ProcessOutput$1>;
128
129
 
129
130
  declare const GetAccount: (params: {
130
131
  id: number;
@@ -150,7 +151,7 @@ declare const DeleteAccount: (params: {
150
151
  }) => Command<{
151
152
  accountId: number;
152
153
  tenantId?: string;
153
- }, ProcessOutput>;
154
+ }, ProcessOutput$1>;
154
155
  declare const ListAccountsOfClient: (params?: {
155
156
  clientId: number;
156
157
  tenantId?: string;
@@ -173,4 +174,84 @@ declare const GetAccountsOfClient: (clientId: number, params: ListAccountsOfClie
173
174
 
174
175
  declare const GraphQL: (request: GraphQLRequest) => Command<GraphQLRequest, any>;
175
176
 
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 };
177
+ declare const UserDetailSchema: z.ZodObject<{
178
+ username: z.ZodString;
179
+ userId: z.ZodNumber;
180
+ accessToken: z.ZodString;
181
+ authenticated: z.ZodBoolean;
182
+ officeId: z.ZodNumber;
183
+ officeName: z.ZodString;
184
+ roles: z.ZodArray<z.ZodObject<{
185
+ id: z.ZodNumber;
186
+ name: z.ZodString;
187
+ description: z.ZodString;
188
+ disabled: z.ZodBoolean;
189
+ isSelfService: z.ZodBoolean;
190
+ position: z.ZodNumber;
191
+ }, "strip", z.ZodTypeAny, {
192
+ name: string;
193
+ id: number;
194
+ description: string;
195
+ disabled: boolean;
196
+ isSelfService: boolean;
197
+ position: number;
198
+ }, {
199
+ name: string;
200
+ id: number;
201
+ description: string;
202
+ disabled: boolean;
203
+ isSelfService: boolean;
204
+ position: number;
205
+ }>, "many">;
206
+ permissions: z.ZodArray<z.ZodString, "many">;
207
+ shouldRenewPassword: z.ZodBoolean;
208
+ isTwoFactorAuthenticationRequired: z.ZodBoolean;
209
+ isSelfServiceUser: z.ZodBoolean;
210
+ }, "strip", z.ZodTypeAny, {
211
+ officeId: number;
212
+ officeName: string;
213
+ username: string;
214
+ userId: number;
215
+ accessToken: string;
216
+ authenticated: boolean;
217
+ roles: {
218
+ name: string;
219
+ id: number;
220
+ description: string;
221
+ disabled: boolean;
222
+ isSelfService: boolean;
223
+ position: number;
224
+ }[];
225
+ permissions: string[];
226
+ shouldRenewPassword: boolean;
227
+ isTwoFactorAuthenticationRequired: boolean;
228
+ isSelfServiceUser: boolean;
229
+ }, {
230
+ officeId: number;
231
+ officeName: string;
232
+ username: string;
233
+ userId: number;
234
+ accessToken: string;
235
+ authenticated: boolean;
236
+ roles: {
237
+ name: string;
238
+ id: number;
239
+ description: string;
240
+ disabled: boolean;
241
+ isSelfService: boolean;
242
+ position: number;
243
+ }[];
244
+ permissions: string[];
245
+ shouldRenewPassword: boolean;
246
+ isTwoFactorAuthenticationRequired: boolean;
247
+ isSelfServiceUser: boolean;
248
+ }>;
249
+ type UserDetail = z.infer<typeof UserDetailSchema>;
250
+
251
+ declare const GetUserDetail: (params?: {
252
+ tenantId?: string;
253
+ }) => Command<{
254
+ tenantId?: string;
255
+ }, UserDetail>;
256
+
257
+ 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, GetUserDetail as m, DeletePayment as n };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mbanq/core-sdk-js",
3
- "version": "0.4.1",
3
+ "version": "0.5.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
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; } async function _asyncOptionalChain(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 = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkAVRYYGRQjs = require('./chunk-AVRYYGRQ.js');var w=d=>{let p=[];if(!d.baseUrl)p.push("baseUrl is required");else if(typeof d.baseUrl!="string")p.push("baseUrl must be a string");else try{new URL(d.baseUrl)}catch (e2){p.push("baseUrl must be a valid URL")}return _optionalChain([d, 'access', _2 => _2.axiosConfig, 'optionalAccess', _3 => _3.timeout])!==void 0&&(typeof d.axiosConfig.timeout!="number"||d.axiosConfig.timeout<0)&&p.push("timeout must be a positive number"),p};var Z=d=>{let p=w(d);if(p.length>0)throw _chunkAVRYYGRQjs.a.call(void 0, {message:`Invalid configuration: ${p.join(", ")}`,code:"invalid_config"});let C=async(o,t,n)=>{if(d.middlewares)for(let e of d.middlewares)o==="before"&&e.before?await e.before(t):o==="after"&&e.after?await e.after(t,n):o==="onError"&&e.onError&&await e.onError(t,n)},f={...d},a=async o=>{try{await C("before",o);let t=await o.execute(f);return await C("after",o,t),t}catch(t){throw await C("onError",o,t),t}},x=o=>{let t=o||f.tenantId;return{payment:{create:n=>{let e=_chunkAVRYYGRQjs.r.call(void 0, {payment:n,tenantId:t});return{execute:async()=>a(e)}},get:n=>{let e=_chunkAVRYYGRQjs.s.call(void 0, {id:n,tenantId:t});return{execute:async()=>a(e)}},update:(n,e)=>{let s=_chunkAVRYYGRQjs.t.call(void 0, {id:n,payment:e,tenantId:t});return{execute:async()=>a(s)}},delete:n=>{let e=_chunkAVRYYGRQjs.w.call(void 0, {id:n,tenantId:t});return{execute:async()=>a(e)}},list:()=>{let e=_chunkAVRYYGRQjs.u.call(void 0, {tenantId:t}).list(),s=u=>({where:u.where,limit:i=>{let m=u.limit(i);return s(m)},offset:i=>{let m=u.offset(i);return s(m)},all:()=>{let i=u.all();return s(i)},execute:async()=>{let i=u.execute();return a(i)}});return s(e)}},client:{create:n=>{let e=_chunkAVRYYGRQjs.A.call(void 0, {clientData:n,tenantId:t});return{execute:async()=>a(e)}},get:n=>{let e=_chunkAVRYYGRQjs.x.call(void 0, {clientId:n,tenantId:t});return{execute:async()=>a(e)}},update:(n,e)=>{let s=_chunkAVRYYGRQjs.y.call(void 0, {clientId:n,updates:e,tenantId:t});return{execute:async()=>a(s)}},updateDocumentRecord:(n,e)=>{let s=_chunkAVRYYGRQjs.z.call(void 0, {clientId:n,identifierId:e.id,updates:e,tenantId:t});return{execute:async()=>a(s)}},delete:n=>{let e=_chunkAVRYYGRQjs.D.call(void 0, {clientId:n,tenantId:t});return{execute:async()=>a(e)}},for:n=>{let e=parseInt(n,10),u=_chunkAVRYYGRQjs.P.call(void 0, {clientId:e,tenantId:t}).list(),m=_chunkAVRYYGRQjs.U.call(void 0, {clientId:e,tenantId:t}).list(),H=async()=>{let r=u.execute();returnawait _asyncOptionalChain([(await a(r)), 'optionalAccess', async _4 => _4.savingsAccounts])||[]},y=r=>({where:c=>{let l=r.where?r.where(c):r;return{eq:N=>{let g=l.eq?l.eq(N):l;return{where:Q=>y(g).where(Q),list:()=>y(g)}}}},execute:async()=>{let c=r.execute();return a(c)}});return{accounts:{get:r=>({execute:async()=>{let c=_chunkAVRYYGRQjs.M.call(void 0, {id:r,tenantId:t});return a(c)}}),getFromList:r=>({execute:async()=>(await H()).find(l=>l.id===r)||null}),update:(r,c)=>{let l=_chunkAVRYYGRQjs.N.call(void 0, {clientId:e,accountId:r,updates:c,tenantId:t});return{execute:async()=>a(l)}},delete:r=>{let c=_chunkAVRYYGRQjs.O.call(void 0, {accountId:r,tenantId:t});return{execute:async()=>a(c)}},where:r=>y(u).where(r),list:()=>y(u)},recipients:{create:r=>{let c=_chunkAVRYYGRQjs.S.call(void 0, {clientId:e,recipient:r,tenantId:t});return{execute:async()=>a(c)}},get:r=>({execute:async()=>{let c=_chunkAVRYYGRQjs.R.call(void 0, {clientId:e,id:r,tenantId:t});return a(c)}}),update:(r,c)=>{let l=_chunkAVRYYGRQjs.X.call(void 0, {id:r,input:c,tenantId:t});return{execute:async()=>a(l)}},delete:r=>{let c=_chunkAVRYYGRQjs.T.call(void 0, {clientId:e,recipientId:r,tenantId:t});return{execute:async()=>a(c)}},where:r=>y(m).where(r),list:()=>y(m)}}},list:()=>{let e=_chunkAVRYYGRQjs.B.call(void 0, {tenantId:t}).list(),s=u=>({where:u.where,limit:i=>{let m=u.limit(i);return s(m)},offset:i=>{let m=u.offset(i);return s(m)},all:()=>{let i=u.all();return s(i)},execute:async()=>{let i=u.execute();return a(i)}});return s(e)}}}};return{setConfig:o=>{f=o},updateConfig:o=>{let t={...f,...o,axiosConfig:{...f.axiosConfig,...o.axiosConfig,headers:{..._optionalChain([f, 'access', _5 => _5.axiosConfig, 'optionalAccess', _6 => _6.headers]),..._optionalChain([o, 'access', _7 => _7.axiosConfig, 'optionalAccess', _8 => _8.headers])}}},n=w(t);if(n.length>0)throw _chunkAVRYYGRQjs.a.call(void 0, {message:`Invalid configuration: ${n.join(", ")}`,code:"invalid_config"});f=t},resetConfig:()=>{f=d},request:a,tenant:o=>x(o),...x()}};exports.a = Z;
@@ -1 +0,0 @@
1
- import{A as v,B as L,D as O,M as D,N as E,O as T,P as j,R as G,S as M,T as _,U as $,X as F,a as I,r as b,s as h,t as R,u as q,w as U,x as A,y as B,z as P}from"./chunk-ZRBPB43P.mjs";var w=d=>{let p=[];if(!d.baseUrl)p.push("baseUrl is required");else if(typeof d.baseUrl!="string")p.push("baseUrl must be a string");else try{new URL(d.baseUrl)}catch{p.push("baseUrl must be a valid URL")}return d.axiosConfig?.timeout!==void 0&&(typeof d.axiosConfig.timeout!="number"||d.axiosConfig.timeout<0)&&p.push("timeout must be a positive number"),p};var Z=d=>{let p=w(d);if(p.length>0)throw I({message:`Invalid configuration: ${p.join(", ")}`,code:"invalid_config"});let C=async(o,t,n)=>{if(d.middlewares)for(let e of d.middlewares)o==="before"&&e.before?await e.before(t):o==="after"&&e.after?await e.after(t,n):o==="onError"&&e.onError&&await e.onError(t,n)},f={...d},a=async o=>{try{await C("before",o);let t=await o.execute(f);return await C("after",o,t),t}catch(t){throw await C("onError",o,t),t}},x=o=>{let t=o||f.tenantId;return{payment:{create:n=>{let e=b({payment:n,tenantId:t});return{execute:async()=>a(e)}},get:n=>{let e=h({id:n,tenantId:t});return{execute:async()=>a(e)}},update:(n,e)=>{let s=R({id:n,payment:e,tenantId:t});return{execute:async()=>a(s)}},delete:n=>{let e=U({id:n,tenantId:t});return{execute:async()=>a(e)}},list:()=>{let e=q({tenantId:t}).list(),s=u=>({where:u.where,limit:i=>{let m=u.limit(i);return s(m)},offset:i=>{let m=u.offset(i);return s(m)},all:()=>{let i=u.all();return s(i)},execute:async()=>{let i=u.execute();return a(i)}});return s(e)}},client:{create:n=>{let e=v({clientData:n,tenantId:t});return{execute:async()=>a(e)}},get:n=>{let e=A({clientId:n,tenantId:t});return{execute:async()=>a(e)}},update:(n,e)=>{let s=B({clientId:n,updates:e,tenantId:t});return{execute:async()=>a(s)}},updateDocumentRecord:(n,e)=>{let s=P({clientId:n,identifierId:e.id,updates:e,tenantId:t});return{execute:async()=>a(s)}},delete:n=>{let e=O({clientId:n,tenantId:t});return{execute:async()=>a(e)}},for:n=>{let e=parseInt(n,10),u=j({clientId:e,tenantId:t}).list(),m=$({clientId:e,tenantId:t}).list(),H=async()=>{let r=u.execute();return(await a(r))?.savingsAccounts||[]},y=r=>({where:c=>{let l=r.where?r.where(c):r;return{eq:N=>{let g=l.eq?l.eq(N):l;return{where:Q=>y(g).where(Q),list:()=>y(g)}}}},execute:async()=>{let c=r.execute();return a(c)}});return{accounts:{get:r=>({execute:async()=>{let c=D({id:r,tenantId:t});return a(c)}}),getFromList:r=>({execute:async()=>(await H()).find(l=>l.id===r)||null}),update:(r,c)=>{let l=E({clientId:e,accountId:r,updates:c,tenantId:t});return{execute:async()=>a(l)}},delete:r=>{let c=T({accountId:r,tenantId:t});return{execute:async()=>a(c)}},where:r=>y(u).where(r),list:()=>y(u)},recipients:{create:r=>{let c=M({clientId:e,recipient:r,tenantId:t});return{execute:async()=>a(c)}},get:r=>({execute:async()=>{let c=G({clientId:e,id:r,tenantId:t});return a(c)}}),update:(r,c)=>{let l=F({id:r,input:c,tenantId:t});return{execute:async()=>a(l)}},delete:r=>{let c=_({clientId:e,recipientId:r,tenantId:t});return{execute:async()=>a(c)}},where:r=>y(m).where(r),list:()=>y(m)}}},list:()=>{let e=L({tenantId:t}).list(),s=u=>({where:u.where,limit:i=>{let m=u.limit(i);return s(m)},offset:i=>{let m=u.offset(i);return s(m)},all:()=>{let i=u.all();return s(i)},execute:async()=>{let i=u.execute();return a(i)}});return s(e)}}}};return{setConfig:o=>{f=o},updateConfig:o=>{let t={...f,...o,axiosConfig:{...f.axiosConfig,...o.axiosConfig,headers:{...f.axiosConfig?.headers,...o.axiosConfig?.headers}}},n=w(t);if(n.length>0)throw I({message:`Invalid configuration: ${n.join(", ")}`,code:"invalid_config"});f=t},resetConfig:()=>{f=d},request:a,tenant:o=>x(o),...x()}};export{Z as a};
@@ -1,32 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);var y=({message:e,statusCode:a,code:i,requestId:o,originalError:p})=>({name:"CommandError",message:e,statusCode:a,code:i,requestId:o,originalError:p}),dn= exports.b =e=>typeof e=="object"&&e!==null&&"name"in e&&e.name==="CommandError",it=e=>{if(!e||typeof e!="object")return e;let a={...e};if(a.config&&typeof a.config=="object"){let i=a.config;if(i.httpsAgent&&typeof i.httpsAgent=="object"){let o=i.httpsAgent;delete o.sockets,delete o.freeSockets,delete o._sessionCache}}return a},u= exports.c =e=>{if(_axios2.default.isAxiosError(e)){let a=_optionalChain([e, 'access', _2 => _2.response, 'optionalAccess', _3 => _3.data, 'optionalAccess', _4 => _4.message]),i=_optionalChain([e, 'access', _5 => _5.response, 'optionalAccess', _6 => _6.status])?`Request failed with status code ${e.response.status}`:e.message||"Request failed";throw y({message:a||i,statusCode:_optionalChain([e, 'access', _7 => _7.response, 'optionalAccess', _8 => _8.status]),code:e.code,requestId:_optionalChain([e, 'access', _9 => _9.response, 'optionalAccess', _10 => _10.headers, 'optionalAccess', _11 => _11["x-request-id"]]),originalError:it(e)})}throw e};var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);var _=_zod.z.enum(["originatorName","originatorAccount","originatorBankRoutingCode","recipientName","recipientAccount","recipientBankRoutingCode","reference","traceNumber","externalId","clientId","dateFormat","locale","originatedBy","paymentRail","paymentType","fromValueDate","toValueDate","fromExecuteDate","toExecuteDate","status","fromReturnDate","toReturnDate","isSettlement","orderBy","sortOrder"]),v= exports.f =_zod.z.enum(["DRAFT","AML_SCREENING","AML_REJECTED","EXECUTION_SCHEDULED","EXECUTION_PROCESSING","EXECUTION_SUCCESS","EXECUTION_FAILURE","RETURNED","CANCELLED","COMPLIANCE_FAILURE","DELETED","UNKNOWN"]),R= exports.g =_zod.z.enum(["ACH","SAMEDAYACH","WIRE","SWIFT","INTERNAL","FXPAY","CARD"]),D= exports.h =_zod.z.enum(["CREDIT","DEBIT"]),F= exports.i =_zod.z.enum(["ASC","DESC"]),un=_.options,yn=v.options,gn=R.options,fn=D.options,bn=F.options,G=e=>_.parse(e),M=e=>v.parse(e),K=e=>R.parse(e),V=e=>D.parse(e),W=e=>F.parse(e),Q=_zod.z.string().min(1),H=_zod.z.string().min(1),Y=_zod.z.string().min(1),J=_zod.z.string().min(1),X=_zod.z.string().min(1),Z=_zod.z.string().min(1),ee=_zod.z.string().min(1),te=_zod.z.string().min(1),ne=_zod.z.string().min(1),ae=_zod.z.union([_zod.z.string(),_zod.z.number()]),re=_zod.z.string(),ie=_zod.z.string(),oe=_zod.z.string(),L=_zod.z.string(),k=_zod.z.string(),q=_zod.z.string(),se=_zod.z.boolean(),ce=_zod.z.string(),pe=e=>Q.parse(e),de=e=>H.parse(e),le=e=>Y.parse(e),me=e=>J.parse(e),ue=e=>X.parse(e),ye=e=>Z.parse(e),ge=e=>ee.parse(e),fe=e=>te.parse(e),be=e=>ne.parse(e),he=e=>ae.parse(e),Ce=e=>re.parse(e),Ie=e=>ie.parse(e),Re=e=>oe.parse(e),xe=e=>L.parse(e),Se=e=>k.parse(e),ve=e=>q.parse(e),De=e=>se.parse(e),Ae=e=>ce.parse(e),ot= exports.j ={originatorName:Q.optional(),originatorAccount:H.optional(),originatorBankRoutingCode:Y.optional(),recipientName:J.optional(),recipientAccount:X.optional(),recipientBankRoutingCode:Z.optional(),reference:ee.optional(),traceNumber:te.optional(),externalId:ne.optional(),clientId:ae.optional(),dateFormat:re.optional(),locale:ie.optional(),originatedBy:oe.optional(),paymentRail:R.optional(),paymentType:D.optional(),fromValueDate:L.optional(),toValueDate:L.optional(),fromExecuteDate:k.optional(),toExecuteDate:k.optional(),status:v.optional(),fromReturnDate:q.optional(),toReturnDate:q.optional(),isSettlement:se.optional(),orderBy:ce.optional(),sortOrder:F.optional(),limit:_zod.z.number().min(0).optional().describe("Maximum number of records to return. Defaults to 20 if not specified. Set to 0 to return all records."),offset:_zod.z.number().min(0).optional()},hn= exports.k =_zod.z.object(ot).partial();var st={id:_zod.z.number(),clientId:_zod.z.number(),amount:_zod.z.number().positive(),correlationId:_zod.z.string(),paymentType:D,paymentRail:R,recipient:_zod.z.object({cardId:_zod.z.string().optional(),recipientType:_zod.z.string(),address:_zod.z.object({line1:_zod.z.string().optional(),line2:_zod.z.string().optional(),stateCode:_zod.z.string().optional(),countryCode:_zod.z.string(),postalCode:_zod.z.string().optional()}),name:_zod.z.string()}),originator:_zod.z.object({accountId:_zod.z.string().optional(),recipientType:_zod.z.string(),address:_zod.z.object({line1:_zod.z.string().optional(),line2:_zod.z.string().optional(),stateCode:_zod.z.string().optional(),countryCode:_zod.z.string(),postalCode:_zod.z.string().optional()}),name:_zod.z.string()}),executedAt:_zod.z.string(),createdAt:_zod.z.string(),externalId:_zod.z.string(),status:v,paymentRailMetaData:_zod.z.record(_zod.z.string(),_zod.z.any()).optional(),currencyData:_zod.z.object({code:_zod.z.string(),name:_zod.z.string(),decimalPlaces:_zod.z.number(),displaySymbol:_zod.z.string(),nameCode:_zod.z.string(),currencyCodeInDigit:_zod.z.number(),isBaseCurrency:_zod.z.boolean()}),currency:_zod.z.string().min(3).max(3)},Pe=_zod.z.object(st).catchall(_zod.z.any()),Ee=_zod.z.object({streetAddress:_zod.z.string().optional(),city:_zod.z.string().optional(),state:_zod.z.string().optional(),country:_zod.z.string().optional(),postalCode:_zod.z.string().optional()}).optional(),ct=_zod.z.object({name:_zod.z.string().optional(),identifier:_zod.z.string().optional(),address:Ee}).optional(),N=_zod.z.object({name:_zod.z.string(),identifier:_zod.z.string(),accountType:_zod.z.enum(["CHECKING","SAVINGS"]).optional(),address:Ee,agent:ct}),pt= exports.m ={amount:_zod.z.number().positive(),currency:_zod.z.string().min(3).max(3),paymentRail:R,paymentType:D,debtor:N,creditor:N,clientId:_zod.z.string().optional(),correspondent:N.optional(),exchangeRate:_zod.z.number().positive().optional(),externalId:_zod.z.string().optional(),reference:_zod.z.union([_zod.z.string(),_zod.z.array(_zod.z.string())]).optional(),paymentRailMetaData:_zod.z.record(_zod.z.string(),_zod.z.any()).optional(),chargeBearer:_zod.z.enum(["OUR","BEN","SHA"]).optional(),purposeCode:_zod.z.string().optional(),valueDate:_zod.z.string().optional(),executionDate:_zod.z.string().optional()},dt= exports.n =_zod.z.object(pt).catchall(_zod.z.any()).refine(e=>(e.paymentRail==="WIRE"||e.paymentRail==="SWIFT")&&e.creditor?e.creditor.address&&e.creditor.address.state&&e.creditor.address.country:!0,{message:"For WIRE transfers, recipient address with state and country is mandatory"}),lt= exports.o ={amount:_zod.z.number().positive().optional(),correspondent:_zod.z.object({name:_zod.z.string().optional(),identifier:_zod.z.string().optional(),accountType:_zod.z.string().optional()}).optional(),creditor:_zod.z.object({name:_zod.z.string().optional(),identifier:_zod.z.string().optional(),accountType:_zod.z.string().optional(),agent:_zod.z.object({name:_zod.z.string().optional(),identifier:_zod.z.string().optional()}).optional()}).optional(),debtor:_zod.z.object({name:_zod.z.string().optional(),identifier:_zod.z.string().optional(),accountType:_zod.z.string().optional(),agent:_zod.z.object({name:_zod.z.string().optional(),identifier:_zod.z.string().optional()}).optional()}).optional(),exchangeRate:_zod.z.number().positive().optional(),externalId:_zod.z.string().optional(),errorCode:_zod.z.string().optional(),errorMessage:_zod.z.string().optional(),reference:_zod.z.union([_zod.z.string(),_zod.z.array(_zod.z.string())]).optional(),paymentRailMetaData:_zod.z.record(_zod.z.string(),_zod.z.any()).optional(),status:v.optional()},mt= exports.p =_zod.z.object(lt).catchall(_zod.z.any()),Cn= exports.q =_zod.z.object({totalFilteredRecords:_zod.z.number(),pageItems:_zod.z.array(Pe)}),E=e=>Pe.parse(e),Oe=e=>dt.parse(e),we=e=>mt.parse(e);var In=_zod.z.object({id:_zod.z.string(),clientId:_zod.z.number(),resourceId:_zod.z.number(),resourceIdentifier:_zod.z.string()});var _uuid = require('uuid');var _https = require('https'); var ke = _interopRequireWildcard(_https);var _jsonwebtoken = require('jsonwebtoken'); var _jsonwebtoken2 = _interopRequireDefault(_jsonwebtoken);var Te=(e,a)=>{if(!e)throw y({message:"Missing JWT secret",code:"missing_jwt_secret"});return _jsonwebtoken2.default.sign({signee:a},e,{algorithm:"HS512",expiresIn:"1d"})||""},Ne=async(e,a,i,o)=>{let p={method:"POST",url:`${a}/oauth/token`,headers:{"Content-Type":"application/x-www-form-urlencoded",tenantId:i},data:o},{data:{access_token:d}}=await _axios2.default.request(p);return e=d,e};var Le={token:""},bt=e=>e&&(e.startsWith("Bearer ")?e:`Bearer ${e}`),m= exports.d =async e=>{let i=_axios2.default.create({timeout:_optionalChain([e, 'access', _12 => _12.axiosConfig, 'optionalAccess', _13 => _13.timeout])||29e3,baseURL:e.baseUrl,headers:{"Content-Type":"application/json; charset=utf-8","JWT-Token":_optionalChain([e, 'optionalAccess', _14 => _14.secret])?`${Te(_optionalChain([e, 'optionalAccess', _15 => _15.secret]),_optionalChain([e, 'optionalAccess', _16 => _16.signee])||"")}`:void 0,Authorization:e.bearerToken!==void 0?bt(e.bearerToken):e.credential?`Bearer ${Le.token||await Ne(Le.token,e.baseUrl,e.tenantId,e.credential)}`:void 0,"trace-id":e.traceId||`RequestUUID=${_uuid.v4.call(void 0, )}`,tenantId:e.tenantId},httpsAgent:new ke.Agent({rejectUnauthorized:!0,keepAlive:_optionalChain([e, 'access', _17 => _17.axiosConfig, 'optionalAccess', _18 => _18.keepAlive])})});return e.logger&&e.logger(i),i};var ht=e=>{try{G(e)}catch(a){throw a instanceof _zod.ZodError?y({message:`Invalid filter key: '${e}'. ${a.message}`,code:"invalid_filter_key"}):a}},Ct=(e,a)=>{try{switch(e){case"status":M(a);break;case"paymentRail":K(a);break;case"paymentType":V(a);break;case"sortOrder":W(a);break;case"originatorName":pe(a);break;case"originatorAccount":de(a);break;case"originatorBankRoutingCode":le(a);break;case"recipientName":me(a);break;case"recipientAccount":ue(a);break;case"recipientBankRoutingCode":ye(a);break;case"reference":ge(a);break;case"traceNumber":fe(a);break;case"externalId":be(a);break;case"clientId":he(a);break;case"dateFormat":Ce(a);break;case"locale":Ie(a);break;case"originatedBy":Re(a);break;case"fromValueDate":case"toValueDate":xe(a);break;case"fromExecuteDate":case"toExecuteDate":Se(a);break;case"fromReturnDate":case"toReturnDate":ve(a);break;case"isSettlement":De(a);break;case"orderBy":Ae(a);break;default:break}}catch(i){throw i instanceof _zod.ZodError?y({message:`Invalid value for '${e}': '${a}'. ${i.message}`,code:`invalid_${e}_value`}):i}},qn= exports.r =e=>({input:e,metadata:{commandName:"CreatePayment",path:"/v1/payments",method:"POST"},execute:async a=>{try{Oe(e.payment)}catch(o){throw o instanceof _zod.ZodError?y({message:`Invalid payment data: ${o.message}`,code:"invalid_payment_input"}):o}e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{let o=await i.post("/v1/payments",e.payment);return E(o.data)}catch(o){u(o)}}}),Fn= exports.s =e=>({input:e,metadata:{commandName:"GetPayment",path:`/v1/payments/${e.id}`,method:"GET"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{let o=await i.get(`/v1/payments/${e.id}`);return E(o.data)}catch(o){u(o)}}}),Bn= exports.t =e=>({input:e,metadata:{commandName:"UpdatePayment",path:`/v1/payments/${e.id}`,method:"PUT"},execute:async a=>{try{we(e.payment)}catch(o){throw o instanceof _zod.ZodError?y({message:`Invalid payment update data: ${o.message}`,code:"invalid_payment_update_input"}):o}e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{let o=await i.put(`/v1/payments/${e.id}`,e.payment);return E(o.data)}catch(o){u(o)}}}),A=(e,a,i,o)=>{if(a!==void 0&&a!==0&&a<=0)throw y({message:`Invalid limit: ${a}. Limit must be positive or 0 for fetching all records.`,code:"invalid_limit"});if(i!==void 0&&i<0)throw y({message:`Invalid offset: ${i}. Offset must be non-negative.`,code:"invalid_offset"});return{where:c=>(ht(c),{eq:l=>(Ct(c,l),A({...e,[c]:l},a,i,o))}),limit:c=>A(e,c,i,o),offset:c=>A(e,a,c,o),all:()=>A(e,0,i,o),execute:()=>{let c={locale:"en",originatedBy:"us",orderBy:"id",sortOrder:"DESC"},l={...c,...e,limit:a||200,offset:i||0};return{input:{filters:e,limit:a,offset:i,tenantId:o},metadata:{commandName:"ListPayments",path:"/v1/payments",method:"GET"},execute:async g=>{o&&(g.tenantId=o);let f=await m(g);try{if(a===0){let h=[],C=i||0,I=0;do{let x={...c,...e,limit:200,offset:C},S=await f.get("/v1/payments",{params:x}),{totalFilteredRecords:T,pageItems:at}=S.data;h.push(...at),I=T,C+=200}while(C<I);return{totalFilteredRecords:I,pageItems:h}}else return(await f.get("/v1/payments",{params:l})).data}catch(h){u(h)}}}}}},Un= exports.u =e=>({list:()=>A({},void 0,void 0,_optionalChain([e, 'optionalAccess', _19 => _19.tenantId]))}),jn= exports.v =(e,a)=>({input:{params:e,configuration:a},metadata:{commandName:"GetPayments",path:"/v1/payments",method:"GET"},execute:async i=>{_optionalChain([a, 'optionalAccess', _20 => _20.tenantId])&&(i.tenantId=a.tenantId);let o=await m(i),p=[],d=e.limit||20,c=e.offset||0,l=0,h={...{locale:"en",originatedBy:"us",orderBy:"id",sortOrder:"DESC"},...(b=>{let I=["fromValueDate","toValueDate","fromExecuteDate","toExecuteDate","fromReturnDate","toReturnDate"].some(S=>b[S]!==void 0),x={...b};return I&&x.dateFormat===void 0&&(x.dateFormat="yyyy-MM-dd"),x})(e),limit:d,offset:c};try{if(e.limit===0){do{let b=await o.get("/v1/payments",{params:h}),{totalFilteredRecords:C,pageItems:I}=b.data;p.push(...I),l=C,c+=d}while(c<l);return{totalFilteredRecords:l,pageItems:p}}else return(await o.get("/v1/payments",{params:h})).data}catch(b){u(b)}}}),zn= exports.w =e=>({input:e,metadata:{commandName:"DeletePayment",path:`/v1/payments/${e.id}`,method:"DELETE"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{await i.delete(`/v1/payments/${e.id}`)}catch(o){u(o)}}});var qe=_zod2.default.object({id:_zod2.default.number(),code:_zod2.default.string(),value:_zod2.default.string()}),Fe=_zod2.default.object({id:_zod2.default.number(),code:_zod2.default.string(),value:_zod2.default.string()}),Be=_zod2.default.object({active:_zod2.default.boolean(),mandatory:_zod2.default.boolean(),systemDefined:_zod2.default.boolean()}),Ue=_zod2.default.object({id:_zod2.default.number()}),je=_zod2.default.object({id:_zod2.default.number(),name:_zod2.default.string().optional()}),ze=_zod2.default.object({active:_zod2.default.boolean()}),$e=_zod2.default.object({submittedOnDate:_zod2.default.array(_zod2.default.number()),submittedByUsername:_zod2.default.string().optional(),submittedByFirstname:_zod2.default.string().optional(),submittedByLastname:_zod2.default.string().optional(),activatedOnDate:_zod2.default.array(_zod2.default.number()).optional(),activatedByUsername:_zod2.default.string().optional(),activatedByFirstname:_zod2.default.string().optional(),activatedByLastname:_zod2.default.string().optional()}),It=_zod2.default.object({}).catchall(_zod2.default.any()),Rt=_zod2.default.object({}).catchall(_zod2.default.any()),xt=_zod2.default.object({}).catchall(_zod2.default.any()),_e=_zod2.default.object({constitution:It,mainBusinessLine:Rt,countryOfIncorporation:xt}).catchall(_zod2.default.any()),Ge=_zod2.default.object({isExternalCardDebitDisable:_zod2.default.boolean(),isExternalCardCreditDisable:_zod2.default.boolean(),isAchDebitOutgoingDisable:_zod2.default.boolean(),isAchCreditOutgoingDisable:_zod2.default.boolean(),isAchDebitIncomingDisable:_zod2.default.boolean(),isAchCreditIncomingDisable:_zod2.default.boolean(),isInternalCreditDisable:_zod2.default.boolean(),isInternalDebitDisable:_zod2.default.boolean(),isWireCreditOutgoingDisable:_zod2.default.boolean(),isWireCreditIncomingDisable:_zod2.default.boolean(),isSwiftCreditOutgoingDisable:_zod2.default.boolean(),isSwiftCreditIncomingDisable:_zod2.default.boolean(),isFxpayCreditOutgoingDisable:_zod2.default.boolean(),isAllocateToSubAccountDisable:_zod2.default.boolean(),isInternalCreditOwnDisable:_zod2.default.boolean(),type:_zod2.default.string(),resourceId:_zod2.default.number(),id:_zod2.default.number()}).catchall(_zod2.default.any()),Me=_zod2.default.object({}).catchall(_zod2.default.any()),Ke=_zod2.default.object({id:_zod2.default.number(),accountNo:_zod2.default.string(),status:Fe,subStatus:Be,active:_zod2.default.boolean(),activationDate:_zod2.default.array(_zod2.default.number()).optional(),firstname:_zod2.default.string(),lastname:_zod2.default.string(),displayName:_zod2.default.string(),mobileNo:_zod2.default.string(),emailAddress:_zod2.default.string(),dateOfBirth:_zod2.default.array(_zod2.default.number()),gender:Ue,clientTypes:_zod2.default.array(_zod2.default.any()),clientClassification:je,occupation:ze,isStaff:_zod2.default.boolean(),skipAvs:_zod2.default.boolean(),officeId:_zod2.default.number(),officeName:_zod2.default.string(),imageId:_zod2.default.string().optional(),imagePresent:_zod2.default.boolean().optional(),timeline:$e,legalForm:qe,clientVerificationStatus:_zod2.default.string(),updatedAt:_zod2.default.string(),isBlockExternalCardsAddition:_zod2.default.boolean(),clientNonPersonDetails:_e,clientTransferOptionData:Ge,authorizations:_zod2.default.array(_zod2.default.number()).optional(),mobileCountryCode:_zod2.default.string(),clientKycStatus:Me,ofLoanCycle:_zod2.default.number(),ofLoanActive:_zod2.default.number(),activeDepositAccount:_zod2.default.number(),onBoardingStatus:_zod2.default.string().optional()}).catchall(_zod2.default.any()),St=_zod2.default.object({riskScore:_zod2.default.number(),rating:_zod2.default.string()}).catchall(_zod2.default.any()),vt=_zod2.default.object({street:_zod2.default.string(),city:_zod2.default.string(),state:_zod2.default.string(),zipCode:_zod2.default.string()}).catchall(_zod2.default.any()),Dt=_zod2.default.object({type:_zod2.default.string(),value:_zod2.default.string()}).catchall(_zod2.default.any()),At={firstname:_zod2.default.string(),middlename:_zod2.default.string().optional(),lastname:_zod2.default.string(),fullname:_zod2.default.string().optional(),dob:_zod2.default.string(),genderId:_zod2.default.number(),locale:_zod2.default.string(),officeId:_zod2.default.number(),mobileCountryCode:_zod2.default.string(),mobileNo:_zod2.default.string(),emailAddress:_zod2.default.string().email(),legalFormId:_zod2.default.number(),externalId:_zod2.default.string().optional(),isOptedForMLALStatus:_zod2.default.boolean().optional(),currentMLALStatus:_zod2.default.string().optional(),isStaff:_zod2.default.boolean().optional(),staffId:_zod2.default.number().optional(),clientClassificationId:_zod2.default.number().optional(),savingsProductId:_zod2.default.number().optional(),active:_zod2.default.boolean().optional(),dateFormat:_zod2.default.string(),activationDate:_zod2.default.string().optional(),submittedOnDate:_zod2.default.string(),dateOfBirth:_zod2.default.string()},Mn=_zod2.default.object(At).catchall(_zod2.default.any()),Pt={clientId:_zod2.default.number(),status:_zod2.default.string()},Kn=_zod2.default.object(Pt).catchall(_zod2.default.any()),Et={firstname:_zod2.default.string().optional(),middlename:_zod2.default.string().optional(),fullname:_zod2.default.string().optional(),genderId:_zod2.default.number().optional(),lastname:_zod2.default.string().optional(),occupationId:_zod2.default.number().optional(),mobileCountryCode:_zod2.default.string().optional(),mobileNo:_zod2.default.string().optional(),emailAddress:_zod2.default.string().email().optional(),externalId:_zod2.default.string().optional(),clientClassificationId:_zod2.default.number().optional(),dateOfBirth:_zod2.default.string().optional(),dateFormat:_zod2.default.string().optional()},Vn=_zod2.default.object(Et).catchall(_zod2.default.any()),Ot={documentTypeId:_zod2.default.string(),documentKey:_zod2.default.string(),status:_zod2.default.string(),description:_zod2.default.string().optional(),issuedBy:_zod2.default.string().optional(),locale:_zod2.default.string().optional(),dateFormat:_zod2.default.string().optional(),expiryDate:_zod2.default.string().optional(),nationality:_zod2.default.number().optional(),issuedDate:_zod2.default.string().optional()},Wn=_zod2.default.object(Ot).catchall(_zod2.default.any()),wt={id:_zod2.default.number(),officeId:_zod2.default.number(),clientId:_zod2.default.number(),resourceId:_zod2.default.number(),changes:_zod2.default.record(_zod2.default.string(),_zod2.default.any()),isScheduledTransfer:_zod2.default.boolean(),isSkipNotification:_zod2.default.boolean()},Qn=_zod2.default.object(wt).catchall(_zod2.default.any()),Tt={developerMessage:_zod2.default.string(),defaultUserMessage:_zod2.default.string(),userMessageGlobalisationCode:_zod2.default.string(),parameterName:_zod2.default.string().optional(),value:_zod2.default.any().nullable(),args:_zod2.default.array(_zod2.default.object({value:_zod2.default.any()})).optional()},Nt=_zod2.default.object(Tt),Lt={developerMessage:_zod2.default.string(),httpStatusCode:_zod2.default.string(),defaultUserMessage:_zod2.default.string(),userMessageGlobalisationCode:_zod2.default.string(),errors:_zod2.default.array(Nt).optional()},Hn=_zod2.default.object(Lt).catchall(_zod2.default.any()),kt={tenantId:_zod2.default.string().optional(),offset:_zod2.default.number().optional(),limit:_zod2.default.number().optional(),orderBy:_zod2.default.string().optional(),sortOrder:_zod2.default.string().optional(),officeId:_zod2.default.number().optional(),displayName:_zod2.default.string().optional(),firstname:_zod2.default.string().optional(),lastname:_zod2.default.string().optional(),externalId:_zod2.default.string().optional(),orphansOnly:_zod2.default.boolean().optional(),clientStatus:_zod2.default.string().optional(),mobileNo:_zod2.default.string().optional(),createdStartDate:_zod2.default.string().optional(),creationEndDate:_zod2.default.string().optional(),activatedStartDate:_zod2.default.string().optional(),activatedEndDate:_zod2.default.string().optional(),closedStartDate:_zod2.default.string().optional(),closedEndDate:_zod2.default.string().optional()},Yn=_zod2.default.object(kt),Jn={id:_zod2.default.number(),accountNo:_zod2.default.string(),status:Fe,subStatus:Be,active:_zod2.default.boolean(),activationDate:_zod2.default.array(_zod2.default.number()).optional(),firstname:_zod2.default.string(),lastname:_zod2.default.string(),displayName:_zod2.default.string(),mobileNo:_zod2.default.string(),emailAddress:_zod2.default.string(),dateOfBirth:_zod2.default.array(_zod2.default.number()),gender:Ue,clientTypes:_zod2.default.array(_zod2.default.any()),clientClassification:je,occupation:ze,isStaff:_zod2.default.boolean(),skipAvs:_zod2.default.boolean(),officeId:_zod2.default.number(),officeName:_zod2.default.string(),imageId:_zod2.default.string().optional(),imagePresent:_zod2.default.boolean().optional(),timeline:$e,legalForm:qe,clientVerificationStatus:_zod2.default.string(),updatedAt:_zod2.default.string(),isBlockExternalCardsAddition:_zod2.default.boolean(),clientNonPersonDetails:_e,clientTransferOptionData:Ge,authorizations:_zod2.default.array(_zod2.default.number()).optional(),mobileCountryCode:_zod2.default.string(),clientKycStatus:Me,ofLoanCycle:_zod2.default.number(),ofLoanActive:_zod2.default.number(),activeDepositAccount:_zod2.default.number(),onBoardingStatus:_zod2.default.string().optional()},qt={totalFilteredRecords:_zod2.default.number(),pageItems:_zod2.default.array(Ke)},Xn=_zod2.default.object(qt).catchall(_zod2.default.any()),Ft={clientData:Ke.optional(),riskRatingData:St.optional(),clientAddressData:vt.optional(),clientIdentifierData:Dt.optional()},Zn=_zod2.default.object(Ft);var Bt=_zod2.default.enum(["offset","limit","orderBy","sortOrder","officeId","displayName","firstname","lastname","externalId","orphansOnly","clientStatus","mobileNo","createdStartDate","creationEndDate","activatedStartDate","activatedEndDate","closedStartDate","closedEndDate"]),Ut=_zod2.default.enum(["displayName","accountNo","officeId","officeName"]),jt=_zod2.default.enum(["ASC","DESC"]),zt=_zod2.default.enum(["ACTIVE","PENDING","INACTIVE"]),B=e=>Bt.parse(e),$t=e=>Ut.parse(e),_t=e=>jt.parse(e),Gt=e=>zt.parse(e),Ve=e=>{try{for(let[a,i]of Object.entries(e))if(B(a),i!=null)switch(a){case"orderBy":$t(i);break;case"sortOrder":_t(i);break;case"clientStatus":Gt(i);break;case"offset":case"limit":case"officeId":_zod2.default.number().min(0).parse(i);break;case"orphansOnly":_zod2.default.boolean().parse(i);break;case"displayName":case"firstname":case"lastname":case"externalId":case"mobileNo":case"createdStartDate":case"creationEndDate":case"activatedStartDate":case"activatedEndDate":case"closedStartDate":case"closedEndDate":_zod2.default.string().min(1).parse(i);break}}catch(a){throw a instanceof _zod2.default.ZodError?y({message:`Validation error: ${a.errors.map(i=>i.message).join(", ")}`,code:"validation_error"}):a}};var ma=e=>({input:e,metadata:{commandName:"GetClient",path:`/v1/clients/${e.clientId}`,method:"GET"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{let o={},p=new URLSearchParams;e.staffInSelectedOfficeOnly&&p.append("staffInSelectedOfficeOnly","true"),e.checkIdentitiesExpiration&&p.append("checkIdentitiesExpiration","true"),e.clientAccountAssociate&&p.append("clientAccountAssociate","true");let d=p.toString(),c=`/v1/clients/${e.clientId}${d?`?${d}`:""}`,l=await i.get(c);if(o.clientData=l,e.riskRating){let g=await i.get(`/v1/clients/${e.clientId}/riskrating`);o.riskRatingData=g}if(e.clientAddress){let g=await i.get(`/v1/client/${e.clientId}/addresses`);o.clientAddressData=g}if(e.clientIdentifier){let g=await i.get(`/v1/clients/${e.clientId}/identifiers?unmaskValue=true`);o.clientIdentifierData=g}return o}catch(o){u(o)}}}),ua= exports.y =e=>({input:e,metadata:{commandName:"UpdateClient",path:`/v1/clients/${e.clientId}`,method:"PUT"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{return(await i.put(`/v1/clients/${e.clientId}`,{...e.updates})).data}catch(o){u(o)}}}),ya= exports.z =e=>({input:e,metadata:{commandName:"UpdateClientIdentifier",path:`/v1/clients/${e.clientId}/identifiers/${e.identifierId}`,method:"PUT"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{return(await i.put(`/v1/clients/${e.clientId}/identifiers/${e.identifierId}`,{...e.updates})).data}catch(o){u(o)}}}),ga= exports.A =e=>({input:e,metadata:{commandName:"CreateClient",path:"/v1/clients",method:"POST"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{return(await i.post("/v1/clients",e.clientData)).data}catch(o){u(o)}}}),P=(e,a,i,o)=>{if(a!==void 0&&a!==0&&a<=0)throw y({message:`Invalid limit: ${a}. Limit must be positive or 0 for fetching all records.`,code:"invalid_limit"});if(i!==void 0&&i<0)throw y({message:`Invalid offset: ${i}. Offset must be non-negative.`,code:"invalid_offset"});return{where:c=>(B(c),{eq:l=>(Ve({[c]:l}),P({...e,[c]:l},a,i,o))}),limit:c=>P(e,c,i,o),offset:c=>P(e,a,c,o),all:()=>P(e,0,i,o),execute:()=>{let c={...e,limit:a||200,offset:i||0};return{input:{filters:e,limit:a,offset:i,tenantId:o},metadata:{commandName:"ListClients",path:"/v1/clients",method:"GET"},execute:async l=>{o&&(l.tenantId=o);let g=await m(l);try{if(a===0){let f=[],b=i||0,C=0;do{let I={...e,limit:200,offset:b},x=await g.get("/v1/clients",{params:I}),{totalFilteredRecords:S,pageItems:T}=x.data;f.push(...T),C=S,b+=200}while(b<C);return{totalFilteredRecords:C,pageItems:f}}else return(await g.get("/v1/clients",{params:c})).data}catch(f){u(f)}}}}}},fa= exports.B =e=>({list:()=>P({},void 0,void 0,_optionalChain([e, 'optionalAccess', _21 => _21.tenantId]))}),ba= exports.C =(e,a)=>({input:{params:e,configuration:a},metadata:{commandName:"GetClients",path:"/v1/clients",method:"GET"},execute:async i=>{a.tenantId&&(i.tenantId=a.tenantId);let o=await m(i),p=[],d=e.limit||200,c=e.offset||0,l=0,g={...e,limit:d,offset:c};try{if(e.limit===0){do{let f=await o.get("/v1/clients",{params:g}),{totalFilteredRecords:h,pageItems:b}=f.data;p.push(...b),l=h,c+=d}while(c<l);return{totalFilteredRecords:l,pageItems:p}}else return(await o.get("/v1/clients",{params:g})).data}catch(f){u(f)}}}),ha= exports.D =e=>({input:e,metadata:{commandName:"DeleteClient",path:`/v1/clients/${e.clientId}`,method:"DELETE"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{return(await i.delete(`/v1/clients/${e.clientId}`)).data}catch(o){u(o)}}});var We=_zod.z.object({id:_zod.z.number(),code:_zod.z.string(),value:_zod.z.string(),submittedAndPendingApproval:_zod.z.boolean(),approved:_zod.z.boolean(),rejected:_zod.z.boolean(),withdrawnByApplicant:_zod.z.boolean(),active:_zod.z.boolean(),closed:_zod.z.boolean(),prematureClosed:_zod.z.boolean(),transferInProgress:_zod.z.boolean(),transferOnHold:_zod.z.boolean(),matured:_zod.z.boolean()}),U=_zod.z.object({code:_zod.z.string(),name:_zod.z.string(),decimalPlaces:_zod.z.number(),inMultiplesOf:_zod.z.number(),displaySymbol:_zod.z.string(),nameCode:_zod.z.string(),displayLabel:_zod.z.string(),currencyCodeInDigit:_zod.z.number().optional(),isBaseCurrency:_zod.z.boolean().optional()}),Mt=_zod.z.object({id:_zod.z.number(),code:_zod.z.string(),value:_zod.z.string()}),Qe=_zod.z.object({submittedOnDate:_zod.z.array(_zod.z.number()),submittedByUsername:_zod.z.string(),submittedByFirstname:_zod.z.string(),submittedByLastname:_zod.z.string(),approvedOnDate:_zod.z.array(_zod.z.number()).optional(),approvedByUsername:_zod.z.string().optional(),approvedByFirstname:_zod.z.string().optional(),approvedByLastname:_zod.z.string().optional(),activatedOnDate:_zod.z.array(_zod.z.number()).optional(),activatedByUsername:_zod.z.string().optional(),activatedByFirstname:_zod.z.string().optional(),activatedByLastname:_zod.z.string().optional()}),He=_zod.z.object({id:_zod.z.number(),code:_zod.z.string(),value:_zod.z.string(),none:_zod.z.boolean(),inactive:_zod.z.boolean(),dormant:_zod.z.boolean(),escheat:_zod.z.boolean(),block:_zod.z.boolean(),blockCredit:_zod.z.boolean(),blockDebit:_zod.z.boolean()}),Ye=_zod.z.object({id:_zod.z.number(),code:_zod.z.string(),value:_zod.z.string()}),Kt=_zod.z.object({id:_zod.z.number(),accountNo:_zod.z.string(),productId:_zod.z.number(),productName:_zod.z.string(),shortProductName:_zod.z.string(),status:We,currency:U,accountBalance:_zod.z.number(),accountType:Mt,timeline:Qe,subStatus:He,lastActiveTransactionDate:_zod.z.array(_zod.z.number()).optional(),depositType:Ye,availableBalance:_zod.z.number(),allowPrepaidCard:_zod.z.boolean(),primaryAccount:_zod.z.record(_zod.z.any())}),Vt= exports.E ={id:_zod.z.number(),accountNo:_zod.z.string(),depositType:Ye,clientId:_zod.z.number(),clientName:_zod.z.string(),savingsProductId:_zod.z.number(),savingsProductName:_zod.z.string(),fieldOfficerId:_zod.z.number(),status:We,subStatus:He,timeline:Qe,currency:U,nominalAnnualInterestRate:_zod.z.number(),interestCompoundingPeriodType:_zod.z.object({id:_zod.z.number(),code:_zod.z.string(),value:_zod.z.string()}),interestPostingPeriodType:_zod.z.object({id:_zod.z.number(),code:_zod.z.string(),value:_zod.z.string()}),interestCalculationType:_zod.z.object({id:_zod.z.number(),code:_zod.z.string(),value:_zod.z.string()}),interestCalculationDaysInYearType:_zod.z.object({id:_zod.z.number(),code:_zod.z.string(),value:_zod.z.string()}),lockinPeriodFrequency:_zod.z.number(),lockinPeriodFrequencyType:_zod.z.object({id:_zod.z.number(),code:_zod.z.string(),value:_zod.z.string()}),withdrawalFeeForTransfers:_zod.z.boolean(),allowOverdraft:_zod.z.boolean(),enforceMinRequiredBalance:_zod.z.boolean(),onHoldFunds:_zod.z.number(),withHoldTax:_zod.z.boolean(),lastActiveTransactionDate:_zod.z.array(_zod.z.number()),isDormancyTrackingActive:_zod.z.boolean(),savingsAmountOnHold:_zod.z.number(),summary:_zod.z.object({currency:U,totalDeposits:_zod.z.number(),totalInterestEarned:_zod.z.number(),totalInterestPosted:_zod.z.number(),accountBalance:_zod.z.number(),totalOverdraftInterestDerived:_zod.z.number(),interestNotPosted:_zod.z.number(),lastInterestCalculationDate:_zod.z.array(_zod.z.number()),availableBalance:_zod.z.number()}),isLinkedToFloatingInterestRates:_zod.z.boolean(),interestRateDifferential:_zod.z.number(),overdraftInterestRateDifferential:_zod.z.number(),floatingRateId:_zod.z.number(),isBaseLendingRate:_zod.z.boolean(),isFloatingInterestRateCalculationAllowed:_zod.z.boolean(),bankDetails:_zod.z.object({routingNumber:_zod.z.string(),name:_zod.z.string(),swiftCode:_zod.z.string(),address:_zod.z.string(),city:_zod.z.string(),postcode:_zod.z.string()}),skipCollectTransferCharge:_zod.z.boolean(),cardRestricted:_zod.z.boolean(),overdraftLimit:_zod.z.number(),minRequiredBalance:_zod.z.number(),minBalanceForInterestCalculation:_zod.z.number(),minOverdraftForInterestCalculation:_zod.z.number(),overdraftMinimumDue:_zod.z.number(),currentFloatingInterestPeriod:_zod.z.object({fromDate:_zod.z.array(_zod.z.number()),interestRate:_zod.z.number(),isDifferentialToBLR:_zod.z.boolean()}),floatingRateName:_zod.z.string(),floatingRateDifferential:_zod.z.number(),parentAccount:_zod.z.object({withdrawalFeeForTransfers:_zod.z.boolean(),allowOverdraft:_zod.z.boolean(),enforceMinRequiredBalance:_zod.z.boolean(),withHoldTax:_zod.z.boolean(),isDormancyTrackingActive:_zod.z.boolean(),isLinkedToFloatingInterestRates:_zod.z.boolean(),isBaseLendingRate:_zod.z.boolean(),skipCollectTransferCharge:_zod.z.boolean(),cardRestricted:_zod.z.boolean(),allowPrepaidCard:_zod.z.boolean(),prepaidAccount:_zod.z.boolean()}),allowPrepaidCard:_zod.z.boolean(),prepaidAccount:_zod.z.boolean(),prepaidLimitAmount:_zod.z.number()},xa= exports.F =_zod.z.object(Vt),Wt= exports.G ={savingsAccounts:_zod.z.array(Kt)},Sa= exports.H =_zod.z.object(Wt),Qt=_zod.z.enum(["showReservedAccount"]),Ht= exports.I ={tenantId:_zod.z.string().optional(),showReservedAccount:_zod.z.boolean().optional().default(!1)},va= exports.J =_zod.z.object(Ht),j=e=>Qt.parse(e),Je=e=>{try{for(let[a,i]of Object.entries(e))if(j(a),i!=null)switch(a){case"showReservedAccount":_zod.z.boolean().parse(i);break}}catch(a){throw a instanceof _zod.z.ZodError?y({message:`Validation error: ${a.errors.map(i=>i.message).join(", ")}`,code:"validation_error"}):a}},Yt= exports.K ={clientId:_zod.z.number(),productId:_zod.z.number(),submittedOnDate:_zod.z.string(),nominalAnnualInterestRate:_zod.z.string(),minRequiredOpeningBalance:_zod.z.string(),lockinPeriodFrequency:_zod.z.string(),withdrawalFeeForTransfers:_zod.z.boolean(),allowOverdraft:_zod.z.boolean(),overdraftLimit:_zod.z.number(),minOverdraftForInterestCalculation:_zod.z.number(),enforceMinRequiredBalance:_zod.z.boolean(),minRequiredBalance:_zod.z.number(),withHoldTax:_zod.z.boolean(),interestCompoundingPeriodType:_zod.z.number(),interestPostingPeriodType:_zod.z.number(),interestCalculationType:_zod.z.number(),interestCalculationDaysInYearType:_zod.z.number(),fieldOfficerId:_zod.z.number(),lockinPeriodFrequencyType:_zod.z.number(),locale:_zod.z.string(),dateFormat:_zod.z.string(),monthDayFormat:_zod.z.string(),charges:_zod.z.array(_zod.z.any())},Da= exports.L =_zod.z.object(Yt);var La=e=>({input:e,metadata:{commandName:"GetAccount",path:`/v1/savingaccounts/${e.id}`,method:"GET"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{return(await i.get(`/v1/savingaccounts/${e.id}`)).data}catch(o){u(o)}}}),ka= exports.N =e=>({input:e,metadata:{commandName:"UpdateAccount",path:`/v1/savingsaccounts/${e.accountId}`,method:"PUT"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{return(await i.put(`/v1/savingsaccounts/${e.accountId}`,{...e.updates,clientId:e.clientId})).data}catch(o){u(o)}}}),qa= exports.O =e=>({input:e,metadata:{commandName:"DeleteAccount",path:`/v1/savingsaccounts/${e.accountId}`,method:"DELETE"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{return(await i.delete(`/v1/savingsaccounts/${e.accountId}`)).data}catch(o){u(o)}}}),Xe=(e,a,i)=>({where:d=>(j(d),{eq:c=>(Je({[d]:c}),Xe({...e,[d]:c},a,i))}),execute:()=>({input:{filters:e,tenantId:i},metadata:{commandName:"ListAccountsOfClient",path:`/v1/clients/${a}/accounts`,method:"GET"},execute:async d=>{i&&(d.tenantId=i);let c=await m(d);try{return(await c.get(`/v1/clients/${a}/accounts`,{params:e})).data}catch(l){u(l)}}})}),Fa= exports.P =e=>({list:()=>Xe({},_optionalChain([e, 'optionalAccess', _22 => _22.clientId])||0,_optionalChain([e, 'optionalAccess', _23 => _23.tenantId]))}),Ba= exports.Q =(e,a,i)=>({input:{params:a,configuration:i},metadata:{commandName:"ListAccountsOfClient",path:`/v1/clients/${e}/accounts`,method:"GET"},execute:async o=>{i.tenantId&&(o.tenantId=i.tenantId);let p=await m(o);try{return(await p.get(`/v1/clients/${e}/accounts`,{params:a})).data}catch(d){u(d)}}});var Jt=_zod.z.object({routingNumber:_zod.z.string(),swiftCode:_zod.z.string()}),z=_zod.z.object({accountNumber:_zod.z.string(),bankInformation:Jt}),$=_zod.z.object({line1:_zod.z.string(),line2:_zod.z.string(),city:_zod.z.string(),stateCode:_zod.z.string(),countryCode:_zod.z.string(),postalCode:_zod.z.string()}),Xt={id:_zod.z.number(),clientId:_zod.z.number(),nickName:_zod.z.string(),firstName:_zod.z.string(),lastName:_zod.z.string(),businessName:_zod.z.string(),emailAddress:_zod.z.string(),phoneNumber:_zod.z.string(),recipientType:_zod.z.string(),paymentRail:_zod.z.string(),isOwnAccount:_zod.z.boolean(),address:$,accountDetailsData:z},Zt=_zod.z.object(Xt),_a=_zod.z.array(Zt),en={limit:_zod.z.number().min(1).optional().describe("Maximum number of records to return. Defaults to 20 if not specified. Set to 0 to return all records."),offset:_zod.z.number().min(0).optional(),name:_zod.z.string().optional()},Ga=_zod.z.object(en),tn={nickName:_zod.z.string(),firstName:_zod.z.string(),lastName:_zod.z.string(),businessName:_zod.z.string().optional(),emailAddress:_zod.z.string().email(),phoneNumber:_zod.z.string(),recipientType:_zod.z.string(),paymentRail:R,isOwnAccount:_zod.z.boolean().optional(),address:$.optional(),accountDetailsData:z},Ma=_zod.z.object(tn).refine(e=>e.paymentRail==="WIRE"||e.paymentRail==="SWIFT"?e.address!==void 0&&e.address.stateCode!==void 0&&e.address.countryCode!==void 0:!0,{message:"Address with state code and country code is required for WIRE and SWIFT payment rails",path:["address"]}),nn=_zod.z.enum(["name"]),an=e=>nn.parse(e),et=e=>{try{an(e)}catch(a){throw a instanceof _zod.ZodError?y({message:`Invalid filter key: '${e}'. ${a.message}`,code:"invalid_filter_key"}):a}},tt=(e,a)=>{try{switch(e){case"name":_zod.z.string().parse(a);break;default:break}}catch(i){throw i instanceof _zod.ZodError?y({message:`Invalid value for '${e}': '${a}'. ${i.message}`,code:`invalid_${e}_value`}):i}},rn={nickName:_zod.z.string().optional(),firstName:_zod.z.string().optional(),lastName:_zod.z.string().optional(),businessName:_zod.z.string().optional(),emailAddress:_zod.z.string().email().optional(),phoneNumber:_zod.z.string().optional(),recipientType:_zod.z.string().optional(),paymentRail:R.optional(),isOwnAccount:_zod.z.boolean().optional(),address:$.optional(),accountDetailsData:z.optional()},Ka=_zod.z.object(rn).refine(e=>e.paymentRail&&e.address&&(e.paymentRail==="WIRE"||e.paymentRail==="SWIFT")?e.address.stateCode!==void 0&&e.address.countryCode!==void 0:!0,{message:"When updating address for WIRE/SWIFT payment rails, state code and country code are required",path:["address"]});var er=e=>({input:e,metadata:{commandName:"GetRecipient",path:`/v1/clients/${e.clientId}/recipients/${e.id}`,method:"GET"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{return(await i.get(`/v1/clients/${e.clientId}/recipients/${e.id}`)).data}catch(o){u(o)}}}),tr= exports.S =e=>({input:e,metadata:{commandName:"CreateRecipient",path:`/v1/clients/${e.clientId}/recipients`,method:"POST"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{return(await i.post(`/v1/clients/${e.clientId}/recipients`,e.recipient)).data}catch(o){u(o)}}}),nr= exports.T =e=>({input:e,metadata:{commandName:"DeleteRecipient",path:`/v1/clients/${e.clientId}/recipients/${e.recipientId}`,method:"DELETE"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a);try{return(await i.delete(`/v1/clients/${e.clientId}/recipients/${e.recipientId}`)).data}catch(o){u(o)}}}),w=(e,a,i,o,p)=>({where:l=>(et(l),{eq:g=>(tt(l,g),w(e,{...a,[l]:g},i,o,p))}),limit:l=>w(e,a,l,o,p),offset:l=>w(e,a,i,l,p),execute:()=>{let g={...{name:""},...a,limit:i||20,offset:o||0};return{input:{tenantId:p},metadata:{commandName:"ListRecipients",path:`/v1/clients/${e}/recipients`,method:"GET"},execute:async f=>{p&&(f.tenantId=p);let h=await m(f);try{return(await h.get(`/v1/clients/${e}/recipients`,{params:g})).data}catch(b){u(b)}}}}}),ar= exports.U =e=>({list:()=>w(_optionalChain([e, 'optionalAccess', _24 => _24.clientId])||0,{},void 0,void 0,_optionalChain([e, 'optionalAccess', _25 => _25.tenantId]))}),rr= exports.V =(e,a,i)=>({input:{params:a,configuration:i},metadata:{commandName:"GetRecipients",path:`/v1/clients/${e}/recipients`,method:"GET"},execute:async o=>{i.tenantId&&(o.tenantId=i.tenantId);let p=await m(o);(!a.limit||a.limit<=0)&&(a.limit=20),a.name||(a.name="");try{return(await p.get(`/v1/clients/${e}/recipients`,{params:a})).data}catch(d){u(d)}}});var _graphql = require('graphql');var on=`
2
- mutation updateRecipient($id: ID!, $input: UpdateRecipientInput!) {
3
- updateRecipient(id: $id, input: $input) {
4
- id
5
- clientId
6
- nickName
7
- firstName
8
- lastName
9
- businessName
10
- emailAddress
11
- phoneNumber
12
- recipientType
13
- paymentRail
14
- isOwnAccount
15
- address {
16
- line1
17
- line2
18
- city
19
- stateCode
20
- countryCode
21
- postalCode
22
- }
23
- accountDetailsData {
24
- accountNumber
25
- bankInformation {
26
- routingNumber
27
- swiftCode
28
- }
29
- }
30
- }
31
- }
32
- `,sr= exports.X =e=>{let a=nt({command:on,variables:{id:e.id,input:e.input},operationName:"updateRecipient",tenantId:e.tenantId});return{input:e,metadata:{commandName:"UpdateRecipientGQL",path:"/graphql",method:"POST"},execute:a.execute}};var nt=e=>({input:e,metadata:{commandName:e.operationName||"GraphQL",path:"/graphql",method:"POST"},execute:async a=>{e.tenantId&&(a.tenantId=e.tenantId);let i=await m(a),o=a.graphqlPath||"/graphql";try{let p=typeof e.command=="string"?e.command:_graphql.print.call(void 0, e.command),{data:d}=await i.post(o,{query:p,variables:e.variables,operationName:e.operationName});if(_optionalChain([d, 'access', _26 => _26.errors, 'optionalAccess', _27 => _27.length]))throw y({message:d.errors[0].message,code:"graphql_error",originalError:d.errors[0]});if(!d.data)throw y({message:"No data returned from GraphQL query",code:"graphql_no_data"});return d.data}catch(p){throw p.name==="CommandError"?p:y({message:p.message,code:"graphql_request_failed",originalError:p})}}});exports.a = y; exports.b = dn; exports.c = u; exports.d = m; exports.e = _; exports.f = v; exports.g = R; exports.h = D; exports.i = F; exports.j = ot; exports.k = hn; exports.l = st; exports.m = pt; exports.n = dt; exports.o = lt; exports.p = mt; exports.q = Cn; exports.r = qn; exports.s = Fn; exports.t = Bn; exports.u = Un; exports.v = jn; exports.w = zn; exports.x = ma; exports.y = ua; exports.z = ya; exports.A = ga; exports.B = fa; exports.C = ba; exports.D = ha; exports.E = Vt; exports.F = xa; exports.G = Wt; exports.H = Sa; exports.I = Ht; exports.J = va; exports.K = Yt; exports.L = Da; exports.M = La; exports.N = ka; exports.O = qa; exports.P = Fa; exports.Q = Ba; exports.R = er; exports.S = tr; exports.T = nr; exports.U = ar; exports.V = rr; exports.W = nt; exports.X = sr;