New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ballerine/common

Package Overview
Dependencies
Maintainers
3
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ballerine/common - npm Package Compare versions

Comparing version 0.5.18 to 0.5.19

2

./dist/umd/index.production.js

@@ -11,3 +11,3 @@ /**

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WorkflowCore={})}(this,(function(t){"use strict";function e(){e=function(){return t};var t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",p=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function y(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new A(n||[]);return i(s,"_invoke",{value:w(t,r,a)}),s}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=y;var g={};function m(){}function d(){}function l(){}var f={};u(f,s,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(G([])));v&&v!==r&&n.call(v,s)&&(f=v);var b=l.prototype=m.prototype=Object.create(f);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(i,o,s,a){var p=c(t[i],t,o);if("throw"!==p.type){var u=p.arg,y=u.value;return y&&"object"==typeof y&&n.call(y,"__await")?e.resolve(y.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(y).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,a)}))}a(p.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function w(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return D()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=j(s,r);if(a){if(a===g)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var p=c(t,e,r);if("normal"===p.type){if(n=r.done?"completed":"suspendedYield",p.arg===g)continue;return{value:p.arg,done:r.done}}"throw"===p.type&&(n="completed",r.method="throw",r.arg=p.arg)}}}function j(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,j(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=c(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,g):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function G(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:D}}function D(){return{value:void 0,done:!0}}return d.prototype=l,i(b,"constructor",{value:l,configurable:!0}),i(l,"constructor",{value:d,configurable:!0}),d.displayName=u(l,p,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,u(t,p,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},_(N.prototype),u(N.prototype,a,(function(){return this})),t.AsyncIterator=N,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new N(y(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(b),u(b,p,"Generator"),u(b,s,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=G,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),p=n.call(o,"finallyLoc");if(a&&p){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!p)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:G(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),g}},t}function r(t,e,r,n,i,o,s){try{var a=t[o](s),p=a.value}catch(t){return void r(t)}a.done?e(p):Promise.resolve(p).then(n,i)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,p,"next",t)}function p(t){r(s,i,o,a,p,"throw",t)}a(void 0)}))}}var i=function(){var t=n(e().mark((function t(r){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r;case 3:return n=t.sent,t.abrupt("return",[n,void 0]);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",[void 0,t.t0]);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}(),o=function(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t},s=function(){var t=n(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){return setTimeout(t,r)})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),a=function(t,e){return!(!Array.isArray(t)||null==t||!t.length)&&t.every(e)},p="^$|^GHA-\\d{9}-\\d{1}$",u="^[a-zA-Z0-9]*$",y={category:"proof_of_address",type:"water_bill",issuer:{type:"local_authority",city:"Accra",name:"Accra Metropolitan Assembly",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},c=[{category:"financial_information",type:"mtn_statement",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{accountNameHolder:{type:"string"},msisdn:{type:"string",pattern:"^233[0-9]{9}$"},from:{type:"string",format:"date"},to:{type:"string",format:"date"},timeRun:{type:"string",format:"date"},accountHolderName:{type:"string"},maxBalanceRecorded:{type:"number"}}}},{category:"proof_of_address",type:"water_bill",issuer:{type:"local_authority",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"electricity_bill",issuer:{type:"local_authority",city:"Accra",name:"Electricity Company of Ghana",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"tenancy_agreement",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},rentalAmount:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"payslip",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},salaryAmount:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"appointment_letter",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"bank_statement",issuer:{type:"bank",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"mortgage_statement",issuer:{type:"bank",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"property_rate",issuer:{type:"local_authority",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"birth_certificate",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},birthPlace:{type:"string"},dateOfBirth:{type:"string",format:"date"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"ssnit_pension_statement",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"introductory_letter",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_a",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_a",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_3",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_3",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_4",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_4",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"certificate_of_registration",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{companyName:{type:"string"},taxIdNumber:{type:"string",pattern:u},registrationNumber:{type:"string",pattern:u},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"district_assembly_certificate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{certificateNo:{type:"string",pattern:u},registrationNumber:{type:"string",pattern:u},companyName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"form_a",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{registrationNumber:{type:"string",pattern:u},taxIdNumber:{type:"string",pattern:u}}}},{category:"proof_of_registration",type:"shareholder_details",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}},{category:"company_structure",type:"shareholders",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}}},{category:"registration_document",type:"certificate_of_incorporatio",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{properties:{companyName:{type:"string"},country:{type:"string"},state:{type:"string"},vat:{type:"string"},companyType:{type:"string"},establishmentDate:{type:"string"}}}}},{category:"proof_of_bank_account",type:"bank_statement",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{country:{type:"string"},name:{type:"string"},holderName:{type:"string"},accountNumber:{type:"string"},currency:{type:"string"}}}],g={GH:c,CA:[{category:"incorporation",type:"pdf",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{businessName:{type:"string"},website:{type:"string"},phone:{type:"string"},email:{type:"string"},owner:{type:"string"},tin:{type:"string"}}}},{category:"id",type:"photo",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"},authority:{type:"string"},placeOfIssue:{type:"string"},issueDate:{type:"string"},expires:{type:"string"},dateOfBirth:{type:"string"},placeOfBirth:{type:"string"},sex:{type:"string"}}}},{category:"selfie",type:"photo",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"},authority:{type:"string"},placeOfIssue:{type:"string"},issueDate:{type:"string"},expires:{type:"string"},dateOfBirth:{type:"string"},placeOfBirth:{type:"string"},sex:{type:"string"}}}}]};t.certificateOfResidenceGH=y,t.defaultContextSchema={$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{entity:{type:"object",properties:{type:{enum:["individual","business"]},data:{type:"object",properties:{additionalInfo:{type:"object"}},additionalProperties:!0},ballerineEntityId:{type:"string"},id:{type:"string"}},required:["type"],anyOf:[{required:["id"]},{required:["ballerineEntityId"]}],additionalProperties:!1},documents:{type:"array",items:{type:"object",properties:{id:{type:"string"},category:{type:"string",transform:["trim","toLowerCase"]},type:{type:"string",transform:["trim","toLowerCase"]},issuer:{type:"object",properties:{type:{type:"string"},name:{type:"string"},country:{type:"string",transform:["trim","toUpperCase"]},city:{type:"string"},additionalInfo:{type:"object"}},required:["country"],additionalProperties:!1},issuingVersion:{type:"integer"},decision:{type:"object",properties:{status:{type:"string",enum:["new","pending","revision","approved","rejected"]},rejectionReason:{anyOf:[{type:"string"},{type:"string",enum:["Suspicious document","Document does not match customer profile","Potential identity theft","Fake or altered document","Document on watchlist or blacklist"]}]},revisionReason:{anyOf:[{type:"string"},{type:"string",enum:["Wrong document","Fake document","Spam","Ownership mismatch - Name","Ownership mismatch - National ID","Unknown document type","Bad image quality","Missing page","Invalid document","Expired document","Unreadable document","Blurry image","Other"]}]}},additionalProperties:!1},version:{type:"integer"},pages:{type:"array",items:{type:"object",properties:{ballerineFileId:{type:"string"},provider:{type:"string",enum:["gcs","http","stream","base64","ftp"]},uri:{type:"string",format:"uri"},type:{enum:["pdf","png","jpg"]},data:{type:"string"},metadata:{type:"object",properties:{side:{type:"string"},pageNumber:{type:"string"}},additionalProperties:!1}},required:["provider","uri","type"],additionalProperties:!1}},properties:{type:"object",properties:{email:{type:"string",format:"email"},expiryDate:{type:"string",format:"date"},idNumber:{type:"string",format:"regex"}}}},required:["category","type","issuer","pages","properties"],additionalProperties:!1}}},required:["entity","documents"]},t.dump=function(t){return JSON.stringify(t,null,2)},t.everyDocumentDecisionStatus=function(t,e){return a(t,(function(t){var r;return(null==t||null==(r=t.decision)?void 0:r.status)===e}))},t.getDocumentId=function(t,e){var r;if(void 0===e&&(e=!0),e&&null!=t&&t.id)return t.id;var n=(null==t?void 0:t.category)+"-"+(null==t?void 0:t.type)+"-"+(null==t||null==(r=t.issuer)?void 0:r.country);return t.version&&(n=n+"-v"+t.version),n.toLowerCase()},t.getDocumentsByCountry=function(t){return g[t]||[]},t.ghanaDocuments=c,t.handlePromise=i,t.isEmptyObject=function(t){return o(t)&&0===Object.keys(t).length},t.isErrorWithCode=function(t){return o(t)&&"code"in t&&"number"==typeof t.code},t.isErrorWithMessage=function(t){return o(t)&&"message"in t&&"string"==typeof t.message},t.isErrorWithName=function(t){return o(t)&&"name"in t&&"string"==typeof t.name},t.isFunction=function(t){return"function"==typeof t},t.isNullish=function(t){return null==t},t.isObject=o,t.log=function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return t&&(e=console).log.apply(e,n)},t.noNullish=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return t.reduce((function(t,e,n){var i,o=null!=(i=r[n])?i:"";return t+e+String(o)}),"").replace(/\s+/g," ")},t.raise=function(t,e){throw"string"==typeof t?new Error(t,{cause:e}):t},t.safeEvery=a,t.sleep=s,t.someDocumentDecisionStatus=function(t,e){return null==t?void 0:t.some((function(t){var r;return(null==t||null==(r=t.decision)?void 0:r.status)===e}))},t.uniqueArray=function(t){return Array.from(new Set(t))},t.zodErrorToReadable=function(t){return t.issues.map((function(t){var e;return(null==(e=t.path)?void 0:e.join("."))+": "+t.message})).join("\n")},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WorkflowCore={})}(this,(function(t){"use strict";function e(){e=function(){return t};var t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",p=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function y(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new A(n||[]);return i(s,"_invoke",{value:w(t,r,a)}),s}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=y;var g={};function m(){}function d(){}function l(){}var f={};u(f,s,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(G([])));v&&v!==r&&n.call(v,s)&&(f=v);var b=l.prototype=m.prototype=Object.create(f);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(i,o,s,a){var p=c(t[i],t,o);if("throw"!==p.type){var u=p.arg,y=u.value;return y&&"object"==typeof y&&n.call(y,"__await")?e.resolve(y.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(y).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,a)}))}a(p.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function w(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return D()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=j(s,r);if(a){if(a===g)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var p=c(t,e,r);if("normal"===p.type){if(n=r.done?"completed":"suspendedYield",p.arg===g)continue;return{value:p.arg,done:r.done}}"throw"===p.type&&(n="completed",r.method="throw",r.arg=p.arg)}}}function j(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,j(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=c(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,g):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function G(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:D}}function D(){return{value:void 0,done:!0}}return d.prototype=l,i(b,"constructor",{value:l,configurable:!0}),i(l,"constructor",{value:d,configurable:!0}),d.displayName=u(l,p,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,u(t,p,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},_(N.prototype),u(N.prototype,a,(function(){return this})),t.AsyncIterator=N,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new N(y(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(b),u(b,p,"Generator"),u(b,s,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=G,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),p=n.call(o,"finallyLoc");if(a&&p){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!p)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:G(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),g}},t}function r(t,e,r,n,i,o,s){try{var a=t[o](s),p=a.value}catch(t){return void r(t)}a.done?e(p):Promise.resolve(p).then(n,i)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,p,"next",t)}function p(t){r(s,i,o,a,p,"throw",t)}a(void 0)}))}}var i=function(){var t=n(e().mark((function t(r){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r;case 3:return n=t.sent,t.abrupt("return",[n,void 0]);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",[void 0,t.t0]);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}(),o=function(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t},s=function(){var t=n(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){return setTimeout(t,r)})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),a=function(t,e){return!(!Array.isArray(t)||null==t||!t.length)&&t.every(e)},p="^$|^GHA-\\d{9}-\\d{1}$",u="^[a-zA-Z0-9]*$",y={category:"proof_of_address",type:"water_bill",issuer:{type:"local_authority",city:"Accra",name:"Accra Metropolitan Assembly",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},c=[{category:"financial_information",type:"mtn_statement",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{accountNameHolder:{type:"string"},msisdn:{type:"string",pattern:"^233[0-9]{9}$"},from:{type:"string",format:"date"},to:{type:"string",format:"date"},timeRun:{type:"string",format:"date"},accountHolderName:{type:"string"},maxBalanceRecorded:{type:"number"}}}},{category:"proof_of_address",type:"water_bill",issuer:{type:"local_authority",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"electricity_bill",issuer:{type:"local_authority",city:"Accra",name:"Electricity Company of Ghana",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"tenancy_agreement",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},rentalAmount:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"payslip",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},salaryAmount:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"appointment_letter",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"bank_statement",issuer:{type:"bank",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"mortgage_statement",issuer:{type:"bank",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"property_rate",issuer:{type:"local_authority",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"birth_certificate",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},birthPlace:{type:"string"},dateOfBirth:{type:"string",format:"date"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"ssnit_pension_statement",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"introductory_letter",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_a",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_a",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_3",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_3",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_4",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_4",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"certificate_of_registration",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{companyName:{type:"string"},taxIdNumber:{type:"string",pattern:u},registrationNumber:{type:"string",pattern:u},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"district_assembly_certificate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{certificateNo:{type:"string",pattern:u},registrationNumber:{type:"string",pattern:u},companyName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"form_a",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{registrationNumber:{type:"string",pattern:u},taxIdNumber:{type:"string",pattern:u}}}},{category:"proof_of_registration",type:"shareholder_details",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}},{category:"company_structure",type:"shareholders",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}}},{category:"registration_document",type:"certificate_of_incorporation",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{properties:{companyName:{type:"string"},country:{type:"string"},state:{type:"string"},vat:{type:"string"},companyType:{type:"string"},establishmentDate:{type:"string"}}}}},{category:"proof_of_bank_account",type:"bank_statement",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{country:{type:"string"},name:{type:"string"},holderName:{type:"string"},accountNumber:{type:"string"},currency:{type:"string"}}}],g={GH:c,CA:[{category:"incorporation",type:"pdf",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{businessName:{type:"string"},website:{type:"string"},phone:{type:"string"},email:{type:"string"},owner:{type:"string"},tin:{type:"string"}}}},{category:"id",type:"photo",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"},authority:{type:"string"},placeOfIssue:{type:"string"},issueDate:{type:"string"},expires:{type:"string"},dateOfBirth:{type:"string"},placeOfBirth:{type:"string"},sex:{type:"string"}}}},{category:"selfie",type:"photo",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"},authority:{type:"string"},placeOfIssue:{type:"string"},issueDate:{type:"string"},expires:{type:"string"},dateOfBirth:{type:"string"},placeOfBirth:{type:"string"},sex:{type:"string"}}}}]};t.certificateOfResidenceGH=y,t.defaultContextSchema={$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{entity:{type:"object",properties:{type:{enum:["individual","business"]},data:{type:"object",properties:{additionalInfo:{type:"object"}},additionalProperties:!0},ballerineEntityId:{type:"string"},id:{type:"string"}},required:["type"],anyOf:[{required:["id"]},{required:["ballerineEntityId"]}],additionalProperties:!1},documents:{type:"array",items:{type:"object",properties:{id:{type:"string"},category:{type:"string",transform:["trim","toLowerCase"]},type:{type:"string",transform:["trim","toLowerCase"]},issuer:{type:"object",properties:{type:{type:"string"},name:{type:"string"},country:{type:"string",transform:["trim","toUpperCase"]},city:{type:"string"},additionalInfo:{type:"object"}},required:["country"],additionalProperties:!1},issuingVersion:{type:"integer"},decision:{type:"object",properties:{status:{type:"string",enum:["new","pending","revision","approved","rejected"]},rejectionReason:{anyOf:[{type:"string"},{type:"string",enum:["Suspicious document","Document does not match customer profile","Potential identity theft","Fake or altered document","Document on watchlist or blacklist"]}]},revisionReason:{anyOf:[{type:"string"},{type:"string",enum:["Wrong document","Fake document","Spam","Ownership mismatch - Name","Ownership mismatch - National ID","Unknown document type","Bad image quality","Missing page","Invalid document","Expired document","Unreadable document","Blurry image","Other"]}]}},additionalProperties:!1},version:{type:"integer"},pages:{type:"array",items:{type:"object",properties:{ballerineFileId:{type:"string"},provider:{type:"string",enum:["gcs","http","stream","base64","ftp"]},uri:{type:"string",format:"uri"},type:{enum:["pdf","png","jpg"]},data:{type:"string"},metadata:{type:"object",properties:{side:{type:"string"},pageNumber:{type:"string"}},additionalProperties:!1}},required:["provider","uri","type"],additionalProperties:!1}},properties:{type:"object",properties:{email:{type:"string",format:"email"},expiryDate:{type:"string",format:"date"},idNumber:{type:"string",format:"regex"}}}},required:["category","type","issuer","pages","properties"],additionalProperties:!1}}},required:["entity","documents"]},t.dump=function(t){return JSON.stringify(t,null,2)},t.everyDocumentDecisionStatus=function(t,e){return a(t,(function(t){var r;return(null==t||null==(r=t.decision)?void 0:r.status)===e}))},t.getDocumentId=function(t,e){var r;if(void 0===e&&(e=!0),e&&null!=t&&t.id)return t.id;var n=(null==t?void 0:t.category)+"-"+(null==t?void 0:t.type)+"-"+(null==t||null==(r=t.issuer)?void 0:r.country);return t.version&&(n=n+"-v"+t.version),n.toLowerCase()},t.getDocumentsByCountry=function(t){return g[t]||[]},t.ghanaDocuments=c,t.handlePromise=i,t.isEmptyObject=function(t){return o(t)&&0===Object.keys(t).length},t.isErrorWithCode=function(t){return o(t)&&"code"in t&&"number"==typeof t.code},t.isErrorWithMessage=function(t){return o(t)&&"message"in t&&"string"==typeof t.message},t.isErrorWithName=function(t){return o(t)&&"name"in t&&"string"==typeof t.name},t.isFunction=function(t){return"function"==typeof t},t.isNullish=function(t){return null==t},t.isObject=o,t.log=function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return t&&(e=console).log.apply(e,n)},t.noNullish=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return t.reduce((function(t,e,n){var i,o=null!=(i=r[n])?i:"";return t+e+String(o)}),"").replace(/\s+/g," ")},t.raise=function(t,e){throw"string"==typeof t?new Error(t,{cause:e}):t},t.safeEvery=a,t.sleep=s,t.someDocumentDecisionStatus=function(t,e){return null==t?void 0:t.some((function(t){var r;return(null==t||null==(r=t.decision)?void 0:r.status)===e}))},t.uniqueArray=function(t){return Array.from(new Set(t))},t.zodErrorToReadable=function(t){return t.issues.map((function(t){var e;return(null==(e=t.path)?void 0:e.join("."))+": "+t.message})).join("\n")},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map

@@ -797,3 +797,3 @@ /**

category: 'registration_document',
type: 'certificate_of_incorporatio',
type: 'certificate_of_incorporation',
issuer: {

@@ -800,0 +800,0 @@ type: 'private',

@@ -793,3 +793,3 @@ /**

category: 'registration_document',
type: 'certificate_of_incorporatio',
type: 'certificate_of_incorporation',
issuer: {

@@ -796,0 +796,0 @@ type: 'private',

@@ -1448,3 +1448,3 @@ /**

category: 'registration_document',
type: 'certificate_of_incorporatio',
type: 'certificate_of_incorporation',
issuer: {

@@ -1451,0 +1451,0 @@ type: 'private',

@@ -11,3 +11,3 @@ /**

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WorkflowCore={})}(this,(function(t){"use strict";function e(){e=function(){return t};var t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",p=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function y(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new A(n||[]);return i(s,"_invoke",{value:w(t,r,a)}),s}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=y;var g={};function m(){}function d(){}function l(){}var f={};u(f,s,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(G([])));v&&v!==r&&n.call(v,s)&&(f=v);var b=l.prototype=m.prototype=Object.create(f);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(i,o,s,a){var p=c(t[i],t,o);if("throw"!==p.type){var u=p.arg,y=u.value;return y&&"object"==typeof y&&n.call(y,"__await")?e.resolve(y.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(y).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,a)}))}a(p.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function w(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return D()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=j(s,r);if(a){if(a===g)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var p=c(t,e,r);if("normal"===p.type){if(n=r.done?"completed":"suspendedYield",p.arg===g)continue;return{value:p.arg,done:r.done}}"throw"===p.type&&(n="completed",r.method="throw",r.arg=p.arg)}}}function j(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,j(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=c(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,g):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function G(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:D}}function D(){return{value:void 0,done:!0}}return d.prototype=l,i(b,"constructor",{value:l,configurable:!0}),i(l,"constructor",{value:d,configurable:!0}),d.displayName=u(l,p,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,u(t,p,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},_(N.prototype),u(N.prototype,a,(function(){return this})),t.AsyncIterator=N,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new N(y(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(b),u(b,p,"Generator"),u(b,s,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=G,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),p=n.call(o,"finallyLoc");if(a&&p){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!p)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:G(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),g}},t}function r(t,e,r,n,i,o,s){try{var a=t[o](s),p=a.value}catch(t){return void r(t)}a.done?e(p):Promise.resolve(p).then(n,i)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,p,"next",t)}function p(t){r(s,i,o,a,p,"throw",t)}a(void 0)}))}}var i=function(){var t=n(e().mark((function t(r){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r;case 3:return n=t.sent,t.abrupt("return",[n,void 0]);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",[void 0,t.t0]);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}(),o=function(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t},s=function(){var t=n(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){return setTimeout(t,r)})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),a=function(t,e){return!(!Array.isArray(t)||null==t||!t.length)&&t.every(e)},p="^$|^GHA-\\d{9}-\\d{1}$",u="^[a-zA-Z0-9]*$",y={category:"proof_of_address",type:"water_bill",issuer:{type:"local_authority",city:"Accra",name:"Accra Metropolitan Assembly",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},c=[{category:"financial_information",type:"mtn_statement",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{accountNameHolder:{type:"string"},msisdn:{type:"string",pattern:"^233[0-9]{9}$"},from:{type:"string",format:"date"},to:{type:"string",format:"date"},timeRun:{type:"string",format:"date"},accountHolderName:{type:"string"},maxBalanceRecorded:{type:"number"}}}},{category:"proof_of_address",type:"water_bill",issuer:{type:"local_authority",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"electricity_bill",issuer:{type:"local_authority",city:"Accra",name:"Electricity Company of Ghana",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"tenancy_agreement",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},rentalAmount:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"payslip",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},salaryAmount:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"appointment_letter",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"bank_statement",issuer:{type:"bank",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"mortgage_statement",issuer:{type:"bank",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"property_rate",issuer:{type:"local_authority",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"birth_certificate",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},birthPlace:{type:"string"},dateOfBirth:{type:"string",format:"date"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"ssnit_pension_statement",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"introductory_letter",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_a",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_a",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_3",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_3",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_4",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_4",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"certificate_of_registration",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{companyName:{type:"string"},taxIdNumber:{type:"string",pattern:u},registrationNumber:{type:"string",pattern:u},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"district_assembly_certificate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{certificateNo:{type:"string",pattern:u},registrationNumber:{type:"string",pattern:u},companyName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"form_a",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{registrationNumber:{type:"string",pattern:u},taxIdNumber:{type:"string",pattern:u}}}},{category:"proof_of_registration",type:"shareholder_details",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}},{category:"company_structure",type:"shareholders",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}}},{category:"registration_document",type:"certificate_of_incorporatio",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{properties:{companyName:{type:"string"},country:{type:"string"},state:{type:"string"},vat:{type:"string"},companyType:{type:"string"},establishmentDate:{type:"string"}}}}},{category:"proof_of_bank_account",type:"bank_statement",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{country:{type:"string"},name:{type:"string"},holderName:{type:"string"},accountNumber:{type:"string"},currency:{type:"string"}}}],g={GH:c,CA:[{category:"incorporation",type:"pdf",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{businessName:{type:"string"},website:{type:"string"},phone:{type:"string"},email:{type:"string"},owner:{type:"string"},tin:{type:"string"}}}},{category:"id",type:"photo",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"},authority:{type:"string"},placeOfIssue:{type:"string"},issueDate:{type:"string"},expires:{type:"string"},dateOfBirth:{type:"string"},placeOfBirth:{type:"string"},sex:{type:"string"}}}},{category:"selfie",type:"photo",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"},authority:{type:"string"},placeOfIssue:{type:"string"},issueDate:{type:"string"},expires:{type:"string"},dateOfBirth:{type:"string"},placeOfBirth:{type:"string"},sex:{type:"string"}}}}]};t.certificateOfResidenceGH=y,t.defaultContextSchema={$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{entity:{type:"object",properties:{type:{enum:["individual","business"]},data:{type:"object",properties:{additionalInfo:{type:"object"}},additionalProperties:!0},ballerineEntityId:{type:"string"},id:{type:"string"}},required:["type"],anyOf:[{required:["id"]},{required:["ballerineEntityId"]}],additionalProperties:!1},documents:{type:"array",items:{type:"object",properties:{id:{type:"string"},category:{type:"string",transform:["trim","toLowerCase"]},type:{type:"string",transform:["trim","toLowerCase"]},issuer:{type:"object",properties:{type:{type:"string"},name:{type:"string"},country:{type:"string",transform:["trim","toUpperCase"]},city:{type:"string"},additionalInfo:{type:"object"}},required:["country"],additionalProperties:!1},issuingVersion:{type:"integer"},decision:{type:"object",properties:{status:{type:"string",enum:["new","pending","revision","approved","rejected"]},rejectionReason:{anyOf:[{type:"string"},{type:"string",enum:["Suspicious document","Document does not match customer profile","Potential identity theft","Fake or altered document","Document on watchlist or blacklist"]}]},revisionReason:{anyOf:[{type:"string"},{type:"string",enum:["Wrong document","Fake document","Spam","Ownership mismatch - Name","Ownership mismatch - National ID","Unknown document type","Bad image quality","Missing page","Invalid document","Expired document","Unreadable document","Blurry image","Other"]}]}},additionalProperties:!1},version:{type:"integer"},pages:{type:"array",items:{type:"object",properties:{ballerineFileId:{type:"string"},provider:{type:"string",enum:["gcs","http","stream","base64","ftp"]},uri:{type:"string",format:"uri"},type:{enum:["pdf","png","jpg"]},data:{type:"string"},metadata:{type:"object",properties:{side:{type:"string"},pageNumber:{type:"string"}},additionalProperties:!1}},required:["provider","uri","type"],additionalProperties:!1}},properties:{type:"object",properties:{email:{type:"string",format:"email"},expiryDate:{type:"string",format:"date"},idNumber:{type:"string",format:"regex"}}}},required:["category","type","issuer","pages","properties"],additionalProperties:!1}}},required:["entity","documents"]},t.dump=function(t){return JSON.stringify(t,null,2)},t.everyDocumentDecisionStatus=function(t,e){return a(t,(function(t){var r;return(null==t||null==(r=t.decision)?void 0:r.status)===e}))},t.getDocumentId=function(t,e){var r;if(void 0===e&&(e=!0),e&&null!=t&&t.id)return t.id;var n=(null==t?void 0:t.category)+"-"+(null==t?void 0:t.type)+"-"+(null==t||null==(r=t.issuer)?void 0:r.country);return t.version&&(n=n+"-v"+t.version),n.toLowerCase()},t.getDocumentsByCountry=function(t){return g[t]||[]},t.ghanaDocuments=c,t.handlePromise=i,t.isEmptyObject=function(t){return o(t)&&0===Object.keys(t).length},t.isErrorWithCode=function(t){return o(t)&&"code"in t&&"number"==typeof t.code},t.isErrorWithMessage=function(t){return o(t)&&"message"in t&&"string"==typeof t.message},t.isErrorWithName=function(t){return o(t)&&"name"in t&&"string"==typeof t.name},t.isFunction=function(t){return"function"==typeof t},t.isNullish=function(t){return null==t},t.isObject=o,t.log=function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return t&&(e=console).log.apply(e,n)},t.noNullish=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return t.reduce((function(t,e,n){var i,o=null!=(i=r[n])?i:"";return t+e+String(o)}),"").replace(/\s+/g," ")},t.raise=function(t,e){throw"string"==typeof t?new Error(t,{cause:e}):t},t.safeEvery=a,t.sleep=s,t.someDocumentDecisionStatus=function(t,e){return null==t?void 0:t.some((function(t){var r;return(null==t||null==(r=t.decision)?void 0:r.status)===e}))},t.uniqueArray=function(t){return Array.from(new Set(t))},t.zodErrorToReadable=function(t){return t.issues.map((function(t){var e;return(null==(e=t.path)?void 0:e.join("."))+": "+t.message})).join("\n")},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WorkflowCore={})}(this,(function(t){"use strict";function e(){e=function(){return t};var t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",p=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function y(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new A(n||[]);return i(s,"_invoke",{value:w(t,r,a)}),s}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=y;var g={};function m(){}function d(){}function l(){}var f={};u(f,s,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(G([])));v&&v!==r&&n.call(v,s)&&(f=v);var b=l.prototype=m.prototype=Object.create(f);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(i,o,s,a){var p=c(t[i],t,o);if("throw"!==p.type){var u=p.arg,y=u.value;return y&&"object"==typeof y&&n.call(y,"__await")?e.resolve(y.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(y).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,a)}))}a(p.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function w(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return D()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=j(s,r);if(a){if(a===g)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var p=c(t,e,r);if("normal"===p.type){if(n=r.done?"completed":"suspendedYield",p.arg===g)continue;return{value:p.arg,done:r.done}}"throw"===p.type&&(n="completed",r.method="throw",r.arg=p.arg)}}}function j(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,j(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=c(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,g):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function G(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:D}}function D(){return{value:void 0,done:!0}}return d.prototype=l,i(b,"constructor",{value:l,configurable:!0}),i(l,"constructor",{value:d,configurable:!0}),d.displayName=u(l,p,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,u(t,p,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},_(N.prototype),u(N.prototype,a,(function(){return this})),t.AsyncIterator=N,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new N(y(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(b),u(b,p,"Generator"),u(b,s,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=G,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),p=n.call(o,"finallyLoc");if(a&&p){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!p)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:G(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),g}},t}function r(t,e,r,n,i,o,s){try{var a=t[o](s),p=a.value}catch(t){return void r(t)}a.done?e(p):Promise.resolve(p).then(n,i)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,p,"next",t)}function p(t){r(s,i,o,a,p,"throw",t)}a(void 0)}))}}var i=function(){var t=n(e().mark((function t(r){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r;case 3:return n=t.sent,t.abrupt("return",[n,void 0]);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",[void 0,t.t0]);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}(),o=function(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t},s=function(){var t=n(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){return setTimeout(t,r)})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),a=function(t,e){return!(!Array.isArray(t)||null==t||!t.length)&&t.every(e)},p="^$|^GHA-\\d{9}-\\d{1}$",u="^[a-zA-Z0-9]*$",y={category:"proof_of_address",type:"water_bill",issuer:{type:"local_authority",city:"Accra",name:"Accra Metropolitan Assembly",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},c=[{category:"financial_information",type:"mtn_statement",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{accountNameHolder:{type:"string"},msisdn:{type:"string",pattern:"^233[0-9]{9}$"},from:{type:"string",format:"date"},to:{type:"string",format:"date"},timeRun:{type:"string",format:"date"},accountHolderName:{type:"string"},maxBalanceRecorded:{type:"number"}}}},{category:"proof_of_address",type:"water_bill",issuer:{type:"local_authority",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"electricity_bill",issuer:{type:"local_authority",city:"Accra",name:"Electricity Company of Ghana",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"tenancy_agreement",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},rentalAmount:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"payslip",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},salaryAmount:{type:"number"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"appointment_letter",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"bank_statement",issuer:{type:"bank",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"mortgage_statement",issuer:{type:"bank",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"property_rate",issuer:{type:"local_authority",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"birth_certificate",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},birthPlace:{type:"string"},dateOfBirth:{type:"string",format:"date"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"ssnit_pension_statement",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"introductory_letter",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_a",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_a",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_3",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_3",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_address",type:"form_4",issuer:{type:"government",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},userAddress:{type:"string"},physicalAddress:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_employment",type:"form_4",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:p},docNumber:{type:"string",pattern:u},employeeName:{type:"string"},position:{type:"string"},employerName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"certificate_of_registration",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{companyName:{type:"string"},taxIdNumber:{type:"string",pattern:u},registrationNumber:{type:"string",pattern:u},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"district_assembly_certificate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{certificateNo:{type:"string",pattern:u},registrationNumber:{type:"string",pattern:u},companyName:{type:"string"},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"form_a",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{registrationNumber:{type:"string",pattern:u},taxIdNumber:{type:"string",pattern:u}}}},{category:"proof_of_registration",type:"shareholder_details",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}},{category:"company_structure",type:"shareholders",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}}},{category:"registration_document",type:"certificate_of_incorporation",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{properties:{companyName:{type:"string"},country:{type:"string"},state:{type:"string"},vat:{type:"string"},companyType:{type:"string"},establishmentDate:{type:"string"}}}}},{category:"proof_of_bank_account",type:"bank_statement",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{country:{type:"string"},name:{type:"string"},holderName:{type:"string"},accountNumber:{type:"string"},currency:{type:"string"}}}],g={GH:c,CA:[{category:"incorporation",type:"pdf",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{businessName:{type:"string"},website:{type:"string"},phone:{type:"string"},email:{type:"string"},owner:{type:"string"},tin:{type:"string"}}}},{category:"id",type:"photo",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"},authority:{type:"string"},placeOfIssue:{type:"string"},issueDate:{type:"string"},expires:{type:"string"},dateOfBirth:{type:"string"},placeOfBirth:{type:"string"},sex:{type:"string"}}}},{category:"selfie",type:"photo",issuer:{type:"local_authority",country:"CA"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"},authority:{type:"string"},placeOfIssue:{type:"string"},issueDate:{type:"string"},expires:{type:"string"},dateOfBirth:{type:"string"},placeOfBirth:{type:"string"},sex:{type:"string"}}}}]};t.certificateOfResidenceGH=y,t.defaultContextSchema={$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{entity:{type:"object",properties:{type:{enum:["individual","business"]},data:{type:"object",properties:{additionalInfo:{type:"object"}},additionalProperties:!0},ballerineEntityId:{type:"string"},id:{type:"string"}},required:["type"],anyOf:[{required:["id"]},{required:["ballerineEntityId"]}],additionalProperties:!1},documents:{type:"array",items:{type:"object",properties:{id:{type:"string"},category:{type:"string",transform:["trim","toLowerCase"]},type:{type:"string",transform:["trim","toLowerCase"]},issuer:{type:"object",properties:{type:{type:"string"},name:{type:"string"},country:{type:"string",transform:["trim","toUpperCase"]},city:{type:"string"},additionalInfo:{type:"object"}},required:["country"],additionalProperties:!1},issuingVersion:{type:"integer"},decision:{type:"object",properties:{status:{type:"string",enum:["new","pending","revision","approved","rejected"]},rejectionReason:{anyOf:[{type:"string"},{type:"string",enum:["Suspicious document","Document does not match customer profile","Potential identity theft","Fake or altered document","Document on watchlist or blacklist"]}]},revisionReason:{anyOf:[{type:"string"},{type:"string",enum:["Wrong document","Fake document","Spam","Ownership mismatch - Name","Ownership mismatch - National ID","Unknown document type","Bad image quality","Missing page","Invalid document","Expired document","Unreadable document","Blurry image","Other"]}]}},additionalProperties:!1},version:{type:"integer"},pages:{type:"array",items:{type:"object",properties:{ballerineFileId:{type:"string"},provider:{type:"string",enum:["gcs","http","stream","base64","ftp"]},uri:{type:"string",format:"uri"},type:{enum:["pdf","png","jpg"]},data:{type:"string"},metadata:{type:"object",properties:{side:{type:"string"},pageNumber:{type:"string"}},additionalProperties:!1}},required:["provider","uri","type"],additionalProperties:!1}},properties:{type:"object",properties:{email:{type:"string",format:"email"},expiryDate:{type:"string",format:"date"},idNumber:{type:"string",format:"regex"}}}},required:["category","type","issuer","pages","properties"],additionalProperties:!1}}},required:["entity","documents"]},t.dump=function(t){return JSON.stringify(t,null,2)},t.everyDocumentDecisionStatus=function(t,e){return a(t,(function(t){var r;return(null==t||null==(r=t.decision)?void 0:r.status)===e}))},t.getDocumentId=function(t,e){var r;if(void 0===e&&(e=!0),e&&null!=t&&t.id)return t.id;var n=(null==t?void 0:t.category)+"-"+(null==t?void 0:t.type)+"-"+(null==t||null==(r=t.issuer)?void 0:r.country);return t.version&&(n=n+"-v"+t.version),n.toLowerCase()},t.getDocumentsByCountry=function(t){return g[t]||[]},t.ghanaDocuments=c,t.handlePromise=i,t.isEmptyObject=function(t){return o(t)&&0===Object.keys(t).length},t.isErrorWithCode=function(t){return o(t)&&"code"in t&&"number"==typeof t.code},t.isErrorWithMessage=function(t){return o(t)&&"message"in t&&"string"==typeof t.message},t.isErrorWithName=function(t){return o(t)&&"name"in t&&"string"==typeof t.name},t.isFunction=function(t){return"function"==typeof t},t.isNullish=function(t){return null==t},t.isObject=o,t.log=function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return t&&(e=console).log.apply(e,n)},t.noNullish=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return t.reduce((function(t,e,n){var i,o=null!=(i=r[n])?i:"";return t+e+String(o)}),"").replace(/\s+/g," ")},t.raise=function(t,e){throw"string"==typeof t?new Error(t,{cause:e}):t},t.safeEvery=a,t.sleep=s,t.someDocumentDecisionStatus=function(t,e){return null==t?void 0:t.some((function(t){var r;return(null==t||null==(r=t.decision)?void 0:r.status)===e}))},t.uniqueArray=function(t){return Array.from(new Set(t))},t.zodErrorToReadable=function(t){return t.issues.map((function(t){var e;return(null==(e=t.path)?void 0:e.join("."))+": "+t.message})).join("\n")},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map

@@ -5,3 +5,3 @@ {

"author": "Ballerine <dev@ballerine.com>",
"version": "0.5.18",
"version": "0.5.19",
"description": "common",

@@ -40,2 +40,4 @@ "module": "./dist/esm/index.js",

"concurrently": "^7.6.0",
"cspell": "^6.31.2",
"@cspell/cspell-types": "^6.31.1",
"cz-conventional-changelog": "^3.3.0",

@@ -68,2 +70,3 @@ "eslint": "^8.32.0",

"scripts": {
"spellcheck": "cspell \"*\"",
"build": "rollup --config rollup.config.js",

@@ -70,0 +73,0 @@ "watch": "concurrently --kill-others \"rollup --config rollup.config.js -w\" \"tsc -b --watch\"",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc