@ballerine/common
Advanced tools
Comparing version 0.5.20 to 0.5.21
@@ -27,5 +27,7 @@ /** | ||
var zodErrorToReadable = require('./utils/zod-error-to-readable/zod-error-to-readable.js'); | ||
var index = require('./types/index.js'); | ||
var defaultContextSchema = require('./schemas/documents/default-context-schema.js'); | ||
var defaultInsertContextSchema = require('./schemas/documents/default-insert-context-schema.js'); | ||
var GH = require('./schemas/documents/workflow/documents/schemas/GH.js'); | ||
var index = require('./schemas/documents/workflow/documents/schemas/index.js'); | ||
var index$1 = require('./schemas/documents/workflow/documents/schemas/index.js'); | ||
@@ -46,7 +48,10 @@ | ||
exports.zodErrorToReadable = zodErrorToReadable.zodErrorToReadable; | ||
exports.SchemaType = index.SchemaType; | ||
exports.SchemaTypes = index.SchemaTypes; | ||
exports.defaultContextSchema = defaultContextSchema.defaultContextSchema; | ||
exports.defaultInsertContextSchema = defaultInsertContextSchema.defaultInsertContextSchema; | ||
exports.certificateOfResidenceGH = GH.certificateOfResidenceGH; | ||
exports.ghanaDocuments = GH.ghanaDocuments; | ||
exports.getDocumentId = index.getDocumentId; | ||
exports.getDocumentsByCountry = index.getDocumentsByCountry; | ||
exports.getDocumentId = index$1.getDocumentId; | ||
exports.getDocumentsByCountry = index$1.getDocumentsByCountry; | ||
//# sourceMappingURL=index.js.map |
@@ -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 d?e:d,s=Object.create(o.prototype),a=new S(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 d(){}function m(){}function f(){}var l={};u(l,s,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(G([])));v&&v!==r&&n.call(v,s)&&(l=v);var b=f.prototype=d.prototype=Object.create(l);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 I()}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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(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:I}}function I(){return{value:void 0,done:!0}}return m.prototype=f,i(b,"constructor",{value:f,configurable:!0}),i(f,"constructor",{value:m,configurable:!0}),m.displayName=u(f,p,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,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,S.prototype={constructor:S,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(A),!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),A(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;A(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="^$|^GHA-\\d{9}-\\d{1}$",p="^[a-zA-Z0-9]*$",u={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:a},docNumber:{type:"string",pattern:p},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},y=[{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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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",required:["companyName","taxIdNumber","registrationNumber"],properties:{companyName:{type:"string"},taxIdNumber:{type:"string",pattern:p},registrationNumber:{type:"string",pattern:p},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"district_assembly_certificate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",required:["certificateNo","companyName"],properties:{certificateNo:{type:"string",pattern:p},registrationNumber:{type:"string",pattern:p},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",required:["registrationNumber","taxIdNumber"],properties:{registrationNumber:{type:"string",pattern:p},taxIdNumber:{type:"string",pattern:p}}}},{category:"proof_of_registration",type:"shareholder_details",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",required:["firstName","lastName"],properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}}],c={GH:y,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=u,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.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 c[t]||[]},t.ghanaDocuments=y,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.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.sleep=s,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 d?e:d,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 d(){}function m(){}function f(){}var l={};u(l,s,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(I([])));v&&v!==r&&n.call(v,s)&&(l=v);var b=f.prototype=d.prototype=Object.create(l);function N(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(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 O()}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 I(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:O}}function O(){return{value:void 0,done:!0}}return m.prototype=f,i(b,"constructor",{value:f,configurable:!0}),i(f,"constructor",{value:m,configurable:!0}),m.displayName=u(f,p,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,u(t,p,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},N(_.prototype),u(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new _(y(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},N(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=I,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:I(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)}))}}function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},i.apply(this,arguments)}var o=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)}}(),s=function(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t},a=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)}}(),p={DEFAULT:"default",INSERT:"insert"},u=[p.DEFAULT,p.INSERT],y={$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"]},c=i({},y,{properties:i({},y.properties,{documents:i({},y.properties.documents,{items:i({},y.properties.documents.items,{required:y.properties.documents.items.required.filter((function(t){return"type"!==t}))})})})}),g="^$|^GHA-\\d{9}-\\d{1}$",d="^[a-zA-Z0-9]*$",m={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:g},docNumber:{type:"string",pattern:d},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},f=[{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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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",required:["companyName","taxIdNumber","registrationNumber"],properties:{companyName:{type:"string"},taxIdNumber:{type:"string",pattern:d},registrationNumber:{type:"string",pattern:d},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"district_assembly_certificate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",required:["certificateNo","companyName"],properties:{certificateNo:{type:"string",pattern:d},registrationNumber:{type:"string",pattern:d},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",required:["registrationNumber","taxIdNumber"],properties:{registrationNumber:{type:"string",pattern:d},taxIdNumber:{type:"string",pattern:d}}}},{category:"proof_of_registration",type:"shareholder_details",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",required:["firstName","lastName"],properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}}],l={GH:f,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.SchemaType=p,t.SchemaTypes=u,t.certificateOfResidenceGH=m,t.defaultContextSchema=y,t.defaultInsertContextSchema=c,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 l[t]||[]},t.ghanaDocuments=f,t.handlePromise=o,t.isEmptyObject=function(t){return s(t)&&0===Object.keys(t).length},t.isErrorWithCode=function(t){return s(t)&&"code"in t&&"number"==typeof t.code},t.isErrorWithMessage=function(t){return s(t)&&"message"in t&&"string"==typeof t.message},t.isErrorWithName=function(t){return s(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=s,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.sleep=a,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 |
@@ -346,5 +346,20 @@ /** | ||
} | ||
function _extends() { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
exports.asyncToGenerator = _asyncToGenerator; | ||
exports["extends"] = _extends; | ||
exports.regeneratorRuntime = _regeneratorRuntime; | ||
//# sourceMappingURL=_rollupPluginBabelHelpers.js.map |
@@ -27,5 +27,7 @@ /** | ||
var zodErrorToReadable = require('./utils/zod-error-to-readable/zod-error-to-readable.js'); | ||
var index = require('./types/index.js'); | ||
var defaultContextSchema = require('./schemas/documents/default-context-schema.js'); | ||
var defaultInsertContextSchema = require('./schemas/documents/default-insert-context-schema.js'); | ||
var GH = require('./schemas/documents/workflow/documents/schemas/GH.js'); | ||
var index = require('./schemas/documents/workflow/documents/schemas/index.js'); | ||
var index$1 = require('./schemas/documents/workflow/documents/schemas/index.js'); | ||
@@ -46,7 +48,10 @@ | ||
exports.zodErrorToReadable = zodErrorToReadable.zodErrorToReadable; | ||
exports.SchemaType = index.SchemaType; | ||
exports.SchemaTypes = index.SchemaTypes; | ||
exports.defaultContextSchema = defaultContextSchema.defaultContextSchema; | ||
exports.defaultInsertContextSchema = defaultInsertContextSchema.defaultInsertContextSchema; | ||
exports.certificateOfResidenceGH = GH.certificateOfResidenceGH; | ||
exports.ghanaDocuments = GH.ghanaDocuments; | ||
exports.getDocumentId = index.getDocumentId; | ||
exports.getDocumentsByCountry = index.getDocumentsByCountry; | ||
exports.getDocumentId = index$1.getDocumentId; | ||
exports.getDocumentsByCountry = index$1.getDocumentsByCountry; | ||
//# sourceMappingURL=index.js.map |
@@ -342,4 +342,18 @@ /** | ||
} | ||
function _extends() { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
export { _asyncToGenerator as asyncToGenerator, _regeneratorRuntime as regeneratorRuntime }; | ||
export { _asyncToGenerator as asyncToGenerator, _extends as extends, _regeneratorRuntime as regeneratorRuntime }; | ||
//# sourceMappingURL=_rollupPluginBabelHelpers.js.map |
@@ -23,5 +23,7 @@ /** | ||
export { zodErrorToReadable } from './utils/zod-error-to-readable/zod-error-to-readable.js'; | ||
export { SchemaType, SchemaTypes } from './types/index.js'; | ||
export { defaultContextSchema } from './schemas/documents/default-context-schema.js'; | ||
export { defaultInsertContextSchema } from './schemas/documents/default-insert-context-schema.js'; | ||
export { certificateOfResidenceGH, ghanaDocuments } from './schemas/documents/workflow/documents/schemas/GH.js'; | ||
export { getDocumentId, getDocumentsByCountry } from './schemas/documents/workflow/documents/schemas/index.js'; | ||
//# sourceMappingURL=index.js.map |
@@ -53,2 +53,9 @@ /** | ||
declare const SchemaType: { | ||
readonly DEFAULT: "default"; | ||
readonly INSERT: "insert"; | ||
}; | ||
declare const SchemaTypes: readonly ["default", "insert"]; | ||
type TSchemaType = (typeof SchemaTypes)[number]; | ||
/** | ||
@@ -279,2 +286,172 @@ * This file was automatically generated by json-schema-to-typescript. | ||
declare const defaultInsertContextSchema: { | ||
properties: { | ||
documents: { | ||
items: { | ||
required: string[]; | ||
type: string; | ||
properties: { | ||
id: { | ||
type: string; | ||
}; | ||
category: { | ||
type: string; | ||
transform: string[]; | ||
}; | ||
type: { | ||
type: string; | ||
transform: string[]; | ||
}; | ||
issuer: { | ||
type: string; | ||
properties: { | ||
type: { | ||
type: string; | ||
}; | ||
name: { | ||
type: string; | ||
}; | ||
country: { | ||
type: string; | ||
transform: string[]; | ||
}; | ||
city: { | ||
type: string; | ||
}; | ||
additionalInfo: { | ||
type: string; | ||
}; | ||
}; | ||
required: string[]; | ||
additionalProperties: boolean; | ||
}; | ||
issuingVersion: { | ||
type: string; | ||
}; | ||
decision: { | ||
type: string; | ||
properties: { | ||
status: { | ||
type: string; | ||
enum: string[]; | ||
}; | ||
rejectionReason: { | ||
anyOf: ({ | ||
type: string; | ||
enum?: undefined; | ||
} | { | ||
type: string; | ||
enum: string[]; | ||
})[]; | ||
}; | ||
revisionReason: { | ||
anyOf: ({ | ||
type: string; | ||
enum?: undefined; | ||
} | { | ||
type: string; | ||
enum: string[]; | ||
})[]; | ||
}; | ||
}; | ||
additionalProperties: boolean; | ||
}; | ||
version: { | ||
type: string; | ||
}; | ||
pages: { | ||
type: string; | ||
items: { | ||
type: string; | ||
properties: { | ||
ballerineFileId: { | ||
type: string; | ||
}; | ||
provider: { | ||
type: string; | ||
enum: string[]; | ||
}; | ||
uri: { | ||
type: string; | ||
format: string; | ||
}; | ||
type: { | ||
enum: string[]; | ||
}; | ||
data: { | ||
type: string; | ||
}; | ||
metadata: { | ||
type: string; | ||
properties: { | ||
side: { | ||
type: string; | ||
}; | ||
pageNumber: { | ||
type: string; | ||
}; | ||
}; | ||
additionalProperties: boolean; | ||
}; | ||
}; | ||
required: string[]; | ||
additionalProperties: boolean; | ||
}; | ||
}; | ||
properties: { | ||
type: string; | ||
properties: { | ||
email: { | ||
type: string; | ||
format: string; | ||
}; | ||
expiryDate: { | ||
type: string; | ||
format: string; | ||
}; | ||
idNumber: { | ||
type: string; | ||
format: string; | ||
}; | ||
}; | ||
}; | ||
}; | ||
additionalProperties: boolean; | ||
}; | ||
type: string; | ||
}; | ||
entity: { | ||
type: string; | ||
properties: { | ||
type: { | ||
enum: string[]; | ||
}; | ||
data: { | ||
type: string; | ||
properties: { | ||
additionalInfo: { | ||
type: string; | ||
}; | ||
}; | ||
additionalProperties: boolean; | ||
}; | ||
ballerineEntityId: { | ||
type: string; | ||
}; | ||
id: { | ||
type: string; | ||
}; | ||
}; | ||
required: string[]; | ||
anyOf: { | ||
required: string[]; | ||
}[]; | ||
additionalProperties: boolean; | ||
}; | ||
}; | ||
$schema: string; | ||
type: string; | ||
required: string[]; | ||
}; | ||
type TDocument = Omit<DefaultContextSchema['documents'][number], 'pages' | 'properties'> & { | ||
@@ -290,2 +467,2 @@ propertiesSchema: any; | ||
export { AnyRecord, DefaultContextSchema, IErrorWithMessage, TDefaultSchemaDocumentPage, TDocument, certificateOfResidenceGH, defaultContextSchema, getDocumentId, getDocumentsByCountry, ghanaDocuments, handlePromise, isEmptyObject, isErrorWithCode, isErrorWithMessage, isErrorWithName, isFunction, isNullish, isObject, noNullish, sleep, uniqueArray, zodErrorToReadable }; | ||
export { AnyRecord, DefaultContextSchema, IErrorWithMessage, SchemaType, SchemaTypes, TDefaultSchemaDocumentPage, TDocument, TSchemaType, certificateOfResidenceGH, defaultContextSchema, defaultInsertContextSchema, getDocumentId, getDocumentsByCountry, ghanaDocuments, handlePromise, isEmptyObject, isErrorWithCode, isErrorWithMessage, isErrorWithName, isFunction, isNullish, isObject, noNullish, sleep, uniqueArray, zodErrorToReadable }; |
@@ -348,2 +348,16 @@ /** | ||
} | ||
function _extends() { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
@@ -452,2 +466,8 @@ var handlePromise = /*#__PURE__*/function () { | ||
var SchemaType = { | ||
DEFAULT: 'default', | ||
INSERT: 'insert' | ||
}; | ||
var SchemaTypes = [SchemaType.DEFAULT, SchemaType.INSERT]; | ||
var defaultContextSchema = { | ||
@@ -623,2 +643,14 @@ $schema: 'http://json-schema.org/draft-07/schema#', | ||
var defaultInsertContextSchema = _extends({}, defaultContextSchema, { | ||
properties: _extends({}, defaultContextSchema.properties, { | ||
documents: _extends({}, defaultContextSchema.properties.documents, { | ||
items: _extends({}, defaultContextSchema.properties.documents.items, { | ||
required: defaultContextSchema.properties.documents.items.required.filter(function (key) { | ||
return key !== 'type'; | ||
}) | ||
}) | ||
}) | ||
}) | ||
}); | ||
var ghNationalIdNumber = '^$|^GHA-\\d{9}-\\d{1}$'; | ||
@@ -1523,4 +1555,7 @@ var alphaNumeric = '^[a-zA-Z0-9]*$'; | ||
exports.SchemaType = SchemaType; | ||
exports.SchemaTypes = SchemaTypes; | ||
exports.certificateOfResidenceGH = certificateOfResidenceGH; | ||
exports.defaultContextSchema = defaultContextSchema; | ||
exports.defaultInsertContextSchema = defaultInsertContextSchema; | ||
exports.getDocumentId = getDocumentId; | ||
@@ -1527,0 +1562,0 @@ exports.getDocumentsByCountry = getDocumentsByCountry; |
@@ -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 d?e:d,s=Object.create(o.prototype),a=new S(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 d(){}function m(){}function f(){}var l={};u(l,s,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(G([])));v&&v!==r&&n.call(v,s)&&(l=v);var b=f.prototype=d.prototype=Object.create(l);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 I()}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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(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:I}}function I(){return{value:void 0,done:!0}}return m.prototype=f,i(b,"constructor",{value:f,configurable:!0}),i(f,"constructor",{value:m,configurable:!0}),m.displayName=u(f,p,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,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,S.prototype={constructor:S,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(A),!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),A(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;A(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="^$|^GHA-\\d{9}-\\d{1}$",p="^[a-zA-Z0-9]*$",u={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:a},docNumber:{type:"string",pattern:p},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},y=[{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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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:a},docNumber:{type:"string",pattern:p},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",required:["companyName","taxIdNumber","registrationNumber"],properties:{companyName:{type:"string"},taxIdNumber:{type:"string",pattern:p},registrationNumber:{type:"string",pattern:p},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"district_assembly_certificate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",required:["certificateNo","companyName"],properties:{certificateNo:{type:"string",pattern:p},registrationNumber:{type:"string",pattern:p},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",required:["registrationNumber","taxIdNumber"],properties:{registrationNumber:{type:"string",pattern:p},taxIdNumber:{type:"string",pattern:p}}}},{category:"proof_of_registration",type:"shareholder_details",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",required:["firstName","lastName"],properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}}],c={GH:y,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=u,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.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 c[t]||[]},t.ghanaDocuments=y,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.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.sleep=s,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 d?e:d,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 d(){}function m(){}function f(){}var l={};u(l,s,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(I([])));v&&v!==r&&n.call(v,s)&&(l=v);var b=f.prototype=d.prototype=Object.create(l);function N(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(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 O()}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 I(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:O}}function O(){return{value:void 0,done:!0}}return m.prototype=f,i(b,"constructor",{value:f,configurable:!0}),i(f,"constructor",{value:m,configurable:!0}),m.displayName=u(f,p,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,u(t,p,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},N(_.prototype),u(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new _(y(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},N(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=I,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:I(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)}))}}function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},i.apply(this,arguments)}var o=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)}}(),s=function(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t},a=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)}}(),p={DEFAULT:"default",INSERT:"insert"},u=[p.DEFAULT,p.INSERT],y={$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"]},c=i({},y,{properties:i({},y.properties,{documents:i({},y.properties.documents,{items:i({},y.properties.documents.items,{required:y.properties.documents.items.required.filter((function(t){return"type"!==t}))})})})}),g="^$|^GHA-\\d{9}-\\d{1}$",d="^[a-zA-Z0-9]*$",m={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:g},docNumber:{type:"string",pattern:d},userAddress:{type:"string"},physicalAddress:{type:"string"},amountDue:{type:"number"},issuingDate:{type:"string",format:"date"}}}},f=[{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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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:g},docNumber:{type:"string",pattern:d},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",required:["companyName","taxIdNumber","registrationNumber"],properties:{companyName:{type:"string"},taxIdNumber:{type:"string",pattern:d},registrationNumber:{type:"string",pattern:d},issuingDate:{type:"string",format:"date"}}}},{category:"proof_of_registration",type:"district_assembly_certificate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",required:["certificateNo","companyName"],properties:{certificateNo:{type:"string",pattern:d},registrationNumber:{type:"string",pattern:d},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",required:["registrationNumber","taxIdNumber"],properties:{registrationNumber:{type:"string",pattern:d},taxIdNumber:{type:"string",pattern:d}}}},{category:"proof_of_registration",type:"shareholder_details",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",required:["firstName","lastName"],properties:{firstName:{type:"string"},middleName:{type:"string"},lastName:{type:"string"}}}}],l={GH:f,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.SchemaType=p,t.SchemaTypes=u,t.certificateOfResidenceGH=m,t.defaultContextSchema=y,t.defaultInsertContextSchema=c,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 l[t]||[]},t.ghanaDocuments=f,t.handlePromise=o,t.isEmptyObject=function(t){return s(t)&&0===Object.keys(t).length},t.isErrorWithCode=function(t){return s(t)&&"code"in t&&"number"==typeof t.code},t.isErrorWithMessage=function(t){return s(t)&&"message"in t&&"string"==typeof t.message},t.isErrorWithName=function(t){return s(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=s,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.sleep=a,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.20", | ||
"version": "0.5.21", | ||
"description": "common", | ||
@@ -8,0 +8,0 @@ "module": "./dist/esm/index.js", |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
575982
123
6185