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

@ballerine/common

Package Overview
Dependencies
Maintainers
3
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ballerine/common - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

dist/cjs/schemas/documents/workflow/documents/schemas/UG.js

3

./dist/cjs/index.js

@@ -46,6 +46,5 @@ /**

exports.defaultContextSchema = defaultContextSchema.defaultContextSchema;
exports.certificateOfResidenceGH = GH.certificateOfResidenceGH;
exports.ghanaDocuments = GH.ghanaDocuments;
exports.getGhanaDocuments = GH.getGhanaDocuments;
exports.getDocumentId = index.getDocumentId;
exports.getDocumentsByCountry = index.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 l(){}var f={};u(f,s,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(G([])));v&&v!==r&&n.call(v,s)&&(f=v);var b=l.prototype=d.prototype=Object.create(f);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(i,o,s,a){var p=c(t[i],t,o);if("throw"!==p.type){var u=p.arg,y=u.value;return y&&"object"==typeof y&&n.call(y,"__await")?e.resolve(y.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(y).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,a)}))}a(p.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function w(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return 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=l,i(b,"constructor",{value:l,configurable:!0}),i(l,"constructor",{value:m,configurable:!0}),m.displayName=u(l,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,l):(t.__proto__=l,u(t,p,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},_(N.prototype),u(N.prototype,a,(function(){return this})),t.AsyncIterator=N,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new N(y(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(b),u(b,p,"Generator"),u(b,s,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=G,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",required:["msisdn","accountHolderName"],properties:{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"},salaryAmount:{type:"number"}}}},{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_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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WorkflowCore={})}(this,(function(e){"use strict";function t(){t=function(){return e};var e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(e){p=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,s=Object.create(o.prototype),a=new x(n||[]);return i(s,"_invoke",{value:O(e,r,a)}),s}function y(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l={};function d(){}function f(){}function m(){}var T={};p(T,s,(function(){return this}));var g=Object.getPrototypeOf,h=g&&g(g(j([])));h&&h!==r&&n.call(h,s)&&(T=h);var b=m.prototype=d.prototype=Object.create(T);function v(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function r(i,o,s,a){var u=y(e[i],e,o);if("throw"!==u.type){var p=u.arg,c=p.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(c).then((function(e){p.value=e,s(p)}),(function(e){return r("throw",e,s,a)}))}a(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function O(e,t,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 w()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=I(s,r);if(a){if(a===l)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 u=y(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function I(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,I(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var i=y(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,l;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function U(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function j(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:w}}function w(){return{value:void 0,done:!0}}return f.prototype=m,i(b,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:f,configurable:!0}),f.displayName=p(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,p(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},v(N.prototype),p(N.prototype,a,(function(){return this})),e.AsyncIterator=N,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new N(c(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},v(b),p(b,u,"Generator"),p(b,s,(function(){return this})),p(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=j,x.prototype={constructor:x,reset:function(e){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(U),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return s.type="throw",s.arg=e,t.next=r,n&&(t.method="next",t.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"),u=n.call(o,"finallyLoc");if(a&&u){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(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),U(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;U(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}function r(e,t,r,n,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,i)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var s=e.apply(t,n);function a(e){r(s,i,o,a,u,"next",e)}function u(e){r(s,i,o,a,u,"throw",e)}a(void 0)}))}}var i=function(){var e=n(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r;case 3:return n=e.sent,e.abrupt("return",[n,void 0]);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",[void 0,e.t0]);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),o=function(e){return!Array.isArray(e)&&null!==e&&"object"==typeof e},s=function(){var e=n(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){return setTimeout(e,r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a={};!function(e){var t,r,n,i,o,s,a,u,p,c,y,l,d,f,m,T,g,h,b,v;Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.JsonType=e.JavaScriptTypeBuilder=e.JsonTypeBuilder=e.TypeBuilder=e.TypeBuilderError=e.TransformEncodeBuilder=e.TransformDecodeBuilder=e.TemplateLiteralDslParser=e.TemplateLiteralGenerator=e.TemplateLiteralGeneratorError=e.TemplateLiteralFinite=e.TemplateLiteralFiniteError=e.TemplateLiteralParser=e.TemplateLiteralParserError=e.TemplateLiteralResolver=e.TemplateLiteralPattern=e.TemplateLiteralPatternError=e.UnionResolver=e.KeyArrayResolver=e.KeyArrayResolverError=e.KeyResolver=e.ObjectMap=e.Intrinsic=e.IndexedAccessor=e.TypeClone=e.TypeExtends=e.TypeExtendsResult=e.TypeExtendsError=e.ExtendsUndefined=e.TypeGuard=e.TypeGuardUnknownTypeError=e.ValueGuard=e.FormatRegistry=e.TypeBoxError=e.TypeRegistry=e.PatternStringExact=e.PatternNumberExact=e.PatternBooleanExact=e.PatternString=e.PatternNumber=e.PatternBoolean=e.Kind=e.Hint=e.Optional=e.Readonly=e.Transform=void 0,e.Transform=Symbol.for("TypeBox.Transform"),e.Readonly=Symbol.for("TypeBox.Readonly"),e.Optional=Symbol.for("TypeBox.Optional"),e.Hint=Symbol.for("TypeBox.Hint"),e.Kind=Symbol.for("TypeBox.Kind"),e.PatternBoolean="(true|false)",e.PatternNumber="(0|[1-9][0-9]*)",e.PatternString="(.*)",e.PatternBooleanExact=`^${e.PatternBoolean}$`,e.PatternNumberExact=`^${e.PatternNumber}$`,e.PatternStringExact=`^${e.PatternString}$`,function(e){const t=new Map;e.Entries=function(){return new Map(t)},e.Clear=function(){return t.clear()},e.Delete=function(e){return t.delete(e)},e.Has=function(e){return t.has(e)},e.Set=function(e,r){t.set(e,r)},e.Get=function(e){return t.get(e)}}(t||(e.TypeRegistry=t={}));class N extends Error{constructor(e){super(e)}}e.TypeBoxError=N,function(e){const t=new Map;e.Entries=function(){return new Map(t)},e.Clear=function(){return t.clear()},e.Delete=function(e){return t.delete(e)},e.Has=function(e){return t.has(e)},e.Set=function(e,r){t.set(e,r)},e.Get=function(e){return t.get(e)}}(r||(e.FormatRegistry=r={})),function(e){e.IsArray=function(e){return Array.isArray(e)},e.IsBigInt=function(e){return"bigint"==typeof e},e.IsBoolean=function(e){return"boolean"==typeof e},e.IsNull=function(e){return null===e},e.IsNumber=function(e){return"number"==typeof e},e.IsObject=function(e){return"object"==typeof e&&null!==e},e.IsString=function(e){return"string"==typeof e},e.IsUndefined=function(e){return void 0===e}}(n||(e.ValueGuard=n={}));e.TypeGuardUnknownTypeError=class extends N{},function(r){function i(e){try{return new RegExp(e),!0}catch{return!1}}function o(e){if(!n.IsString(e))return!1;for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r>=7&&r<=13||27===r||127===r)return!1}return!0}function s(e){return p(e)||J(e)}function a(e){return n.IsUndefined(e)||n.IsBigInt(e)}function u(e){return n.IsUndefined(e)||n.IsNumber(e)}function p(e){return n.IsUndefined(e)||n.IsBoolean(e)}function c(e){return n.IsUndefined(e)||n.IsString(e)}function y(e){return n.IsUndefined(e)||J(e)}function l(e){return I(e,"Any")&&c(e.$id)}function d(e){return I(e,"Array")&&"array"===e.type&&c(e.$id)&&J(e.items)&&u(e.minItems)&&u(e.maxItems)&&p(e.uniqueItems)&&y(e.contains)&&u(e.minContains)&&u(e.maxContains)}function f(e){return I(e,"AsyncIterator")&&"AsyncIterator"===e.type&&c(e.$id)&&J(e.items)}function m(e){return I(e,"BigInt")&&"bigint"===e.type&&c(e.$id)&&a(e.exclusiveMaximum)&&a(e.exclusiveMinimum)&&a(e.maximum)&&a(e.minimum)&&a(e.multipleOf)}function T(e){return I(e,"Boolean")&&"boolean"===e.type&&c(e.$id)}function g(e){return I(e,"Constructor")&&"Constructor"===e.type&&c(e.$id)&&n.IsArray(e.parameters)&&e.parameters.every((e=>J(e)))&&J(e.returns)}function h(e){return I(e,"Date")&&"Date"===e.type&&c(e.$id)&&u(e.exclusiveMaximumTimestamp)&&u(e.exclusiveMinimumTimestamp)&&u(e.maximumTimestamp)&&u(e.minimumTimestamp)&&u(e.multipleOfTimestamp)}function b(e){return I(e,"Function")&&"Function"===e.type&&c(e.$id)&&n.IsArray(e.parameters)&&e.parameters.every((e=>J(e)))&&J(e.returns)}function v(e){return I(e,"Integer")&&"integer"===e.type&&c(e.$id)&&u(e.exclusiveMaximum)&&u(e.exclusiveMinimum)&&u(e.maximum)&&u(e.minimum)&&u(e.multipleOf)}function N(e){return I(e,"Intersect")&&(!n.IsString(e.type)||"object"===e.type)&&n.IsArray(e.allOf)&&e.allOf.every((e=>J(e)&&!$(e)))&&c(e.type)&&(p(e.unevaluatedProperties)||y(e.unevaluatedProperties))&&c(e.$id)}function O(e){return I(e,"Iterator")&&"Iterator"===e.type&&c(e.$id)&&J(e.items)}function I(t,r){return S(t)&&t[e.Kind]===r}function S(t){return n.IsObject(t)&&e.Kind in t&&n.IsString(t[e.Kind])}function U(e){return j(e)&&n.IsString(e.const)}function x(e){return j(e)&&n.IsNumber(e.const)}function j(e){return I(e,"Literal")&&c(e.$id)&&(n.IsBoolean(e.const)||n.IsNumber(e.const)||n.IsString(e.const))}function w(e){return I(e,"Never")&&n.IsObject(e.not)&&0===Object.getOwnPropertyNames(e.not).length}function L(e){return I(e,"Not")&&J(e.not)}function P(e){return I(e,"Null")&&"null"===e.type&&c(e.$id)}function _(e){return I(e,"Number")&&"number"===e.type&&c(e.$id)&&u(e.exclusiveMaximum)&&u(e.exclusiveMinimum)&&u(e.maximum)&&u(e.minimum)&&u(e.multipleOf)}function A(e){return I(e,"Object")&&"object"===e.type&&c(e.$id)&&n.IsObject(e.properties)&&s(e.additionalProperties)&&u(e.minProperties)&&u(e.maxProperties)&&Object.entries(e.properties).every((([e,t])=>o(e)&&J(t)))}function B(e){return I(e,"Promise")&&"Promise"===e.type&&c(e.$id)&&J(e.item)}function E(e){return I(e,"Record")&&"object"===e.type&&c(e.$id)&&s(e.additionalProperties)&&n.IsObject(e.patternProperties)&&(e=>{const t=Object.getOwnPropertyNames(e.patternProperties);return 1===t.length&&i(t[0])&&n.IsObject(e.patternProperties)&&J(e.patternProperties[t[0]])})(e)}function R(e){return I(e,"Ref")&&c(e.$id)&&n.IsString(e.$ref)}function C(e){return I(e,"String")&&"string"===e.type&&c(e.$id)&&u(e.minLength)&&u(e.maxLength)&&(t=e.pattern,n.IsUndefined(t)||n.IsString(t)&&o(t)&&i(t))&&function(e){return n.IsUndefined(e)||n.IsString(e)&&o(e)}(e.format);var t}function k(e){return I(e,"Symbol")&&"symbol"===e.type&&c(e.$id)}function F(e){return I(e,"TemplateLiteral")&&"string"===e.type&&n.IsString(e.pattern)&&"^"===e.pattern[0]&&"$"===e.pattern[e.pattern.length-1]}function G(e){return I(e,"This")&&c(e.$id)&&n.IsString(e.$ref)}function $(t){return n.IsObject(t)&&e.Transform in t}function K(e){return I(e,"Tuple")&&"array"===e.type&&c(e.$id)&&n.IsNumber(e.minItems)&&n.IsNumber(e.maxItems)&&e.minItems===e.maxItems&&(n.IsUndefined(e.items)&&n.IsUndefined(e.additionalItems)&&0===e.minItems||n.IsArray(e.items)&&e.items.every((e=>J(e))))}function D(e){return I(e,"Undefined")&&"undefined"===e.type&&c(e.$id)}function V(e){return I(e,"Union")&&c(e.$id)&&n.IsObject(e)&&n.IsArray(e.anyOf)&&e.anyOf.every((e=>J(e)))}function H(e){return I(e,"Uint8Array")&&"Uint8Array"===e.type&&c(e.$id)&&u(e.minByteLength)&&u(e.maxByteLength)}function M(e){return I(e,"Unknown")&&c(e.$id)}function q(e){return I(e,"Unsafe")}function z(e){return I(e,"Void")&&"void"===e.type&&c(e.$id)}function J(r){return n.IsObject(r)&&(l(r)||d(r)||T(r)||m(r)||f(r)||g(r)||h(r)||b(r)||v(r)||N(r)||O(r)||j(r)||w(r)||L(r)||P(r)||_(r)||A(r)||B(r)||E(r)||R(r)||C(r)||k(r)||F(r)||G(r)||K(r)||D(r)||V(r)||H(r)||M(r)||q(r)||z(r)||S(r)&&t.Has(r[e.Kind]))}r.TAny=l,r.TArray=d,r.TAsyncIterator=f,r.TBigInt=m,r.TBoolean=T,r.TConstructor=g,r.TDate=h,r.TFunction=b,r.TInteger=v,r.TIntersect=N,r.TIterator=O,r.TKindOf=I,r.TKind=S,r.TLiteralString=U,r.TLiteralNumber=x,r.TLiteralBoolean=function(e){return j(e)&&n.IsBoolean(e.const)},r.TLiteral=j,r.TNever=w,r.TNot=L,r.TNull=P,r.TNumber=_,r.TObject=A,r.TPromise=B,r.TRecord=E,r.TRecursive=function(t){return n.IsObject(t)&&e.Hint in t&&"Recursive"===t[e.Hint]},r.TRef=R,r.TString=C,r.TSymbol=k,r.TTemplateLiteral=F,r.TThis=G,r.TTransform=$,r.TTuple=K,r.TUndefined=D,r.TUnionLiteral=function(e){return V(e)&&e.anyOf.every((e=>U(e)||x(e)))},r.TUnion=V,r.TUint8Array=H,r.TUnknown=M,r.TUnsafe=q,r.TVoid=z,r.TReadonly=function(t){return n.IsObject(t)&&"Readonly"===t[e.Readonly]},r.TOptional=function(t){return n.IsObject(t)&&"Optional"===t[e.Optional]},r.TSchema=J}(i||(e.TypeGuard=i={})),function(t){t.Check=function t(r){return"Intersect"===r[e.Kind]?r.allOf.every((e=>t(e))):"Union"===r[e.Kind]?r.anyOf.some((e=>t(e))):"Undefined"===r[e.Kind]||"Not"===r[e.Kind]&&!t(r.not)}}(o||(e.ExtendsUndefined=o={}));class O extends N{}e.TypeExtendsError=O,function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"}(s||(e.TypeExtendsResult=s={})),function(t){function r(e){return e===s.False?e:s.True}function o(e){throw new O(e)}function a(e){return i.TNever(e)||i.TIntersect(e)||i.TUnion(e)||i.TUnknown(e)||i.TAny(e)}function u(e,t){return i.TNever(t)?d():i.TIntersect(t)?l(e,t):i.TUnion(t)?B(e,t):i.TUnknown(t)?E():i.TAny(t)?p():o("StructuralRight")}function p(e,t){return s.True}function c(e,t){return i.TLiteral(e)&&n.IsBoolean(e.const)||i.TBoolean(e)?s.True:s.False}function y(e,t){return i.TLiteral(e)&&n.IsNumber(e.const)||i.TNumber(e)||i.TInteger(e)?s.True:s.False}function l(e,t){return t.allOf.every((t=>C(e,t)===s.True))?s.True:s.False}function d(e,t){return s.False}function f(t){let[r,n]=[t,0];for(;i.TNot(r);)r=r.not,n+=1;return n%2==0?r:e.Type.Unknown()}function m(e,t){return i.TLiteralNumber(e)||i.TNumber(e)||i.TInteger(e)?s.True:s.False}function g(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function h(e){return I(e)}function b(e){return g(e,0)||g(e,1)&&"description"in e.properties&&i.TUnion(e.properties.description)&&2===e.properties.description.anyOf.length&&(i.TString(e.properties.description.anyOf[0])&&i.TUndefined(e.properties.description.anyOf[1])||i.TString(e.properties.description.anyOf[1])&&i.TUndefined(e.properties.description.anyOf[0]))}function v(e){return g(e,0)}function N(e){return g(e,0)}function I(t){const n=e.Type.Number();return g(t,0)||g(t,1)&&"length"in t.properties&&r(C(t.properties.length,n))===s.True}function S(e,t){return C(e,t)===s.False||i.TOptional(e)&&!i.TOptional(t)?s.False:s.True}function U(t,n){return i.TUnknown(t)?s.False:i.TAny(t)?s.Union:i.TNever(t)||i.TLiteralString(t)&&h(n)||i.TLiteralNumber(t)&&v(n)||i.TLiteralBoolean(t)&&N(n)||i.TSymbol(t)&&b(n)||i.TBigInt(t)&&g(n,0)||i.TString(t)&&h(n)||i.TSymbol(t)&&b(n)||i.TNumber(t)&&v(n)||i.TInteger(t)&&v(n)||i.TBoolean(t)&&N(n)||i.TUint8Array(t)&&function(e){return I(e)}(n)||i.TDate(t)&&function(e){return g(e,0)}(n)||i.TConstructor(t)&&function(e){return g(e,0)}(n)||i.TFunction(t)&&function(t){const n=e.Type.Number();return g(t,0)||g(t,1)&&"length"in t.properties&&r(C(t.properties.length,n))===s.True}(n)?s.True:i.TRecord(t)&&i.TString(j(t))?"Record"===n[e.Hint]?s.True:s.False:i.TRecord(t)&&i.TNumber(j(t))&&g(n,0)?s.True:s.False}function x(t,n){return a(n)?u(t,n):i.TObject(n)&&function(t){const n=e.Type.Function([e.Type.Any()],e.Type.Any());return g(t,0)||g(t,1)&&"then"in t.properties&&r(C(t.properties.then,n))===s.True}(n)?s.True:i.TPromise(n)?r(C(t.item,n.item)):s.False}function j(t){return e.PatternNumberExact in t.patternProperties?e.Type.Number():e.PatternStringExact in t.patternProperties?e.Type.String():o("Unknown record key pattern")}function w(t){return e.PatternNumberExact in t.patternProperties?t.patternProperties[e.PatternNumberExact]:e.PatternStringExact in t.patternProperties?t.patternProperties[e.PatternStringExact]:o("Unable to get record value schema")}function L(e,t){const[n,o]=[j(t),w(t)];return i.TLiteralString(e)&&i.TNumber(n)&&r(C(e,o))===s.True?s.True:i.TUint8Array(e)&&i.TNumber(n)||i.TString(e)&&i.TNumber(n)||i.TArray(e)&&i.TNumber(n)?C(e,o):i.TObject(e)?(()=>{for(const t of Object.getOwnPropertyNames(e.properties))if(S(o,e.properties[t])===s.False)return s.False;return s.True})():s.False}function P(e,t){return i.TLiteral(e)&&n.IsString(e.const)||i.TString(e)?s.True:s.False}function _(e,t){return a(t)?u(e,t):i.TObject(t)&&I(t)||i.TArray(t)&&function(e,t){return i.TArray(t)&&void 0!==e.items&&e.items.every((e=>C(e,t.items)===s.True))}(e,t)?s.True:i.TTuple(t)?n.IsUndefined(e.items)&&!n.IsUndefined(t.items)||!n.IsUndefined(e.items)&&n.IsUndefined(t.items)?s.False:n.IsUndefined(e.items)&&!n.IsUndefined(t.items)||e.items.every(((e,r)=>C(e,t.items[r])===s.True))?s.True:s.False:s.False}function A(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TVoid(t)?function(e,t){return i.TUndefined(e)||i.TUndefined(e)?s.True:s.False}(e):i.TUndefined(t)?s.True:s.False}function B(e,t){return t.anyOf.some((t=>C(e,t)===s.True))?s.True:s.False}function E(e,t){return s.True}function R(e,t){return i.TNever(t)?d():i.TIntersect(t)?l(e,t):i.TUnion(t)?B(e,t):i.TAny(t)?p():i.TString(t)?P(e):i.TNumber(t)?m(e):i.TInteger(t)?y(e):i.TBoolean(t)?c(e):i.TArray(t)?function(e,t){return i.TUnknown(e)?s.False:i.TAny(e)?s.Union:i.TNever(e)?s.True:s.False}(e):i.TTuple(t)?function(e,t){return i.TNever(e)?s.True:i.TUnknown(e)?s.False:i.TAny(e)?s.Union:s.False}(e):i.TObject(t)?U(e,t):i.TUnknown(t)?s.True:s.False}function C(t,n){return i.TTemplateLiteral(t)||i.TTemplateLiteral(n)?function(e,t){return i.TTemplateLiteral(e)?C(T.Resolve(e),t):i.TTemplateLiteral(t)?C(e,T.Resolve(t)):o("Invalid fallthrough for TemplateLiteral")}(t,n):i.TNot(t)||i.TNot(n)?function(e,t){return i.TNot(e)?C(f(e),t):i.TNot(t)?C(e,f(t)):o("Invalid fallthrough for Not")}(t,n):i.TAny(t)?function(e,t){return i.TIntersect(t)?l(e,t):i.TUnion(t)&&t.anyOf.some((e=>i.TAny(e)||i.TUnknown(e)))?s.True:i.TUnion(t)?s.Union:i.TUnknown(t)||i.TAny(t)?s.True:s.Union}(t,n):i.TArray(t)?function(e,t){return i.TObject(t)&&I(t)?s.True:a(t)?u(e,t):i.TArray(t)?r(C(e.items,t.items)):s.False}(t,n):i.TBigInt(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TBigInt(t)?s.True:s.False}(t,n):i.TBoolean(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TBoolean(t)?s.True:s.False}(t,n):i.TAsyncIterator(t)?function(e,t){return a(t)?u(e,t):i.TAsyncIterator(t)?r(C(e.items,t.items)):s.False}(t,n):i.TConstructor(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TConstructor(t)?e.parameters.length>t.parameters.length?s.False:e.parameters.every(((e,n)=>r(C(t.parameters[n],e))===s.True))?r(C(e.returns,t.returns)):s.False:s.False}(t,n):i.TDate(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TDate(t)?s.True:s.False}(t,n):i.TFunction(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TFunction(t)?e.parameters.length>t.parameters.length?s.False:e.parameters.every(((e,n)=>r(C(t.parameters[n],e))===s.True))?r(C(e.returns,t.returns)):s.False:s.False}(t,n):i.TInteger(t)?function(e,t){return i.TInteger(t)||i.TNumber(t)?s.True:a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):s.False}(t,n):i.TIntersect(t)?function(e,t){return e.allOf.some((e=>C(e,t)===s.True))?s.True:s.False}(t,n):i.TIterator(t)?function(e,t){return a(t)?u(e,t):i.TIterator(t)?r(C(e.items,t.items)):s.False}(t,n):i.TLiteral(t)?function(e,t){return i.TLiteral(t)&&t.const===e.const?s.True:a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TString(t)?P(e):i.TNumber(t)?m(e):i.TInteger(t)?y(e):i.TBoolean(t)?c(e):s.False}(t,n):i.TNever(t)?s.True:i.TNull(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TNull(t)?s.True:s.False}(t,n):i.TNumber(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TInteger(t)||i.TNumber(t)?s.True:s.False}(t,n):i.TObject(t)?function(e,t){return a(t)?u(e,t):i.TRecord(t)?L(e,t):i.TObject(t)?(()=>{for(const r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties))return s.False;if(S(e.properties[r],t.properties[r])===s.False)return s.False}return s.True})():s.False}(t,n):i.TRecord(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?C(w(e),w(t)):s.False}(t,n):i.TString(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TString(t)?s.True:s.False}(t,n):i.TSymbol(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TSymbol(t)?s.True:s.False}(t,n):i.TTuple(t)?_(t,n):i.TPromise(t)?x(t,n):i.TUint8Array(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TUint8Array(t)?s.True:s.False}(t,n):i.TUndefined(t)?A(t,n):i.TUnion(t)?function(e,t){return e.anyOf.every((e=>C(e,t)===s.True))?s.True:s.False}(t,n):i.TUnknown(t)?R(t,n):i.TVoid(t)?function(e,t){return i.TIntersect(t)?l(e,t):i.TUnion(t)?B(e,t):i.TUnknown(t)?E():i.TAny(t)?p():i.TObject(t)?U(e,t):i.TVoid(t)?s.True:s.False}(t,n):o(`Unknown left type operand '${t[e.Kind]}'`)}t.Extends=function(e,t){return C(e,t)}}(a||(e.TypeExtends=a={})),function(e){function t(e){return n.IsArray(e)?function(e){return e.map((e=>t(e)))}(e):n.IsObject(e)?function(e){return{...Object.getOwnPropertyNames(e).reduce(((r,n)=>({...r,[n]:t(e[n])})),{}),...Object.getOwnPropertySymbols(e).reduce(((r,n)=>({...r,[n]:t(e[n])})),{})}}(e):e}function r(e,r={}){return{...t(e),...r}}e.Rest=function(e){return e.map((e=>r(e)))},e.Type=r}(u||(e.TypeClone=u={})),function(t){function r(t){return t.map((t=>{const{[e.Optional]:r,...n}=u.Type(t);return n}))}function o(t){return function(e){return e.every((e=>i.TOptional(e)))}(t.allOf)?e.Type.Optional(e.Type.Intersect(r(t.allOf))):t}function s(t){return function(e){return e.some((e=>i.TOptional(e)))}(t.anyOf)?e.Type.Optional(e.Type.Union(r(t.anyOf))):t}function a(t){return"Intersect"===t[e.Kind]?o(t):"Union"===t[e.Kind]?s(t):t}function p(t,r){return"Intersect"===t[e.Kind]?function(t,r){const n=t.allOf.reduce(((t,n)=>{const i=p(n,r);return"Never"===i[e.Kind]?t:[...t,i]}),[]);return a(e.Type.Intersect(n))}(t,r):"Union"===t[e.Kind]?function(t,r){const n=t.anyOf.map((e=>p(e,r)));return a(e.Type.Union(n))}(t,r):"Object"===t[e.Kind]?function(t,r){const i=t.properties[r];return n.IsUndefined(i)?e.Type.Never():e.Type.Union([i])}(t,r):"Tuple"===t[e.Kind]?function(t,r){const i=t.items;if(n.IsUndefined(i))return e.Type.Never();const o=i[r];return n.IsUndefined(o)?e.Type.Never():o}(t,r):e.Type.Never()}t.Resolve=function(t,r,n={}){const i=r.map((e=>p(t,e.toString())));return a(e.Type.Union(i,n))}}(p||(e.IndexedAccessor=p={})),function(t){function r(e,t){return"string"==typeof e?"Uncapitalize"===t?function(e){const[t,r]=[e.slice(0,1),e.slice(1)];return`${t.toLowerCase()}${r}`}(e):"Capitalize"===t?function(e){const[t,r]=[e.slice(0,1),e.slice(1)];return`${t.toUpperCase()}${r}`}(e):"Uppercase"===t?function(e){return e.toUpperCase()}(e):"Lowercase"===t?function(e){return e.toLowerCase()}(e):e:e.toString()}function n(e,t){if(0===e.length)return[];const[r,...i]=e;return[s(r,t),...n(i,t)]}function o(t,o){return i.TTemplateLiteral(t)?function(t,i){const o=g.ParseExact(t.pattern);if(!h.Check(o))return{...t,pattern:r(t.pattern,i)};const s=n([...b.Generate(o)].map((t=>e.Type.Literal(t))),i),a=e.Type.Union(s);return e.Type.TemplateLiteral([a])}(t,o):i.TUnion(t)?e.Type.Union(n(t.anyOf,o)):i.TLiteral(t)?e.Type.Literal(r(t.const,o)):t}function s(e,t){return o(e,t)}t.Map=s}(c||(e.Intrinsic=c={})),function(t){function r(t,n){return"Intersect"===t[e.Kind]?function(t,n){return e.Type.Intersect(t.allOf.map((e=>r(e,n))),{...t})}(t,n):"Union"===t[e.Kind]?function(t,n){return e.Type.Union(t.anyOf.map((e=>r(e,n))),{...t})}(t,n):"Object"===t[e.Kind]?function(e,t){return t(e)}(t,n):t}t.Map=function(e,t,n){return{...r(u.Type(e),t),...n}}}(y||(e.ObjectMap=y={})),function(e){function t(e,r){return i.TIntersect(e)?function(e,r){return e.allOf.reduce(((e,n)=>[...e,...t(n,r)]),[])}(e,r):i.TUnion(e)?function(e,r){const n=e.anyOf.map((e=>t(e,r)));return[...n.reduce(((e,t)=>t.map((t=>n.every((e=>e.includes(t)))?e.add(t):e))[0]),new Set)]}(e,r):i.TObject(e)?function(e,t){return Object.getOwnPropertyNames(e.properties)}(e):i.TRecord(e)?function(e,t){return t.includePatterns?Object.getOwnPropertyNames(e.patternProperties):[]}(e,r):[]}function r(e,r){return[...new Set(t(e,r))]}e.ResolveKeys=r,e.ResolvePattern=function(e){return`^(${r(e,{includePatterns:!0}).map((e=>`(${function(e){return"^"===e[0]&&"$"===e[e.length-1]?e.slice(1,e.length-1):e}(e)})`)).join("|")})$`}}(l||(e.KeyResolver=l={}));class I extends N{}e.KeyArrayResolverError=I,function(e){e.Resolve=function(e){return Array.isArray(e)?e:i.TUnionLiteral(e)?e.anyOf.map((e=>e.const.toString())):i.TLiteral(e)?[e.const]:i.TTemplateLiteral(e)?(()=>{const t=g.ParseExact(e.pattern);if(!h.Check(t))throw new I("Cannot resolve keys from infinite template expression");return[...b.Generate(t)]})():[]}}(d||(e.KeyArrayResolver=d={})),function(t){function*r(t){for(const n of t.anyOf)"Union"===n[e.Kind]?yield*r(n):yield n}t.Resolve=function(t){return e.Type.Union([...r(t)],{...t})}}(f||(e.UnionResolver=f={}));class S extends N{}e.TemplateLiteralPatternError=S,function(t){function r(t,n){return i.TTemplateLiteral(t)?t.pattern.slice(1,t.pattern.length-1):i.TUnion(t)?`(${t.anyOf.map((e=>r(e,n))).join("|")})`:i.TNumber(t)||i.TInteger(t)||i.TBigInt(t)?`${n}${e.PatternNumber}`:i.TString(t)?`${n}${e.PatternString}`:i.TLiteral(t)?`${n}${o=t.const.toString(),o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`:i.TBoolean(t)?`${n}${e.PatternBoolean}`:function(e){throw new S(e)}(`Unexpected Kind '${t[e.Kind]}'`);var o}t.Create=function(e){return`^${e.map((e=>r(e,""))).join("")}$`}}(m||(e.TemplateLiteralPattern=m={})),function(t){t.Resolve=function(t){const r=g.ParseExact(t.pattern);if(!h.Check(r))return e.Type.String();const n=[...b.Generate(r)].map((t=>e.Type.Literal(t)));return e.Type.Union(n)}}(T||(e.TemplateLiteralResolver=T={}));class U extends N{}e.TemplateLiteralParserError=U,function(e){function t(e,t,r){return e[t]===r&&92!==e.charCodeAt(t-1)}function r(e,r){return t(e,r,"(")}function n(e,r){return t(e,r,")")}function i(e,r){return t(e,r,"|")}function o(e){return function(e){if(!r(e,0)||!n(e,e.length-1))return!1;let t=0;for(let i=0;i<e.length;i++)if(r(e,i)&&(t+=1),n(e,i)&&(t-=1),0===t&&i!==e.length-1)return!1;return!0}(e)?o(function(e){return e.slice(1,e.length-1)}(e)):function(e){let t=0;for(let o=0;o<e.length;o++)if(r(e,o)&&(t+=1),n(e,o)&&(t-=1),i(e,o)&&0===t)return!0;return!1}(e)?function(e){let[t,s]=[0,0];const a=[];for(let u=0;u<e.length;u++)if(r(e,u)&&(t+=1),n(e,u)&&(t-=1),i(e,u)&&0===t){const t=e.slice(s,u);t.length>0&&a.push(o(t)),s=u+1}const u=e.slice(s);return u.length>0&&a.push(o(u)),0===a.length?{type:"const",const:""}:1===a.length?a[0]:{type:"or",expr:a}}(e):function(e){for(let t=0;t<e.length;t++)if(r(e,t))return!0;return!1}(e)?function(e){function t(e,t){if(!r(e,t))throw new U("TemplateLiteralParser: Index must point to open parens");let i=0;for(let o=t;o<e.length;o++)if(r(e,o)&&(i+=1),n(e,o)&&(i-=1),0===i)return[t,o];throw new U("TemplateLiteralParser: Unclosed group parens in expression")}function i(e,t){for(let n=t;n<e.length;n++)if(r(e,n))return[t,n];return[t,e.length]}const s=[];for(let n=0;n<e.length;n++)if(r(e,n)){const[r,i]=t(e,n),a=e.slice(r,i+1);s.push(o(a)),n=i}else{const[t,r]=i(e,n),a=e.slice(t,r);a.length>0&&s.push(o(a)),n=r-1}return 0===s.length?{type:"const",const:""}:1===s.length?s[0]:{type:"and",expr:s}}(e):{type:"const",const:e}}e.Parse=o,e.ParseExact=function(e){return o(e.slice(1,e.length-1))}}(g||(e.TemplateLiteralParser=g={}));class x extends N{}e.TemplateLiteralFiniteError=x,function(e){e.Check=function e(t){return!!function(e){return"or"===e.type&&2===e.expr.length&&"const"===e.expr[0].type&&"true"===e.expr[0].const&&"const"===e.expr[1].type&&"false"===e.expr[1].const}(t)||!function(e){return"or"===e.type&&2===e.expr.length&&"const"===e.expr[0].type&&"0"===e.expr[0].const&&"const"===e.expr[1].type&&"[1-9][0-9]*"===e.expr[1].const}(t)&&!function(e){return"const"===e.type&&".*"===e.const}(t)&&("and"===t.type||"or"===t.type?t.expr.every((t=>e(t))):"const"===t.type||function(e){throw new x(e)}("Unknown expression type"))}}(h||(e.TemplateLiteralFinite=h={}));class j extends N{}e.TemplateLiteralGeneratorError=j,function(e){function*t(e){if(1===e.length)return yield*e[0];for(const r of e[0])for(const n of t(e.slice(1)))yield`${r}${n}`}function*r(e){return yield*t(e.expr.map((e=>[...n(e)])))}function*n(e){return"and"===e.type?yield*r(e):"or"===e.type?yield*function*(e){for(const t of e.expr)yield*n(t)}(e):"const"===e.type?yield*function*(e){return yield e.const}(e):(()=>{throw new j("Unknown expression")})()}e.Generate=n}(b||(e.TemplateLiteralGenerator=b={})),function(t){function*r(t){const r=t.trim().replace(/"|'/g,"");return"boolean"===r?yield e.Type.Boolean():"number"===r?yield e.Type.Number():"bigint"===r?yield e.Type.BigInt():"string"===r?yield e.Type.String():yield(()=>{const t=r.split("|").map((t=>e.Type.Literal(t.trim())));return 0===t.length?e.Type.Never():1===t.length?t[0]:e.Type.Union(t)})()}function*n(t){if("{"!==t[1]){const r=e.Type.Literal("$"),n=i(t.slice(1));return yield*[r,...n]}for(let e=2;e<t.length;e++)if("}"===t[e]){const n=r(t.slice(2,e)),o=i(t.slice(e+1));return yield*[...n,...o]}yield e.Type.Literal(t)}function*i(t){for(let r=0;r<t.length;r++)if("$"===t[r]){const i=e.Type.Literal(t.slice(0,r)),o=n(t.slice(r));return yield*[i,...o]}yield e.Type.Literal(t)}t.Parse=function(e){return[...i(e)]}}(v||(e.TemplateLiteralDslParser=v={}));class w{constructor(e){this.schema=e}Decode(e){return new L(this.schema,e)}}e.TransformDecodeBuilder=w;class L{constructor(e,t){this.schema=e,this.decode=t}Encode(t){const r=u.Type(this.schema);return i.TTransform(r)?(()=>{const n={Encode:n=>r[e.Transform].Encode(t(n)),Decode:t=>this.decode(r[e.Transform].Decode(t))};return{...r,[e.Transform]:n}})():(()=>{const n={Decode:this.decode,Encode:t};return{...r,[e.Transform]:n}})()}}e.TransformEncodeBuilder=L;let P=0;class _ extends N{}e.TypeBuilderError=_;class A{Create(e){return e}Throw(e){throw new _(e)}Discard(e,t){const{[t]:r,...n}=e;return n}Strict(e){return JSON.parse(JSON.stringify(e))}}e.TypeBuilder=A;class B extends A{ReadonlyOptional(e){return this.Readonly(this.Optional(e))}Readonly(t){return{...u.Type(t),[e.Readonly]:"Readonly"}}Optional(t){return{...u.Type(t),[e.Optional]:"Optional"}}Any(t={}){return this.Create({...t,[e.Kind]:"Any"})}Array(t,r={}){return this.Create({...r,[e.Kind]:"Array",type:"array",items:u.Type(t)})}Boolean(t={}){return this.Create({...t,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(e,t={}){return{...c.Map(u.Type(e),"Capitalize"),...t}}Composite(t,r){const n=e.Type.Intersect(t,{}),i=l.ResolveKeys(n,{includePatterns:!1}).reduce(((t,r)=>({...t,[r]:e.Type.Index(n,[r])})),{});return e.Type.Object(i,r)}Enum(t,r={}){const i=Object.getOwnPropertyNames(t).filter((e=>isNaN(e))).map((e=>t[e])).map((t=>n.IsString(t)?{[e.Kind]:"Literal",type:"string",const:t}:{[e.Kind]:"Literal",type:"number",const:t}));return this.Create({...r,[e.Kind]:"Union",anyOf:i})}Extends(e,t,r,n,i={}){switch(a.Extends(e,t)){case s.Union:return this.Union([u.Type(r,i),u.Type(n,i)]);case s.True:return u.Type(r,i);case s.False:return u.Type(n,i)}}Exclude(e,t,r={}){return i.TTemplateLiteral(e)?this.Exclude(T.Resolve(e),t,r):i.TTemplateLiteral(t)?this.Exclude(e,T.Resolve(t),r):i.TUnion(e)?(()=>{const n=e.anyOf.filter((e=>a.Extends(e,t)===s.False));return 1===n.length?u.Type(n[0],r):this.Union(n,r)})():a.Extends(e,t)!==s.False?this.Never(r):u.Type(e,r)}Extract(e,t,r={}){return i.TTemplateLiteral(e)?this.Extract(T.Resolve(e),t,r):i.TTemplateLiteral(t)?this.Extract(e,T.Resolve(t),r):i.TUnion(e)?(()=>{const n=e.anyOf.filter((e=>a.Extends(e,t)!==s.False));return 1===n.length?u.Type(n[0],r):this.Union(n,r)})():a.Extends(e,t)!==s.False?u.Type(e,r):this.Never(r)}Index(e,t,r={}){return i.TArray(e)&&i.TNumber(t)?u.Type(e.items,r):i.TTuple(e)&&i.TNumber(t)?(()=>{const t=(n.IsUndefined(e.items)?[]:e.items).map((e=>u.Type(e)));return this.Union(t,r)})():(()=>{const n=d.Resolve(t),i=u.Type(e);return p.Resolve(i,n,r)})()}Integer(t={}){return this.Create({...t,[e.Kind]:"Integer",type:"integer"})}Intersect(t,r={}){if(0===t.length)return e.Type.Never();if(1===t.length)return u.Type(t[0],r);t.some((e=>i.TTransform(e)))&&this.Throw("Cannot intersect transform types");const n=t.every((e=>i.TObject(e))),o=u.Rest(t),s=i.TSchema(r.unevaluatedProperties)?{unevaluatedProperties:u.Type(r.unevaluatedProperties)}:{};return!1===r.unevaluatedProperties||i.TSchema(r.unevaluatedProperties)||n?this.Create({...r,...s,[e.Kind]:"Intersect",type:"object",allOf:o}):this.Create({...r,...s,[e.Kind]:"Intersect",allOf:o})}KeyOf(t,r={}){return i.TRecord(t)?(()=>{const n=Object.getOwnPropertyNames(t.patternProperties)[0];return n===e.PatternNumberExact?this.Number(r):n===e.PatternStringExact?this.String(r):this.Throw("Unable to resolve key type from Record key pattern")})():i.TTuple(t)?(()=>{const i=(n.IsUndefined(t.items)?[]:t.items).map(((t,r)=>e.Type.Literal(r.toString())));return this.Union(i,r)})():i.TArray(t)?(()=>this.Number(r))():(()=>{const e=l.ResolveKeys(t,{includePatterns:!1});if(0===e.length)return this.Never(r);const n=e.map((e=>this.Literal(e)));return this.Union(n,r)})()}Literal(t,r={}){return this.Create({...r,[e.Kind]:"Literal",const:t,type:typeof t})}Lowercase(e,t={}){return{...c.Map(u.Type(e),"Lowercase"),...t}}Never(t={}){return this.Create({...t,[e.Kind]:"Never",not:{}})}Not(t,r){return this.Create({...r,[e.Kind]:"Not",not:u.Type(t)})}Null(t={}){return this.Create({...t,[e.Kind]:"Null",type:"null"})}Number(t={}){return this.Create({...t,[e.Kind]:"Number",type:"number"})}Object(t,r={}){const n=Object.getOwnPropertyNames(t),o=n.filter((e=>i.TOptional(t[e]))),s=n.filter((e=>!o.includes(e))),a=i.TSchema(r.additionalProperties)?{additionalProperties:u.Type(r.additionalProperties)}:{},p=n.reduce(((e,r)=>({...e,[r]:u.Type(t[r])})),{});return s.length>0?this.Create({...r,...a,[e.Kind]:"Object",type:"object",properties:p,required:s}):this.Create({...r,...a,[e.Kind]:"Object",type:"object",properties:p})}Omit(t,r,i={}){const o=d.Resolve(r);return y.Map(this.Discard(u.Type(t),e.Transform),(e=>{n.IsArray(e.required)&&(e.required=e.required.filter((e=>!o.includes(e))),0===e.required.length&&delete e.required);for(const t of Object.getOwnPropertyNames(e.properties))o.includes(t)&&delete e.properties[t];return this.Create(e)}),i)}Partial(t,r={}){return y.Map(this.Discard(u.Type(t),e.Transform),(e=>{const t=Object.getOwnPropertyNames(e.properties).reduce(((t,r)=>({...t,[r]:this.Optional(e.properties[r])})),{});return this.Object(t,this.Discard(e,"required"))}),r)}Pick(t,r,i={}){const o=d.Resolve(r);return y.Map(this.Discard(u.Type(t),e.Transform),(e=>{n.IsArray(e.required)&&(e.required=e.required.filter((e=>o.includes(e))),0===e.required.length&&delete e.required);for(const t of Object.getOwnPropertyNames(e.properties))o.includes(t)||delete e.properties[t];return this.Create(e)}),i)}Record(t,r,o={}){return i.TTemplateLiteral(t)?(()=>{const n=g.ParseExact(t.pattern);return h.Check(n)?this.Object([...b.Generate(n)].reduce(((e,t)=>({...e,[t]:u.Type(r)})),{}),o):this.Create({...o,[e.Kind]:"Record",type:"object",patternProperties:{[t.pattern]:u.Type(r)}})})():i.TUnion(t)?(()=>{const n=f.Resolve(t);if(i.TUnionLiteral(n)){const t=n.anyOf.reduce(((e,t)=>({...e,[t.const]:u.Type(r)})),{});return this.Object(t,{...o,[e.Hint]:"Record"})}this.Throw("Record key of type union contains non-literal types")})():i.TLiteral(t)?(()=>n.IsString(t.const)||n.IsNumber(t.const)?this.Object({[t.const]:u.Type(r)},o):this.Throw("Record key of type literal is not of type string or number"))():i.TInteger(t)||i.TNumber(t)?(()=>this.Create({...o,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:u.Type(r)}}))():i.TString(t)?(()=>{const i=n.IsUndefined(t.pattern)?e.PatternStringExact:t.pattern;return this.Create({...o,[e.Kind]:"Record",type:"object",patternProperties:{[i]:u.Type(r)}})})():this.Never()}Recursive(t,r={}){n.IsUndefined(r.$id)&&(r.$id="T"+P++);const i=t({[e.Kind]:"This",$ref:`${r.$id}`});return i.$id=r.$id,this.Create({...r,[e.Hint]:"Recursive",...i})}Ref(t,r={}){return n.IsString(t)?this.Create({...r,[e.Kind]:"Ref",$ref:t}):(n.IsUndefined(t.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({...r,[e.Kind]:"Ref",$ref:t.$id}))}Required(t,r={}){return y.Map(this.Discard(u.Type(t),e.Transform),(t=>{const r=Object.getOwnPropertyNames(t.properties).reduce(((r,n)=>({...r,[n]:this.Discard(t.properties[n],e.Optional)})),{});return this.Object(r,t)}),r)}Rest(e){return i.TTuple(e)&&!n.IsUndefined(e.items)?u.Rest(e.items):i.TIntersect(e)?u.Rest(e.allOf):i.TUnion(e)?u.Rest(e.anyOf):[]}String(t={}){return this.Create({...t,[e.Kind]:"String",type:"string"})}TemplateLiteral(t,r={}){const i=n.IsString(t)?m.Create(v.Parse(t)):m.Create(t);return this.Create({...r,[e.Kind]:"TemplateLiteral",type:"string",pattern:i})}Transform(e){return new w(e)}Tuple(t,r={}){const[n,i,o]=[!1,t.length,t.length],s=u.Rest(t),a=t.length>0?{...r,[e.Kind]:"Tuple",type:"array",items:s,additionalItems:n,minItems:i,maxItems:o}:{...r,[e.Kind]:"Tuple",type:"array",minItems:i,maxItems:o};return this.Create(a)}Uncapitalize(e,t={}){return{...c.Map(u.Type(e),"Uncapitalize"),...t}}Union(t,r={}){return i.TTemplateLiteral(t)?T.Resolve(t):(()=>{const n=t;if(0===n.length)return this.Never(r);if(1===n.length)return this.Create(u.Type(n[0],r));const i=u.Rest(n);return this.Create({...r,[e.Kind]:"Union",anyOf:i})})()}Unknown(t={}){return this.Create({...t,[e.Kind]:"Unknown"})}Unsafe(t={}){return this.Create({...t,[e.Kind]:t[e.Kind]||"Unsafe"})}Uppercase(e,t={}){return{...c.Map(u.Type(e),"Uppercase"),...t}}}e.JsonTypeBuilder=B;class E extends B{AsyncIterator(t,r={}){return this.Create({...r,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:u.Type(t)})}Awaited(t,r={}){const n=e=>e.length>0?(()=>{const[t,...r]=e;return[this.Awaited(t),...n(r)]})():e;return i.TIntersect(t)?e.Type.Intersect(n(t.allOf)):i.TUnion(t)?e.Type.Union(n(t.anyOf)):i.TPromise(t)?this.Awaited(t.item):u.Type(t,r)}BigInt(t={}){return this.Create({...t,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(e,t={}){return this.Tuple([...e.parameters],{...t})}Constructor(t,r,n){const[i,o]=[u.Rest(t),u.Type(r)];return this.Create({...n,[e.Kind]:"Constructor",type:"Constructor",parameters:i,returns:o})}Date(t={}){return this.Create({...t,[e.Kind]:"Date",type:"Date"})}Function(t,r,n){const[i,o]=[u.Rest(t),u.Type(r)];return this.Create({...n,[e.Kind]:"Function",type:"Function",parameters:i,returns:o})}InstanceType(e,t={}){return u.Type(e.returns,t)}Iterator(t,r={}){return this.Create({...r,[e.Kind]:"Iterator",type:"Iterator",items:u.Type(t)})}Parameters(e,t={}){return this.Tuple(e.parameters,{...t})}Promise(t,r={}){return this.Create({...r,[e.Kind]:"Promise",type:"Promise",item:u.Type(t)})}RegExp(t,r={}){const i=n.IsString(t)?t:t.source;return this.Create({...r,[e.Kind]:"String",type:"string",pattern:i})}RegEx(e,t={}){return this.RegExp(e,t)}ReturnType(e,t={}){return u.Type(e.returns,t)}Symbol(t){return this.Create({...t,[e.Kind]:"Symbol",type:"symbol"})}Undefined(t={}){return this.Create({...t,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(t={}){return this.Create({...t,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(t={}){return this.Create({...t,[e.Kind]:"Void",type:"void"})}}e.JavaScriptTypeBuilder=E,e.JsonType=new B,e.Type=new E}(a);var u="^$|^GHA-\\d{9}-\\d{1}$",p="^[a-zA-Z0-9]*$",c=function(){var e,t=a.Type.String({pattern:"^[a-zA-Z0-9]*$"}),r=a.Type.String({format:"date",formatMaximum:(new Date).toISOString().split("T")[0]}),n=a.Type.String({format:"date",formatMinimum:(new Date).toISOString().split("T")[0]}),i=a.Type.String({pattern:u}),o=a.Type.String({minLength:1});return[{category:"financial_information",type:"mtn_statement",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({msisdn:a.Type.String({pattern:"^233[0-9]{9}$"}),accountHolderName:o,from:a.Type.String({format:"date"}),to:a.Type.String({format:"date"}),timeRun:a.Type.String({format:"date-time"})})},{category:"financial_information",type:"bank_statement",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({issuer:(e=["Absa Bank Ghana Limited","Access Bank Ghana Plc","Agricultural Development Bank of Ghana","Bank of Africa Ghana Limited","CalBank Limited","Consolidated Bank Ghana Limited","Ecobank Ghana Limited","FBN Bank Ghana Limited","Fidelity Bank Ghana Limited","First Atlantic Bank Limited","First National Bank Ghana","GCB Bank Limited","Guaranty Trust Bank Ghana Limited","National Investment Bank Limited","OmniBSIC Bank Ghana Limited","Prudential Bank Limited","Republic Bank Ghana","Societe Generale Ghana Limited","Stanbic Bank Ghana Limited","Standard Chartered Bank Ghana Limited","United Bank for Africa Ghana Limited","Zenith Bank Ghana Limited"],a.Type.Unsafe({type:"string",enum:e})),printDate:a.Type.String({format:"date-time"}),accountHolderName:o,from:a.Type.String({format:"date"}),to:a.Type.String({format:"date"}),accountNumber:a.Type.Optional(a.Type.String())})},{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:u},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:u},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:u},docNumber:{type:"string",pattern:p},userAddress:{type:"string"},physicalAddress:{type:"string"},rentalAmount:{type:"number"},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:u},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:u},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:u},docNumber:{type:"string",pattern:p},userAddress:{type:"string"},physicalAddress:{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:u},docNumber:{type:"string",pattern:p},userAddress:{type:"string"},physicalAddress:{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:u},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:u},docNumber:{type:"string",pattern:p},userAddress:{type:"string"},physicalAddress:{type:"string"},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:u},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:u},docNumber:{type:"string",pattern:p},employeeName:{type:"string"},position:{type:"string"},issuingDate:{type:"string",format:"date"},salaryAmount:{type:"number"}}}},{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:u},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:u},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:u},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_3",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:u},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_4",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:u},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:a.Type.Object({businessName:a.Type.String(),taxIdNumber:t,registrationNumber:t,issueDate:r})},{category:"proof_of_registration",type:"operating_permit",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),registrationNumber:a.Type.Optional(t),issueDate:r,expirationDate:n})},{category:"proof_of_registration",type:"district_assembly_certificate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({certificateNumber:t,businessName:t,registrationNumber:a.Type.Optional(t),issueDate:r})},{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"}}}},{category:"proof_of_ownership",type:"form_a",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),registrationNumber:t,taxIdNumber:t,issueDate:r,firstName:a.Type.String(),middleName:a.Type.Optional(a.Type.String()),lastName:a.Type.String(),dateOfBirth:r,nationalIdNumber:i})},{category:"proof_of_ownership",type:"permit",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),issueDate:r})},{category:"proof_of_ownership",type:"property_rate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),issueDate:r})}]},y={GH:c,CA:function(){return[{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"}}}}]},UG:function(){var e=a.Type.String({pattern:"^[a-zA-Z0-9]*$"}),t=a.Type.String({format:"date",formatMaximum:(new Date).toISOString().split("T")[0]}),r=function(e){return a.Type.Unsafe({type:"string",enum:e})},n=a.Type.String({minLength:1});return[{category:"proof_of_registration",type:"certificate_of_registration",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),registrationNumber:e,issueDate:t})},{category:"proof_of_registration",type:"trade_license",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),registrationNumber:e,issuer:r(["KCCA","Other"]),expirationDate:a.Type.Optional(t)})},{category:"proof_of_registration",type:"association_letter",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({isOwnerNameOnDocument:a.Type.Boolean(),isValidIssuer:a.Type.Boolean(),isDocumentStampedAndValid:a.Type.Boolean(),issueDate:t})},{category:"business_ownership",type:"business_registration_form",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({registrationNumber:e,businessName:a.Type.String(),taxIdNumber:a.Type.String(),issueDate:t,ownerName:a.Type.String()})},{category:"financial_information",type:"mtn_statement",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({dateOfStatement:a.Type.String({format:"date-time"}),from:a.Type.String({format:"date"}),to:a.Type.String({format:"date"}),mobileNumber:a.Type.String({pattern:"^233[0-9]{9}$"}),accountHolderName:n})},{category:"financial_information",type:"airtel_statement",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({from:a.Type.String({format:"date"}),to:a.Type.String({format:"date"}),mobileNumber:a.Type.String({pattern:"^233[0-9]{9}$"}),accountHolderName:n})},{category:"financial_information",type:"bank_statement",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({bankName:r(["ABC Bank Uganda Limited","Absa Bank Uganda Limited","Bank of Africa Uganda Limited","Bank of Baroda Uganda Limited","Bank of India Uganda Limited","Cairo Bank Uganda","Centenary Bank","Citibank Uganda","DFCU Bank","Diamond Trust Bank","Ecobank Uganda","Equity Bank Uganda Limited","Exim Bank (Uganda)","Finance Trust Bank","Guaranty Trust Bank","Housing Finance Bank","I&M Bank Uganda","KCB Bank Uganda Limited","NCBA Bank Uganda","Opportunity Bank Uganda Limited","PostBank Uganda","Stanbic Bank Uganda Limited","Standard Chartered Uganda","Tropical Bank","United Bank for Africa","Other"]),printDate:a.Type.Optional(a.Type.String({format:"date"})),from:a.Type.String({format:"date"}),to:a.Type.String({format:"date"}),accountHolderName:n,accountNumber:a.Type.Optional(a.Type.String())})}]}};e.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"]},e.getDocumentId=function(e,t){var r;if(void 0===t&&(t=!0),t&&null!=e&&e.id)return e.id;var n=(null==e?void 0:e.category)+"-"+(null==e?void 0:e.type)+"-"+(null==e||null==(r=e.issuer)?void 0:r.country);return e.version&&(n=n+"-v"+e.version),n.toLowerCase()},e.getDocumentsByCountry=function(e){var t;return(null==(t=y[e])?void 0:t.call(y))||[]},e.getGhanaDocuments=c,e.handlePromise=i,e.isEmptyObject=function(e){return o(e)&&0===Object.keys(e).length},e.isErrorWithCode=function(e){return o(e)&&"code"in e&&"number"==typeof e.code},e.isErrorWithMessage=function(e){return o(e)&&"message"in e&&"string"==typeof e.message},e.isErrorWithName=function(e){return o(e)&&"name"in e&&"string"==typeof e.name},e.isFunction=function(e){return"function"==typeof e},e.isNullish=function(e){return null==e},e.isObject=o,e.noNullish=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((function(e,t,n){var i,o=null!=(i=r[n])?i:"";return e+t+String(o)}),"").replace(/\s+/g," ")},e.sleep=s,e.uniqueArray=function(e){return Array.from(new Set(e))},e.zodErrorToReadable=function(e){return e.issues.map((function(e){var t;return(null==(t=e.path)?void 0:t.join("."))+": "+e.message})).join("\n")},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map

@@ -46,6 +46,5 @@ /**

exports.defaultContextSchema = defaultContextSchema.defaultContextSchema;
exports.certificateOfResidenceGH = GH.certificateOfResidenceGH;
exports.ghanaDocuments = GH.ghanaDocuments;
exports.getGhanaDocuments = GH.getGhanaDocuments;
exports.getDocumentId = index.getDocumentId;
exports.getDocumentsByCountry = index.getDocumentsByCountry;
//# sourceMappingURL=index.js.map

@@ -15,125 +15,127 @@ /**

var canadaDocuments = [{
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'
var getCanadaDocuments = function getCanadaDocuments() {
return [{
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: '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'
}, {
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'
}
}
}
}
}];
}];
};
exports.canadaDocuments = canadaDocuments;
exports.getCanadaDocuments = getCanadaDocuments;
//# sourceMappingURL=CA.js.map

@@ -15,726 +15,760 @@ /**

var typebox = require('@sinclair/typebox');
var ghNationalIdNumber = '^$|^GHA-\\d{9}-\\d{1}$';
var alphaNumeric = '^[a-zA-Z0-9]*$';
var certificateOfResidenceGH = {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
amountDue: {
type: 'number'
},
issuingDate: {
type: 'string',
format: 'date'
}
}
}
};
var ghanaDocuments = [{
category: 'financial_information',
type: 'mtn_statement',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: {
type: 'object',
required: ['msisdn', 'accountHolderName'],
properties: {
msisdn: {
type: 'string',
var getGhanaDocuments = function getGhanaDocuments() {
var TypeAlphanumericString = typebox.Type.String({
pattern: '^[a-zA-Z0-9]*$'
});
var TypePastDate = typebox.Type.String({
format: 'date',
formatMaximum: new Date().toISOString().split('T')[0]
});
var TypeFutureDate = typebox.Type.String({
format: 'date',
formatMinimum: new Date().toISOString().split('T')[0]
});
var TypeNationalIdNumber = typebox.Type.String({
pattern: ghNationalIdNumber
});
var TypeStringAtLeastOneWord = typebox.Type.String({
minLength: 1
});
var TypeStringEnum = function TypeStringEnum(values) {
return typebox.Type.Unsafe({
type: 'string',
"enum": values
});
};
return [
// Financial Information
{
category: 'financial_information',
type: 'mtn_statement',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: typebox.Type.Object({
msisdn: typebox.Type.String({
pattern: '^233[0-9]{9}$'
},
from: {
type: 'string',
}),
accountHolderName: TypeStringAtLeastOneWord,
from: typebox.Type.String({
format: 'date'
},
to: {
type: 'string',
}),
to: typebox.Type.String({
format: 'date'
},
timeRun: {
type: 'string',
}),
timeRun: typebox.Type.String({
format: 'date-time'
})
})
}, {
category: 'financial_information',
type: 'bank_statement',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: typebox.Type.Object({
issuer: TypeStringEnum(['Absa Bank Ghana Limited', 'Access Bank Ghana Plc', 'Agricultural Development Bank of Ghana', 'Bank of Africa Ghana Limited', 'CalBank Limited', 'Consolidated Bank Ghana Limited', 'Ecobank Ghana Limited', 'FBN Bank Ghana Limited', 'Fidelity Bank Ghana Limited', 'First Atlantic Bank Limited', 'First National Bank Ghana', 'GCB Bank Limited', 'Guaranty Trust Bank Ghana Limited', 'National Investment Bank Limited', 'OmniBSIC Bank Ghana Limited', 'Prudential Bank Limited', 'Republic Bank Ghana', 'Societe Generale Ghana Limited', 'Stanbic Bank Ghana Limited', 'Standard Chartered Bank Ghana Limited', 'United Bank for Africa Ghana Limited', 'Zenith Bank Ghana Limited']),
printDate: typebox.Type.String({
format: 'date-time'
}),
accountHolderName: TypeStringAtLeastOneWord,
from: typebox.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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
amountDue: {
type: 'number'
},
issuingDate: {
type: 'string',
}),
to: typebox.Type.String({
format: 'date'
}
}
}
}, {
category: 'proof_of_address',
type: 'electricity_bill',
issuer: {
type: 'local_authority',
city: 'Accra',
name: 'Electricity Company of Ghana',
country: 'GH'
}),
accountNumber: typebox.Type.Optional(typebox.Type.String())
})
},
issuingVersion: 1,
version: 1,
propertiesSchema: {
type: 'object',
properties: {
nationalIdNumber: {
type: 'string',
pattern: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
amountDue: {
type: 'number'
},
issuingDate: {
type: 'string',
format: 'date'
// Proof of Address
{
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
rentalAmount: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
amountDue: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
salaryAmount: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
rentalAmount: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
issuingDate: {
type: 'string',
format: 'date'
},
salaryAmount: {
type: 'number'
}, {
category: 'proof_of_address',
type: 'bank_statement',
issuer: {
type: 'bank',
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: {
type: 'object',
properties: {
nationalIdNumber: {
type: 'string',
pattern: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
type: 'string'
},
issuingDate: {
type: 'string',
format: 'date'
// Proof of Employment
{
category: 'proof_of_employment',
type: 'payslip',
issuer: {
type: 'private',
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: {
type: 'object',
properties: {
nationalIdNumber: {
type: 'string',
pattern: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
salaryAmount: {
type: 'number'
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
issuingDate: {
type: 'string',
format: 'date'
},
salaryAmount: {
type: 'number'
}
}
}
}
}, {
category: 'proof_of_employment',
type: 'form_3',
issuer: {
type: 'private',
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: {
type: 'object',
properties: {
nationalIdNumber: {
type: 'string',
pattern: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
type: 'string'
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: alphaNumeric
},
registrationNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
type: 'string'
},
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: alphaNumeric
},
registrationNumber: {
type: 'string',
pattern: alphaNumeric
},
companyName: {
type: 'string'
},
issuingDate: {
type: 'string',
format: 'date'
// Proof of Registration
{
category: 'proof_of_registration',
type: 'certificate_of_registration',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: typebox.Type.Object({
businessName: typebox.Type.String(),
taxIdNumber: TypeAlphanumericString,
registrationNumber: TypeAlphanumericString,
issueDate: TypePastDate
})
}, {
category: 'proof_of_registration',
type: 'operating_permit',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: typebox.Type.Object({
businessName: typebox.Type.String(),
registrationNumber: typebox.Type.Optional(TypeAlphanumericString),
issueDate: TypePastDate,
expirationDate: TypeFutureDate
})
}, {
category: 'proof_of_registration',
type: 'district_assembly_certificate',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: typebox.Type.Object({
certificateNumber: TypeAlphanumericString,
businessName: TypeAlphanumericString,
registrationNumber: typebox.Type.Optional(TypeAlphanumericString),
issueDate: TypePastDate
})
}, {
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: alphaNumeric
},
taxIdNumber: {
type: 'string',
pattern: alphaNumeric
}
}
}
}
}, {
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: alphaNumeric
},
taxIdNumber: {
type: 'string',
pattern: alphaNumeric
}, {
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'
}
}
}
}
}, {
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'
}
}
}
}];
// Proof of Ownership
{
category: 'proof_of_ownership',
type: 'form_a',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: typebox.Type.Object({
businessName: typebox.Type.String(),
registrationNumber: TypeAlphanumericString,
taxIdNumber: TypeAlphanumericString,
issueDate: TypePastDate,
firstName: typebox.Type.String(),
middleName: typebox.Type.Optional(typebox.Type.String()),
lastName: typebox.Type.String(),
dateOfBirth: TypePastDate,
nationalIdNumber: TypeNationalIdNumber
})
}, {
category: 'proof_of_ownership',
type: 'permit',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: typebox.Type.Object({
businessName: typebox.Type.String(),
issueDate: TypePastDate
})
}, {
category: 'proof_of_ownership',
type: 'property_rate',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: typebox.Type.Object({
businessName: typebox.Type.String(),
issueDate: TypePastDate
})
}];
};
exports.certificateOfResidenceGH = certificateOfResidenceGH;
exports.ghanaDocuments = ghanaDocuments;
exports.getGhanaDocuments = getGhanaDocuments;
//# sourceMappingURL=GH.js.map

@@ -17,9 +17,12 @@ /**

var CA = require('./CA.js');
var UG = require('./UG.js');
var documentIdsByCountry = {
GH: GH.ghanaDocuments,
CA: CA.canadaDocuments
GH: GH.getGhanaDocuments,
CA: CA.getCanadaDocuments,
UG: UG.getUgandaDocuments
};
var getDocumentsByCountry = function getDocumentsByCountry(countryCode) {
return documentIdsByCountry[countryCode] || [];
var _documentIdsByCountry;
return ((_documentIdsByCountry = documentIdsByCountry[countryCode]) == null ? void 0 : _documentIdsByCountry.call(documentIdsByCountry)) || [];
};

@@ -26,0 +29,0 @@ var getDocumentId = function getDocumentId(document, useUuid) {

@@ -24,4 +24,4 @@ /**

export { defaultContextSchema } from './schemas/documents/default-context-schema.js';
export { certificateOfResidenceGH, ghanaDocuments } from './schemas/documents/workflow/documents/schemas/GH.js';
export { getGhanaDocuments } from './schemas/documents/workflow/documents/schemas/GH.js';
export { getDocumentId, getDocumentsByCountry } from './schemas/documents/workflow/documents/schemas/index.js';
//# sourceMappingURL=index.js.map

@@ -11,125 +11,127 @@ /**

*/
var canadaDocuments = [{
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'
var getCanadaDocuments = function getCanadaDocuments() {
return [{
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: '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'
}, {
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'
}
}
}
}
}];
}];
};
export { canadaDocuments };
export { getCanadaDocuments };
//# sourceMappingURL=CA.js.map

@@ -11,725 +11,760 @@ /**

*/
import { Type } from '@sinclair/typebox';
var ghNationalIdNumber = '^$|^GHA-\\d{9}-\\d{1}$';
var alphaNumeric = '^[a-zA-Z0-9]*$';
var certificateOfResidenceGH = {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
amountDue: {
type: 'number'
},
issuingDate: {
type: 'string',
format: 'date'
}
}
}
};
var ghanaDocuments = [{
category: 'financial_information',
type: 'mtn_statement',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: {
type: 'object',
required: ['msisdn', 'accountHolderName'],
properties: {
msisdn: {
type: 'string',
var getGhanaDocuments = function getGhanaDocuments() {
var TypeAlphanumericString = Type.String({
pattern: '^[a-zA-Z0-9]*$'
});
var TypePastDate = Type.String({
format: 'date',
formatMaximum: new Date().toISOString().split('T')[0]
});
var TypeFutureDate = Type.String({
format: 'date',
formatMinimum: new Date().toISOString().split('T')[0]
});
var TypeNationalIdNumber = Type.String({
pattern: ghNationalIdNumber
});
var TypeStringAtLeastOneWord = Type.String({
minLength: 1
});
var TypeStringEnum = function TypeStringEnum(values) {
return Type.Unsafe({
type: 'string',
"enum": values
});
};
return [
// Financial Information
{
category: 'financial_information',
type: 'mtn_statement',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
msisdn: Type.String({
pattern: '^233[0-9]{9}$'
},
from: {
type: 'string',
}),
accountHolderName: TypeStringAtLeastOneWord,
from: Type.String({
format: 'date'
},
to: {
type: 'string',
}),
to: Type.String({
format: 'date'
},
timeRun: {
type: 'string',
}),
timeRun: Type.String({
format: 'date-time'
})
})
}, {
category: 'financial_information',
type: 'bank_statement',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
issuer: TypeStringEnum(['Absa Bank Ghana Limited', 'Access Bank Ghana Plc', 'Agricultural Development Bank of Ghana', 'Bank of Africa Ghana Limited', 'CalBank Limited', 'Consolidated Bank Ghana Limited', 'Ecobank Ghana Limited', 'FBN Bank Ghana Limited', 'Fidelity Bank Ghana Limited', 'First Atlantic Bank Limited', 'First National Bank Ghana', 'GCB Bank Limited', 'Guaranty Trust Bank Ghana Limited', 'National Investment Bank Limited', 'OmniBSIC Bank Ghana Limited', 'Prudential Bank Limited', 'Republic Bank Ghana', 'Societe Generale Ghana Limited', 'Stanbic Bank Ghana Limited', 'Standard Chartered Bank Ghana Limited', 'United Bank for Africa Ghana Limited', 'Zenith Bank Ghana Limited']),
printDate: Type.String({
format: 'date-time'
}),
accountHolderName: TypeStringAtLeastOneWord,
from: 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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
amountDue: {
type: 'number'
},
issuingDate: {
type: 'string',
}),
to: Type.String({
format: 'date'
}
}
}
}, {
category: 'proof_of_address',
type: 'electricity_bill',
issuer: {
type: 'local_authority',
city: 'Accra',
name: 'Electricity Company of Ghana',
country: 'GH'
}),
accountNumber: Type.Optional(Type.String())
})
},
issuingVersion: 1,
version: 1,
propertiesSchema: {
type: 'object',
properties: {
nationalIdNumber: {
type: 'string',
pattern: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
amountDue: {
type: 'number'
},
issuingDate: {
type: 'string',
format: 'date'
// Proof of Address
{
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
rentalAmount: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
amountDue: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
salaryAmount: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
rentalAmount: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
issuingDate: {
type: 'string',
format: 'date'
},
salaryAmount: {
type: 'number'
}, {
category: 'proof_of_address',
type: 'bank_statement',
issuer: {
type: 'bank',
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: {
type: 'object',
properties: {
nationalIdNumber: {
type: 'string',
pattern: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
type: 'string'
},
issuingDate: {
type: 'string',
format: 'date'
// Proof of Employment
{
category: 'proof_of_employment',
type: 'payslip',
issuer: {
type: 'private',
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: {
type: 'object',
properties: {
nationalIdNumber: {
type: 'string',
pattern: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
salaryAmount: {
type: 'number'
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
type: 'string'
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
issuingDate: {
type: 'string',
format: 'date'
},
salaryAmount: {
type: 'number'
}
}
}
}
}, {
category: 'proof_of_employment',
type: 'form_3',
issuer: {
type: 'private',
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: {
type: 'object',
properties: {
nationalIdNumber: {
type: 'string',
pattern: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
type: 'string'
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
userAddress: {
type: 'string'
},
physicalAddress: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
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: alphaNumeric
},
registrationNumber: {
type: 'string',
pattern: alphaNumeric
},
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: ghNationalIdNumber
},
docNumber: {
type: 'string',
pattern: alphaNumeric
},
employeeName: {
type: 'string'
},
position: {
type: 'string'
},
employerName: {
type: 'string'
},
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: alphaNumeric
},
registrationNumber: {
type: 'string',
pattern: alphaNumeric
},
companyName: {
type: 'string'
},
issuingDate: {
type: 'string',
format: 'date'
// Proof of Registration
{
category: 'proof_of_registration',
type: 'certificate_of_registration',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
businessName: Type.String(),
taxIdNumber: TypeAlphanumericString,
registrationNumber: TypeAlphanumericString,
issueDate: TypePastDate
})
}, {
category: 'proof_of_registration',
type: 'operating_permit',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
businessName: Type.String(),
registrationNumber: Type.Optional(TypeAlphanumericString),
issueDate: TypePastDate,
expirationDate: TypeFutureDate
})
}, {
category: 'proof_of_registration',
type: 'district_assembly_certificate',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
certificateNumber: TypeAlphanumericString,
businessName: TypeAlphanumericString,
registrationNumber: Type.Optional(TypeAlphanumericString),
issueDate: TypePastDate
})
}, {
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: alphaNumeric
},
taxIdNumber: {
type: 'string',
pattern: alphaNumeric
}
}
}
}
}, {
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: alphaNumeric
},
taxIdNumber: {
type: 'string',
pattern: alphaNumeric
}, {
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'
}
}
}
}
}, {
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'
}
}
}
}];
// Proof of Ownership
{
category: 'proof_of_ownership',
type: 'form_a',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
businessName: Type.String(),
registrationNumber: TypeAlphanumericString,
taxIdNumber: TypeAlphanumericString,
issueDate: TypePastDate,
firstName: Type.String(),
middleName: Type.Optional(Type.String()),
lastName: Type.String(),
dateOfBirth: TypePastDate,
nationalIdNumber: TypeNationalIdNumber
})
}, {
category: 'proof_of_ownership',
type: 'permit',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
businessName: Type.String(),
issueDate: TypePastDate
})
}, {
category: 'proof_of_ownership',
type: 'property_rate',
issuer: {
country: 'GH'
},
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
businessName: Type.String(),
issueDate: TypePastDate
})
}];
};
export { certificateOfResidenceGH, ghanaDocuments };
export { getGhanaDocuments };
//# sourceMappingURL=GH.js.map

@@ -11,11 +11,14 @@ /**

*/
import { ghanaDocuments } from './GH.js';
import { canadaDocuments } from './CA.js';
import { getGhanaDocuments } from './GH.js';
import { getCanadaDocuments } from './CA.js';
import { getUgandaDocuments } from './UG.js';
var documentIdsByCountry = {
GH: ghanaDocuments,
CA: canadaDocuments
GH: getGhanaDocuments,
CA: getCanadaDocuments,
UG: getUgandaDocuments
};
var getDocumentsByCountry = function getDocumentsByCountry(countryCode) {
return documentIdsByCountry[countryCode] || [];
var _documentIdsByCountry;
return ((_documentIdsByCountry = documentIdsByCountry[countryCode]) == null ? void 0 : _documentIdsByCountry.call(documentIdsByCountry)) || [];
};

@@ -22,0 +25,0 @@ var getDocumentId = function getDocumentId(document, useUuid) {

@@ -14,4 +14,6 @@ /**

import { ZodError } from 'zod';
import { DefaultContextSchema as DefaultContextSchema$1 } from '@/schemas';
import { TSchema } from '@sinclair/typebox';
import { JSONSchema7 } from 'json-schema';
import { countryCodes } from '@/countries';
import { DefaultContextSchema as DefaultContextSchema$1 } from '@/schemas';

@@ -279,8 +281,7 @@ declare const handlePromise: <TResult>(promise: Promise<TResult>) => Promise<[TResult, undefined] | [undefined, unknown]>;

type TDocument = Omit<DefaultContextSchema['documents'][number], 'pages' | 'properties'> & {
propertiesSchema: any;
type TDocument = Omit<DefaultContextSchema$1['documents'][number], 'pages' | 'properties'> & {
propertiesSchema: JSONSchema7 | TSchema;
};
declare const certificateOfResidenceGH: TDocument;
declare const ghanaDocuments: TDocument[];
declare const getGhanaDocuments: () => TDocument[];

@@ -290,2 +291,2 @@ declare const getDocumentsByCountry: (countryCode: (typeof countryCodes)[number]) => TDocument[];

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, TDefaultSchemaDocumentPage, TDocument, defaultContextSchema, getDocumentId, getDocumentsByCountry, getGhanaDocuments, handlePromise, isEmptyObject, isErrorWithCode, isErrorWithMessage, isErrorWithName, isFunction, isNullish, isObject, noNullish, sleep, uniqueArray, zodErrorToReadable };

@@ -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 l(){}var f={};u(f,s,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(G([])));v&&v!==r&&n.call(v,s)&&(f=v);var b=l.prototype=d.prototype=Object.create(f);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(i,o,s,a){var p=c(t[i],t,o);if("throw"!==p.type){var u=p.arg,y=u.value;return y&&"object"==typeof y&&n.call(y,"__await")?e.resolve(y.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(y).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,a)}))}a(p.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function w(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return 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=l,i(b,"constructor",{value:l,configurable:!0}),i(l,"constructor",{value:m,configurable:!0}),m.displayName=u(l,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,l):(t.__proto__=l,u(t,p,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},_(N.prototype),u(N.prototype,a,(function(){return this})),t.AsyncIterator=N,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new N(y(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(b),u(b,p,"Generator"),u(b,s,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=G,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",required:["msisdn","accountHolderName"],properties:{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"},salaryAmount:{type:"number"}}}},{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_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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WorkflowCore={})}(this,(function(e){"use strict";function t(){t=function(){return e};var e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(e){p=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,s=Object.create(o.prototype),a=new x(n||[]);return i(s,"_invoke",{value:O(e,r,a)}),s}function y(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l={};function d(){}function f(){}function m(){}var T={};p(T,s,(function(){return this}));var g=Object.getPrototypeOf,h=g&&g(g(j([])));h&&h!==r&&n.call(h,s)&&(T=h);var b=m.prototype=d.prototype=Object.create(T);function v(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function r(i,o,s,a){var u=y(e[i],e,o);if("throw"!==u.type){var p=u.arg,c=p.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(c).then((function(e){p.value=e,s(p)}),(function(e){return r("throw",e,s,a)}))}a(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function O(e,t,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 w()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=I(s,r);if(a){if(a===l)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 u=y(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function I(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,I(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var i=y(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,l;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function U(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function j(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:w}}function w(){return{value:void 0,done:!0}}return f.prototype=m,i(b,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:f,configurable:!0}),f.displayName=p(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,p(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},v(N.prototype),p(N.prototype,a,(function(){return this})),e.AsyncIterator=N,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new N(c(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},v(b),p(b,u,"Generator"),p(b,s,(function(){return this})),p(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=j,x.prototype={constructor:x,reset:function(e){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(U),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return s.type="throw",s.arg=e,t.next=r,n&&(t.method="next",t.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"),u=n.call(o,"finallyLoc");if(a&&u){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(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),U(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;U(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}function r(e,t,r,n,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,i)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var s=e.apply(t,n);function a(e){r(s,i,o,a,u,"next",e)}function u(e){r(s,i,o,a,u,"throw",e)}a(void 0)}))}}var i=function(){var e=n(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r;case 3:return n=e.sent,e.abrupt("return",[n,void 0]);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",[void 0,e.t0]);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),o=function(e){return!Array.isArray(e)&&null!==e&&"object"==typeof e},s=function(){var e=n(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){return setTimeout(e,r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a={};!function(e){var t,r,n,i,o,s,a,u,p,c,y,l,d,f,m,T,g,h,b,v;Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.JsonType=e.JavaScriptTypeBuilder=e.JsonTypeBuilder=e.TypeBuilder=e.TypeBuilderError=e.TransformEncodeBuilder=e.TransformDecodeBuilder=e.TemplateLiteralDslParser=e.TemplateLiteralGenerator=e.TemplateLiteralGeneratorError=e.TemplateLiteralFinite=e.TemplateLiteralFiniteError=e.TemplateLiteralParser=e.TemplateLiteralParserError=e.TemplateLiteralResolver=e.TemplateLiteralPattern=e.TemplateLiteralPatternError=e.UnionResolver=e.KeyArrayResolver=e.KeyArrayResolverError=e.KeyResolver=e.ObjectMap=e.Intrinsic=e.IndexedAccessor=e.TypeClone=e.TypeExtends=e.TypeExtendsResult=e.TypeExtendsError=e.ExtendsUndefined=e.TypeGuard=e.TypeGuardUnknownTypeError=e.ValueGuard=e.FormatRegistry=e.TypeBoxError=e.TypeRegistry=e.PatternStringExact=e.PatternNumberExact=e.PatternBooleanExact=e.PatternString=e.PatternNumber=e.PatternBoolean=e.Kind=e.Hint=e.Optional=e.Readonly=e.Transform=void 0,e.Transform=Symbol.for("TypeBox.Transform"),e.Readonly=Symbol.for("TypeBox.Readonly"),e.Optional=Symbol.for("TypeBox.Optional"),e.Hint=Symbol.for("TypeBox.Hint"),e.Kind=Symbol.for("TypeBox.Kind"),e.PatternBoolean="(true|false)",e.PatternNumber="(0|[1-9][0-9]*)",e.PatternString="(.*)",e.PatternBooleanExact=`^${e.PatternBoolean}$`,e.PatternNumberExact=`^${e.PatternNumber}$`,e.PatternStringExact=`^${e.PatternString}$`,function(e){const t=new Map;e.Entries=function(){return new Map(t)},e.Clear=function(){return t.clear()},e.Delete=function(e){return t.delete(e)},e.Has=function(e){return t.has(e)},e.Set=function(e,r){t.set(e,r)},e.Get=function(e){return t.get(e)}}(t||(e.TypeRegistry=t={}));class N extends Error{constructor(e){super(e)}}e.TypeBoxError=N,function(e){const t=new Map;e.Entries=function(){return new Map(t)},e.Clear=function(){return t.clear()},e.Delete=function(e){return t.delete(e)},e.Has=function(e){return t.has(e)},e.Set=function(e,r){t.set(e,r)},e.Get=function(e){return t.get(e)}}(r||(e.FormatRegistry=r={})),function(e){e.IsArray=function(e){return Array.isArray(e)},e.IsBigInt=function(e){return"bigint"==typeof e},e.IsBoolean=function(e){return"boolean"==typeof e},e.IsNull=function(e){return null===e},e.IsNumber=function(e){return"number"==typeof e},e.IsObject=function(e){return"object"==typeof e&&null!==e},e.IsString=function(e){return"string"==typeof e},e.IsUndefined=function(e){return void 0===e}}(n||(e.ValueGuard=n={}));e.TypeGuardUnknownTypeError=class extends N{},function(r){function i(e){try{return new RegExp(e),!0}catch{return!1}}function o(e){if(!n.IsString(e))return!1;for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r>=7&&r<=13||27===r||127===r)return!1}return!0}function s(e){return p(e)||J(e)}function a(e){return n.IsUndefined(e)||n.IsBigInt(e)}function u(e){return n.IsUndefined(e)||n.IsNumber(e)}function p(e){return n.IsUndefined(e)||n.IsBoolean(e)}function c(e){return n.IsUndefined(e)||n.IsString(e)}function y(e){return n.IsUndefined(e)||J(e)}function l(e){return I(e,"Any")&&c(e.$id)}function d(e){return I(e,"Array")&&"array"===e.type&&c(e.$id)&&J(e.items)&&u(e.minItems)&&u(e.maxItems)&&p(e.uniqueItems)&&y(e.contains)&&u(e.minContains)&&u(e.maxContains)}function f(e){return I(e,"AsyncIterator")&&"AsyncIterator"===e.type&&c(e.$id)&&J(e.items)}function m(e){return I(e,"BigInt")&&"bigint"===e.type&&c(e.$id)&&a(e.exclusiveMaximum)&&a(e.exclusiveMinimum)&&a(e.maximum)&&a(e.minimum)&&a(e.multipleOf)}function T(e){return I(e,"Boolean")&&"boolean"===e.type&&c(e.$id)}function g(e){return I(e,"Constructor")&&"Constructor"===e.type&&c(e.$id)&&n.IsArray(e.parameters)&&e.parameters.every((e=>J(e)))&&J(e.returns)}function h(e){return I(e,"Date")&&"Date"===e.type&&c(e.$id)&&u(e.exclusiveMaximumTimestamp)&&u(e.exclusiveMinimumTimestamp)&&u(e.maximumTimestamp)&&u(e.minimumTimestamp)&&u(e.multipleOfTimestamp)}function b(e){return I(e,"Function")&&"Function"===e.type&&c(e.$id)&&n.IsArray(e.parameters)&&e.parameters.every((e=>J(e)))&&J(e.returns)}function v(e){return I(e,"Integer")&&"integer"===e.type&&c(e.$id)&&u(e.exclusiveMaximum)&&u(e.exclusiveMinimum)&&u(e.maximum)&&u(e.minimum)&&u(e.multipleOf)}function N(e){return I(e,"Intersect")&&(!n.IsString(e.type)||"object"===e.type)&&n.IsArray(e.allOf)&&e.allOf.every((e=>J(e)&&!$(e)))&&c(e.type)&&(p(e.unevaluatedProperties)||y(e.unevaluatedProperties))&&c(e.$id)}function O(e){return I(e,"Iterator")&&"Iterator"===e.type&&c(e.$id)&&J(e.items)}function I(t,r){return S(t)&&t[e.Kind]===r}function S(t){return n.IsObject(t)&&e.Kind in t&&n.IsString(t[e.Kind])}function U(e){return j(e)&&n.IsString(e.const)}function x(e){return j(e)&&n.IsNumber(e.const)}function j(e){return I(e,"Literal")&&c(e.$id)&&(n.IsBoolean(e.const)||n.IsNumber(e.const)||n.IsString(e.const))}function w(e){return I(e,"Never")&&n.IsObject(e.not)&&0===Object.getOwnPropertyNames(e.not).length}function L(e){return I(e,"Not")&&J(e.not)}function P(e){return I(e,"Null")&&"null"===e.type&&c(e.$id)}function _(e){return I(e,"Number")&&"number"===e.type&&c(e.$id)&&u(e.exclusiveMaximum)&&u(e.exclusiveMinimum)&&u(e.maximum)&&u(e.minimum)&&u(e.multipleOf)}function A(e){return I(e,"Object")&&"object"===e.type&&c(e.$id)&&n.IsObject(e.properties)&&s(e.additionalProperties)&&u(e.minProperties)&&u(e.maxProperties)&&Object.entries(e.properties).every((([e,t])=>o(e)&&J(t)))}function B(e){return I(e,"Promise")&&"Promise"===e.type&&c(e.$id)&&J(e.item)}function E(e){return I(e,"Record")&&"object"===e.type&&c(e.$id)&&s(e.additionalProperties)&&n.IsObject(e.patternProperties)&&(e=>{const t=Object.getOwnPropertyNames(e.patternProperties);return 1===t.length&&i(t[0])&&n.IsObject(e.patternProperties)&&J(e.patternProperties[t[0]])})(e)}function R(e){return I(e,"Ref")&&c(e.$id)&&n.IsString(e.$ref)}function C(e){return I(e,"String")&&"string"===e.type&&c(e.$id)&&u(e.minLength)&&u(e.maxLength)&&(t=e.pattern,n.IsUndefined(t)||n.IsString(t)&&o(t)&&i(t))&&function(e){return n.IsUndefined(e)||n.IsString(e)&&o(e)}(e.format);var t}function k(e){return I(e,"Symbol")&&"symbol"===e.type&&c(e.$id)}function F(e){return I(e,"TemplateLiteral")&&"string"===e.type&&n.IsString(e.pattern)&&"^"===e.pattern[0]&&"$"===e.pattern[e.pattern.length-1]}function G(e){return I(e,"This")&&c(e.$id)&&n.IsString(e.$ref)}function $(t){return n.IsObject(t)&&e.Transform in t}function K(e){return I(e,"Tuple")&&"array"===e.type&&c(e.$id)&&n.IsNumber(e.minItems)&&n.IsNumber(e.maxItems)&&e.minItems===e.maxItems&&(n.IsUndefined(e.items)&&n.IsUndefined(e.additionalItems)&&0===e.minItems||n.IsArray(e.items)&&e.items.every((e=>J(e))))}function D(e){return I(e,"Undefined")&&"undefined"===e.type&&c(e.$id)}function V(e){return I(e,"Union")&&c(e.$id)&&n.IsObject(e)&&n.IsArray(e.anyOf)&&e.anyOf.every((e=>J(e)))}function H(e){return I(e,"Uint8Array")&&"Uint8Array"===e.type&&c(e.$id)&&u(e.minByteLength)&&u(e.maxByteLength)}function M(e){return I(e,"Unknown")&&c(e.$id)}function q(e){return I(e,"Unsafe")}function z(e){return I(e,"Void")&&"void"===e.type&&c(e.$id)}function J(r){return n.IsObject(r)&&(l(r)||d(r)||T(r)||m(r)||f(r)||g(r)||h(r)||b(r)||v(r)||N(r)||O(r)||j(r)||w(r)||L(r)||P(r)||_(r)||A(r)||B(r)||E(r)||R(r)||C(r)||k(r)||F(r)||G(r)||K(r)||D(r)||V(r)||H(r)||M(r)||q(r)||z(r)||S(r)&&t.Has(r[e.Kind]))}r.TAny=l,r.TArray=d,r.TAsyncIterator=f,r.TBigInt=m,r.TBoolean=T,r.TConstructor=g,r.TDate=h,r.TFunction=b,r.TInteger=v,r.TIntersect=N,r.TIterator=O,r.TKindOf=I,r.TKind=S,r.TLiteralString=U,r.TLiteralNumber=x,r.TLiteralBoolean=function(e){return j(e)&&n.IsBoolean(e.const)},r.TLiteral=j,r.TNever=w,r.TNot=L,r.TNull=P,r.TNumber=_,r.TObject=A,r.TPromise=B,r.TRecord=E,r.TRecursive=function(t){return n.IsObject(t)&&e.Hint in t&&"Recursive"===t[e.Hint]},r.TRef=R,r.TString=C,r.TSymbol=k,r.TTemplateLiteral=F,r.TThis=G,r.TTransform=$,r.TTuple=K,r.TUndefined=D,r.TUnionLiteral=function(e){return V(e)&&e.anyOf.every((e=>U(e)||x(e)))},r.TUnion=V,r.TUint8Array=H,r.TUnknown=M,r.TUnsafe=q,r.TVoid=z,r.TReadonly=function(t){return n.IsObject(t)&&"Readonly"===t[e.Readonly]},r.TOptional=function(t){return n.IsObject(t)&&"Optional"===t[e.Optional]},r.TSchema=J}(i||(e.TypeGuard=i={})),function(t){t.Check=function t(r){return"Intersect"===r[e.Kind]?r.allOf.every((e=>t(e))):"Union"===r[e.Kind]?r.anyOf.some((e=>t(e))):"Undefined"===r[e.Kind]||"Not"===r[e.Kind]&&!t(r.not)}}(o||(e.ExtendsUndefined=o={}));class O extends N{}e.TypeExtendsError=O,function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"}(s||(e.TypeExtendsResult=s={})),function(t){function r(e){return e===s.False?e:s.True}function o(e){throw new O(e)}function a(e){return i.TNever(e)||i.TIntersect(e)||i.TUnion(e)||i.TUnknown(e)||i.TAny(e)}function u(e,t){return i.TNever(t)?d():i.TIntersect(t)?l(e,t):i.TUnion(t)?B(e,t):i.TUnknown(t)?E():i.TAny(t)?p():o("StructuralRight")}function p(e,t){return s.True}function c(e,t){return i.TLiteral(e)&&n.IsBoolean(e.const)||i.TBoolean(e)?s.True:s.False}function y(e,t){return i.TLiteral(e)&&n.IsNumber(e.const)||i.TNumber(e)||i.TInteger(e)?s.True:s.False}function l(e,t){return t.allOf.every((t=>C(e,t)===s.True))?s.True:s.False}function d(e,t){return s.False}function f(t){let[r,n]=[t,0];for(;i.TNot(r);)r=r.not,n+=1;return n%2==0?r:e.Type.Unknown()}function m(e,t){return i.TLiteralNumber(e)||i.TNumber(e)||i.TInteger(e)?s.True:s.False}function g(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function h(e){return I(e)}function b(e){return g(e,0)||g(e,1)&&"description"in e.properties&&i.TUnion(e.properties.description)&&2===e.properties.description.anyOf.length&&(i.TString(e.properties.description.anyOf[0])&&i.TUndefined(e.properties.description.anyOf[1])||i.TString(e.properties.description.anyOf[1])&&i.TUndefined(e.properties.description.anyOf[0]))}function v(e){return g(e,0)}function N(e){return g(e,0)}function I(t){const n=e.Type.Number();return g(t,0)||g(t,1)&&"length"in t.properties&&r(C(t.properties.length,n))===s.True}function S(e,t){return C(e,t)===s.False||i.TOptional(e)&&!i.TOptional(t)?s.False:s.True}function U(t,n){return i.TUnknown(t)?s.False:i.TAny(t)?s.Union:i.TNever(t)||i.TLiteralString(t)&&h(n)||i.TLiteralNumber(t)&&v(n)||i.TLiteralBoolean(t)&&N(n)||i.TSymbol(t)&&b(n)||i.TBigInt(t)&&g(n,0)||i.TString(t)&&h(n)||i.TSymbol(t)&&b(n)||i.TNumber(t)&&v(n)||i.TInteger(t)&&v(n)||i.TBoolean(t)&&N(n)||i.TUint8Array(t)&&function(e){return I(e)}(n)||i.TDate(t)&&function(e){return g(e,0)}(n)||i.TConstructor(t)&&function(e){return g(e,0)}(n)||i.TFunction(t)&&function(t){const n=e.Type.Number();return g(t,0)||g(t,1)&&"length"in t.properties&&r(C(t.properties.length,n))===s.True}(n)?s.True:i.TRecord(t)&&i.TString(j(t))?"Record"===n[e.Hint]?s.True:s.False:i.TRecord(t)&&i.TNumber(j(t))&&g(n,0)?s.True:s.False}function x(t,n){return a(n)?u(t,n):i.TObject(n)&&function(t){const n=e.Type.Function([e.Type.Any()],e.Type.Any());return g(t,0)||g(t,1)&&"then"in t.properties&&r(C(t.properties.then,n))===s.True}(n)?s.True:i.TPromise(n)?r(C(t.item,n.item)):s.False}function j(t){return e.PatternNumberExact in t.patternProperties?e.Type.Number():e.PatternStringExact in t.patternProperties?e.Type.String():o("Unknown record key pattern")}function w(t){return e.PatternNumberExact in t.patternProperties?t.patternProperties[e.PatternNumberExact]:e.PatternStringExact in t.patternProperties?t.patternProperties[e.PatternStringExact]:o("Unable to get record value schema")}function L(e,t){const[n,o]=[j(t),w(t)];return i.TLiteralString(e)&&i.TNumber(n)&&r(C(e,o))===s.True?s.True:i.TUint8Array(e)&&i.TNumber(n)||i.TString(e)&&i.TNumber(n)||i.TArray(e)&&i.TNumber(n)?C(e,o):i.TObject(e)?(()=>{for(const t of Object.getOwnPropertyNames(e.properties))if(S(o,e.properties[t])===s.False)return s.False;return s.True})():s.False}function P(e,t){return i.TLiteral(e)&&n.IsString(e.const)||i.TString(e)?s.True:s.False}function _(e,t){return a(t)?u(e,t):i.TObject(t)&&I(t)||i.TArray(t)&&function(e,t){return i.TArray(t)&&void 0!==e.items&&e.items.every((e=>C(e,t.items)===s.True))}(e,t)?s.True:i.TTuple(t)?n.IsUndefined(e.items)&&!n.IsUndefined(t.items)||!n.IsUndefined(e.items)&&n.IsUndefined(t.items)?s.False:n.IsUndefined(e.items)&&!n.IsUndefined(t.items)||e.items.every(((e,r)=>C(e,t.items[r])===s.True))?s.True:s.False:s.False}function A(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TVoid(t)?function(e,t){return i.TUndefined(e)||i.TUndefined(e)?s.True:s.False}(e):i.TUndefined(t)?s.True:s.False}function B(e,t){return t.anyOf.some((t=>C(e,t)===s.True))?s.True:s.False}function E(e,t){return s.True}function R(e,t){return i.TNever(t)?d():i.TIntersect(t)?l(e,t):i.TUnion(t)?B(e,t):i.TAny(t)?p():i.TString(t)?P(e):i.TNumber(t)?m(e):i.TInteger(t)?y(e):i.TBoolean(t)?c(e):i.TArray(t)?function(e,t){return i.TUnknown(e)?s.False:i.TAny(e)?s.Union:i.TNever(e)?s.True:s.False}(e):i.TTuple(t)?function(e,t){return i.TNever(e)?s.True:i.TUnknown(e)?s.False:i.TAny(e)?s.Union:s.False}(e):i.TObject(t)?U(e,t):i.TUnknown(t)?s.True:s.False}function C(t,n){return i.TTemplateLiteral(t)||i.TTemplateLiteral(n)?function(e,t){return i.TTemplateLiteral(e)?C(T.Resolve(e),t):i.TTemplateLiteral(t)?C(e,T.Resolve(t)):o("Invalid fallthrough for TemplateLiteral")}(t,n):i.TNot(t)||i.TNot(n)?function(e,t){return i.TNot(e)?C(f(e),t):i.TNot(t)?C(e,f(t)):o("Invalid fallthrough for Not")}(t,n):i.TAny(t)?function(e,t){return i.TIntersect(t)?l(e,t):i.TUnion(t)&&t.anyOf.some((e=>i.TAny(e)||i.TUnknown(e)))?s.True:i.TUnion(t)?s.Union:i.TUnknown(t)||i.TAny(t)?s.True:s.Union}(t,n):i.TArray(t)?function(e,t){return i.TObject(t)&&I(t)?s.True:a(t)?u(e,t):i.TArray(t)?r(C(e.items,t.items)):s.False}(t,n):i.TBigInt(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TBigInt(t)?s.True:s.False}(t,n):i.TBoolean(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TBoolean(t)?s.True:s.False}(t,n):i.TAsyncIterator(t)?function(e,t){return a(t)?u(e,t):i.TAsyncIterator(t)?r(C(e.items,t.items)):s.False}(t,n):i.TConstructor(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TConstructor(t)?e.parameters.length>t.parameters.length?s.False:e.parameters.every(((e,n)=>r(C(t.parameters[n],e))===s.True))?r(C(e.returns,t.returns)):s.False:s.False}(t,n):i.TDate(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TDate(t)?s.True:s.False}(t,n):i.TFunction(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TFunction(t)?e.parameters.length>t.parameters.length?s.False:e.parameters.every(((e,n)=>r(C(t.parameters[n],e))===s.True))?r(C(e.returns,t.returns)):s.False:s.False}(t,n):i.TInteger(t)?function(e,t){return i.TInteger(t)||i.TNumber(t)?s.True:a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):s.False}(t,n):i.TIntersect(t)?function(e,t){return e.allOf.some((e=>C(e,t)===s.True))?s.True:s.False}(t,n):i.TIterator(t)?function(e,t){return a(t)?u(e,t):i.TIterator(t)?r(C(e.items,t.items)):s.False}(t,n):i.TLiteral(t)?function(e,t){return i.TLiteral(t)&&t.const===e.const?s.True:a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TString(t)?P(e):i.TNumber(t)?m(e):i.TInteger(t)?y(e):i.TBoolean(t)?c(e):s.False}(t,n):i.TNever(t)?s.True:i.TNull(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TNull(t)?s.True:s.False}(t,n):i.TNumber(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TInteger(t)||i.TNumber(t)?s.True:s.False}(t,n):i.TObject(t)?function(e,t){return a(t)?u(e,t):i.TRecord(t)?L(e,t):i.TObject(t)?(()=>{for(const r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties))return s.False;if(S(e.properties[r],t.properties[r])===s.False)return s.False}return s.True})():s.False}(t,n):i.TRecord(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?C(w(e),w(t)):s.False}(t,n):i.TString(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TString(t)?s.True:s.False}(t,n):i.TSymbol(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TSymbol(t)?s.True:s.False}(t,n):i.TTuple(t)?_(t,n):i.TPromise(t)?x(t,n):i.TUint8Array(t)?function(e,t){return a(t)?u(e,t):i.TObject(t)?U(e,t):i.TRecord(t)?L(e,t):i.TUint8Array(t)?s.True:s.False}(t,n):i.TUndefined(t)?A(t,n):i.TUnion(t)?function(e,t){return e.anyOf.every((e=>C(e,t)===s.True))?s.True:s.False}(t,n):i.TUnknown(t)?R(t,n):i.TVoid(t)?function(e,t){return i.TIntersect(t)?l(e,t):i.TUnion(t)?B(e,t):i.TUnknown(t)?E():i.TAny(t)?p():i.TObject(t)?U(e,t):i.TVoid(t)?s.True:s.False}(t,n):o(`Unknown left type operand '${t[e.Kind]}'`)}t.Extends=function(e,t){return C(e,t)}}(a||(e.TypeExtends=a={})),function(e){function t(e){return n.IsArray(e)?function(e){return e.map((e=>t(e)))}(e):n.IsObject(e)?function(e){return{...Object.getOwnPropertyNames(e).reduce(((r,n)=>({...r,[n]:t(e[n])})),{}),...Object.getOwnPropertySymbols(e).reduce(((r,n)=>({...r,[n]:t(e[n])})),{})}}(e):e}function r(e,r={}){return{...t(e),...r}}e.Rest=function(e){return e.map((e=>r(e)))},e.Type=r}(u||(e.TypeClone=u={})),function(t){function r(t){return t.map((t=>{const{[e.Optional]:r,...n}=u.Type(t);return n}))}function o(t){return function(e){return e.every((e=>i.TOptional(e)))}(t.allOf)?e.Type.Optional(e.Type.Intersect(r(t.allOf))):t}function s(t){return function(e){return e.some((e=>i.TOptional(e)))}(t.anyOf)?e.Type.Optional(e.Type.Union(r(t.anyOf))):t}function a(t){return"Intersect"===t[e.Kind]?o(t):"Union"===t[e.Kind]?s(t):t}function p(t,r){return"Intersect"===t[e.Kind]?function(t,r){const n=t.allOf.reduce(((t,n)=>{const i=p(n,r);return"Never"===i[e.Kind]?t:[...t,i]}),[]);return a(e.Type.Intersect(n))}(t,r):"Union"===t[e.Kind]?function(t,r){const n=t.anyOf.map((e=>p(e,r)));return a(e.Type.Union(n))}(t,r):"Object"===t[e.Kind]?function(t,r){const i=t.properties[r];return n.IsUndefined(i)?e.Type.Never():e.Type.Union([i])}(t,r):"Tuple"===t[e.Kind]?function(t,r){const i=t.items;if(n.IsUndefined(i))return e.Type.Never();const o=i[r];return n.IsUndefined(o)?e.Type.Never():o}(t,r):e.Type.Never()}t.Resolve=function(t,r,n={}){const i=r.map((e=>p(t,e.toString())));return a(e.Type.Union(i,n))}}(p||(e.IndexedAccessor=p={})),function(t){function r(e,t){return"string"==typeof e?"Uncapitalize"===t?function(e){const[t,r]=[e.slice(0,1),e.slice(1)];return`${t.toLowerCase()}${r}`}(e):"Capitalize"===t?function(e){const[t,r]=[e.slice(0,1),e.slice(1)];return`${t.toUpperCase()}${r}`}(e):"Uppercase"===t?function(e){return e.toUpperCase()}(e):"Lowercase"===t?function(e){return e.toLowerCase()}(e):e:e.toString()}function n(e,t){if(0===e.length)return[];const[r,...i]=e;return[s(r,t),...n(i,t)]}function o(t,o){return i.TTemplateLiteral(t)?function(t,i){const o=g.ParseExact(t.pattern);if(!h.Check(o))return{...t,pattern:r(t.pattern,i)};const s=n([...b.Generate(o)].map((t=>e.Type.Literal(t))),i),a=e.Type.Union(s);return e.Type.TemplateLiteral([a])}(t,o):i.TUnion(t)?e.Type.Union(n(t.anyOf,o)):i.TLiteral(t)?e.Type.Literal(r(t.const,o)):t}function s(e,t){return o(e,t)}t.Map=s}(c||(e.Intrinsic=c={})),function(t){function r(t,n){return"Intersect"===t[e.Kind]?function(t,n){return e.Type.Intersect(t.allOf.map((e=>r(e,n))),{...t})}(t,n):"Union"===t[e.Kind]?function(t,n){return e.Type.Union(t.anyOf.map((e=>r(e,n))),{...t})}(t,n):"Object"===t[e.Kind]?function(e,t){return t(e)}(t,n):t}t.Map=function(e,t,n){return{...r(u.Type(e),t),...n}}}(y||(e.ObjectMap=y={})),function(e){function t(e,r){return i.TIntersect(e)?function(e,r){return e.allOf.reduce(((e,n)=>[...e,...t(n,r)]),[])}(e,r):i.TUnion(e)?function(e,r){const n=e.anyOf.map((e=>t(e,r)));return[...n.reduce(((e,t)=>t.map((t=>n.every((e=>e.includes(t)))?e.add(t):e))[0]),new Set)]}(e,r):i.TObject(e)?function(e,t){return Object.getOwnPropertyNames(e.properties)}(e):i.TRecord(e)?function(e,t){return t.includePatterns?Object.getOwnPropertyNames(e.patternProperties):[]}(e,r):[]}function r(e,r){return[...new Set(t(e,r))]}e.ResolveKeys=r,e.ResolvePattern=function(e){return`^(${r(e,{includePatterns:!0}).map((e=>`(${function(e){return"^"===e[0]&&"$"===e[e.length-1]?e.slice(1,e.length-1):e}(e)})`)).join("|")})$`}}(l||(e.KeyResolver=l={}));class I extends N{}e.KeyArrayResolverError=I,function(e){e.Resolve=function(e){return Array.isArray(e)?e:i.TUnionLiteral(e)?e.anyOf.map((e=>e.const.toString())):i.TLiteral(e)?[e.const]:i.TTemplateLiteral(e)?(()=>{const t=g.ParseExact(e.pattern);if(!h.Check(t))throw new I("Cannot resolve keys from infinite template expression");return[...b.Generate(t)]})():[]}}(d||(e.KeyArrayResolver=d={})),function(t){function*r(t){for(const n of t.anyOf)"Union"===n[e.Kind]?yield*r(n):yield n}t.Resolve=function(t){return e.Type.Union([...r(t)],{...t})}}(f||(e.UnionResolver=f={}));class S extends N{}e.TemplateLiteralPatternError=S,function(t){function r(t,n){return i.TTemplateLiteral(t)?t.pattern.slice(1,t.pattern.length-1):i.TUnion(t)?`(${t.anyOf.map((e=>r(e,n))).join("|")})`:i.TNumber(t)||i.TInteger(t)||i.TBigInt(t)?`${n}${e.PatternNumber}`:i.TString(t)?`${n}${e.PatternString}`:i.TLiteral(t)?`${n}${o=t.const.toString(),o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`:i.TBoolean(t)?`${n}${e.PatternBoolean}`:function(e){throw new S(e)}(`Unexpected Kind '${t[e.Kind]}'`);var o}t.Create=function(e){return`^${e.map((e=>r(e,""))).join("")}$`}}(m||(e.TemplateLiteralPattern=m={})),function(t){t.Resolve=function(t){const r=g.ParseExact(t.pattern);if(!h.Check(r))return e.Type.String();const n=[...b.Generate(r)].map((t=>e.Type.Literal(t)));return e.Type.Union(n)}}(T||(e.TemplateLiteralResolver=T={}));class U extends N{}e.TemplateLiteralParserError=U,function(e){function t(e,t,r){return e[t]===r&&92!==e.charCodeAt(t-1)}function r(e,r){return t(e,r,"(")}function n(e,r){return t(e,r,")")}function i(e,r){return t(e,r,"|")}function o(e){return function(e){if(!r(e,0)||!n(e,e.length-1))return!1;let t=0;for(let i=0;i<e.length;i++)if(r(e,i)&&(t+=1),n(e,i)&&(t-=1),0===t&&i!==e.length-1)return!1;return!0}(e)?o(function(e){return e.slice(1,e.length-1)}(e)):function(e){let t=0;for(let o=0;o<e.length;o++)if(r(e,o)&&(t+=1),n(e,o)&&(t-=1),i(e,o)&&0===t)return!0;return!1}(e)?function(e){let[t,s]=[0,0];const a=[];for(let u=0;u<e.length;u++)if(r(e,u)&&(t+=1),n(e,u)&&(t-=1),i(e,u)&&0===t){const t=e.slice(s,u);t.length>0&&a.push(o(t)),s=u+1}const u=e.slice(s);return u.length>0&&a.push(o(u)),0===a.length?{type:"const",const:""}:1===a.length?a[0]:{type:"or",expr:a}}(e):function(e){for(let t=0;t<e.length;t++)if(r(e,t))return!0;return!1}(e)?function(e){function t(e,t){if(!r(e,t))throw new U("TemplateLiteralParser: Index must point to open parens");let i=0;for(let o=t;o<e.length;o++)if(r(e,o)&&(i+=1),n(e,o)&&(i-=1),0===i)return[t,o];throw new U("TemplateLiteralParser: Unclosed group parens in expression")}function i(e,t){for(let n=t;n<e.length;n++)if(r(e,n))return[t,n];return[t,e.length]}const s=[];for(let n=0;n<e.length;n++)if(r(e,n)){const[r,i]=t(e,n),a=e.slice(r,i+1);s.push(o(a)),n=i}else{const[t,r]=i(e,n),a=e.slice(t,r);a.length>0&&s.push(o(a)),n=r-1}return 0===s.length?{type:"const",const:""}:1===s.length?s[0]:{type:"and",expr:s}}(e):{type:"const",const:e}}e.Parse=o,e.ParseExact=function(e){return o(e.slice(1,e.length-1))}}(g||(e.TemplateLiteralParser=g={}));class x extends N{}e.TemplateLiteralFiniteError=x,function(e){e.Check=function e(t){return!!function(e){return"or"===e.type&&2===e.expr.length&&"const"===e.expr[0].type&&"true"===e.expr[0].const&&"const"===e.expr[1].type&&"false"===e.expr[1].const}(t)||!function(e){return"or"===e.type&&2===e.expr.length&&"const"===e.expr[0].type&&"0"===e.expr[0].const&&"const"===e.expr[1].type&&"[1-9][0-9]*"===e.expr[1].const}(t)&&!function(e){return"const"===e.type&&".*"===e.const}(t)&&("and"===t.type||"or"===t.type?t.expr.every((t=>e(t))):"const"===t.type||function(e){throw new x(e)}("Unknown expression type"))}}(h||(e.TemplateLiteralFinite=h={}));class j extends N{}e.TemplateLiteralGeneratorError=j,function(e){function*t(e){if(1===e.length)return yield*e[0];for(const r of e[0])for(const n of t(e.slice(1)))yield`${r}${n}`}function*r(e){return yield*t(e.expr.map((e=>[...n(e)])))}function*n(e){return"and"===e.type?yield*r(e):"or"===e.type?yield*function*(e){for(const t of e.expr)yield*n(t)}(e):"const"===e.type?yield*function*(e){return yield e.const}(e):(()=>{throw new j("Unknown expression")})()}e.Generate=n}(b||(e.TemplateLiteralGenerator=b={})),function(t){function*r(t){const r=t.trim().replace(/"|'/g,"");return"boolean"===r?yield e.Type.Boolean():"number"===r?yield e.Type.Number():"bigint"===r?yield e.Type.BigInt():"string"===r?yield e.Type.String():yield(()=>{const t=r.split("|").map((t=>e.Type.Literal(t.trim())));return 0===t.length?e.Type.Never():1===t.length?t[0]:e.Type.Union(t)})()}function*n(t){if("{"!==t[1]){const r=e.Type.Literal("$"),n=i(t.slice(1));return yield*[r,...n]}for(let e=2;e<t.length;e++)if("}"===t[e]){const n=r(t.slice(2,e)),o=i(t.slice(e+1));return yield*[...n,...o]}yield e.Type.Literal(t)}function*i(t){for(let r=0;r<t.length;r++)if("$"===t[r]){const i=e.Type.Literal(t.slice(0,r)),o=n(t.slice(r));return yield*[i,...o]}yield e.Type.Literal(t)}t.Parse=function(e){return[...i(e)]}}(v||(e.TemplateLiteralDslParser=v={}));class w{constructor(e){this.schema=e}Decode(e){return new L(this.schema,e)}}e.TransformDecodeBuilder=w;class L{constructor(e,t){this.schema=e,this.decode=t}Encode(t){const r=u.Type(this.schema);return i.TTransform(r)?(()=>{const n={Encode:n=>r[e.Transform].Encode(t(n)),Decode:t=>this.decode(r[e.Transform].Decode(t))};return{...r,[e.Transform]:n}})():(()=>{const n={Decode:this.decode,Encode:t};return{...r,[e.Transform]:n}})()}}e.TransformEncodeBuilder=L;let P=0;class _ extends N{}e.TypeBuilderError=_;class A{Create(e){return e}Throw(e){throw new _(e)}Discard(e,t){const{[t]:r,...n}=e;return n}Strict(e){return JSON.parse(JSON.stringify(e))}}e.TypeBuilder=A;class B extends A{ReadonlyOptional(e){return this.Readonly(this.Optional(e))}Readonly(t){return{...u.Type(t),[e.Readonly]:"Readonly"}}Optional(t){return{...u.Type(t),[e.Optional]:"Optional"}}Any(t={}){return this.Create({...t,[e.Kind]:"Any"})}Array(t,r={}){return this.Create({...r,[e.Kind]:"Array",type:"array",items:u.Type(t)})}Boolean(t={}){return this.Create({...t,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(e,t={}){return{...c.Map(u.Type(e),"Capitalize"),...t}}Composite(t,r){const n=e.Type.Intersect(t,{}),i=l.ResolveKeys(n,{includePatterns:!1}).reduce(((t,r)=>({...t,[r]:e.Type.Index(n,[r])})),{});return e.Type.Object(i,r)}Enum(t,r={}){const i=Object.getOwnPropertyNames(t).filter((e=>isNaN(e))).map((e=>t[e])).map((t=>n.IsString(t)?{[e.Kind]:"Literal",type:"string",const:t}:{[e.Kind]:"Literal",type:"number",const:t}));return this.Create({...r,[e.Kind]:"Union",anyOf:i})}Extends(e,t,r,n,i={}){switch(a.Extends(e,t)){case s.Union:return this.Union([u.Type(r,i),u.Type(n,i)]);case s.True:return u.Type(r,i);case s.False:return u.Type(n,i)}}Exclude(e,t,r={}){return i.TTemplateLiteral(e)?this.Exclude(T.Resolve(e),t,r):i.TTemplateLiteral(t)?this.Exclude(e,T.Resolve(t),r):i.TUnion(e)?(()=>{const n=e.anyOf.filter((e=>a.Extends(e,t)===s.False));return 1===n.length?u.Type(n[0],r):this.Union(n,r)})():a.Extends(e,t)!==s.False?this.Never(r):u.Type(e,r)}Extract(e,t,r={}){return i.TTemplateLiteral(e)?this.Extract(T.Resolve(e),t,r):i.TTemplateLiteral(t)?this.Extract(e,T.Resolve(t),r):i.TUnion(e)?(()=>{const n=e.anyOf.filter((e=>a.Extends(e,t)!==s.False));return 1===n.length?u.Type(n[0],r):this.Union(n,r)})():a.Extends(e,t)!==s.False?u.Type(e,r):this.Never(r)}Index(e,t,r={}){return i.TArray(e)&&i.TNumber(t)?u.Type(e.items,r):i.TTuple(e)&&i.TNumber(t)?(()=>{const t=(n.IsUndefined(e.items)?[]:e.items).map((e=>u.Type(e)));return this.Union(t,r)})():(()=>{const n=d.Resolve(t),i=u.Type(e);return p.Resolve(i,n,r)})()}Integer(t={}){return this.Create({...t,[e.Kind]:"Integer",type:"integer"})}Intersect(t,r={}){if(0===t.length)return e.Type.Never();if(1===t.length)return u.Type(t[0],r);t.some((e=>i.TTransform(e)))&&this.Throw("Cannot intersect transform types");const n=t.every((e=>i.TObject(e))),o=u.Rest(t),s=i.TSchema(r.unevaluatedProperties)?{unevaluatedProperties:u.Type(r.unevaluatedProperties)}:{};return!1===r.unevaluatedProperties||i.TSchema(r.unevaluatedProperties)||n?this.Create({...r,...s,[e.Kind]:"Intersect",type:"object",allOf:o}):this.Create({...r,...s,[e.Kind]:"Intersect",allOf:o})}KeyOf(t,r={}){return i.TRecord(t)?(()=>{const n=Object.getOwnPropertyNames(t.patternProperties)[0];return n===e.PatternNumberExact?this.Number(r):n===e.PatternStringExact?this.String(r):this.Throw("Unable to resolve key type from Record key pattern")})():i.TTuple(t)?(()=>{const i=(n.IsUndefined(t.items)?[]:t.items).map(((t,r)=>e.Type.Literal(r.toString())));return this.Union(i,r)})():i.TArray(t)?(()=>this.Number(r))():(()=>{const e=l.ResolveKeys(t,{includePatterns:!1});if(0===e.length)return this.Never(r);const n=e.map((e=>this.Literal(e)));return this.Union(n,r)})()}Literal(t,r={}){return this.Create({...r,[e.Kind]:"Literal",const:t,type:typeof t})}Lowercase(e,t={}){return{...c.Map(u.Type(e),"Lowercase"),...t}}Never(t={}){return this.Create({...t,[e.Kind]:"Never",not:{}})}Not(t,r){return this.Create({...r,[e.Kind]:"Not",not:u.Type(t)})}Null(t={}){return this.Create({...t,[e.Kind]:"Null",type:"null"})}Number(t={}){return this.Create({...t,[e.Kind]:"Number",type:"number"})}Object(t,r={}){const n=Object.getOwnPropertyNames(t),o=n.filter((e=>i.TOptional(t[e]))),s=n.filter((e=>!o.includes(e))),a=i.TSchema(r.additionalProperties)?{additionalProperties:u.Type(r.additionalProperties)}:{},p=n.reduce(((e,r)=>({...e,[r]:u.Type(t[r])})),{});return s.length>0?this.Create({...r,...a,[e.Kind]:"Object",type:"object",properties:p,required:s}):this.Create({...r,...a,[e.Kind]:"Object",type:"object",properties:p})}Omit(t,r,i={}){const o=d.Resolve(r);return y.Map(this.Discard(u.Type(t),e.Transform),(e=>{n.IsArray(e.required)&&(e.required=e.required.filter((e=>!o.includes(e))),0===e.required.length&&delete e.required);for(const t of Object.getOwnPropertyNames(e.properties))o.includes(t)&&delete e.properties[t];return this.Create(e)}),i)}Partial(t,r={}){return y.Map(this.Discard(u.Type(t),e.Transform),(e=>{const t=Object.getOwnPropertyNames(e.properties).reduce(((t,r)=>({...t,[r]:this.Optional(e.properties[r])})),{});return this.Object(t,this.Discard(e,"required"))}),r)}Pick(t,r,i={}){const o=d.Resolve(r);return y.Map(this.Discard(u.Type(t),e.Transform),(e=>{n.IsArray(e.required)&&(e.required=e.required.filter((e=>o.includes(e))),0===e.required.length&&delete e.required);for(const t of Object.getOwnPropertyNames(e.properties))o.includes(t)||delete e.properties[t];return this.Create(e)}),i)}Record(t,r,o={}){return i.TTemplateLiteral(t)?(()=>{const n=g.ParseExact(t.pattern);return h.Check(n)?this.Object([...b.Generate(n)].reduce(((e,t)=>({...e,[t]:u.Type(r)})),{}),o):this.Create({...o,[e.Kind]:"Record",type:"object",patternProperties:{[t.pattern]:u.Type(r)}})})():i.TUnion(t)?(()=>{const n=f.Resolve(t);if(i.TUnionLiteral(n)){const t=n.anyOf.reduce(((e,t)=>({...e,[t.const]:u.Type(r)})),{});return this.Object(t,{...o,[e.Hint]:"Record"})}this.Throw("Record key of type union contains non-literal types")})():i.TLiteral(t)?(()=>n.IsString(t.const)||n.IsNumber(t.const)?this.Object({[t.const]:u.Type(r)},o):this.Throw("Record key of type literal is not of type string or number"))():i.TInteger(t)||i.TNumber(t)?(()=>this.Create({...o,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:u.Type(r)}}))():i.TString(t)?(()=>{const i=n.IsUndefined(t.pattern)?e.PatternStringExact:t.pattern;return this.Create({...o,[e.Kind]:"Record",type:"object",patternProperties:{[i]:u.Type(r)}})})():this.Never()}Recursive(t,r={}){n.IsUndefined(r.$id)&&(r.$id="T"+P++);const i=t({[e.Kind]:"This",$ref:`${r.$id}`});return i.$id=r.$id,this.Create({...r,[e.Hint]:"Recursive",...i})}Ref(t,r={}){return n.IsString(t)?this.Create({...r,[e.Kind]:"Ref",$ref:t}):(n.IsUndefined(t.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({...r,[e.Kind]:"Ref",$ref:t.$id}))}Required(t,r={}){return y.Map(this.Discard(u.Type(t),e.Transform),(t=>{const r=Object.getOwnPropertyNames(t.properties).reduce(((r,n)=>({...r,[n]:this.Discard(t.properties[n],e.Optional)})),{});return this.Object(r,t)}),r)}Rest(e){return i.TTuple(e)&&!n.IsUndefined(e.items)?u.Rest(e.items):i.TIntersect(e)?u.Rest(e.allOf):i.TUnion(e)?u.Rest(e.anyOf):[]}String(t={}){return this.Create({...t,[e.Kind]:"String",type:"string"})}TemplateLiteral(t,r={}){const i=n.IsString(t)?m.Create(v.Parse(t)):m.Create(t);return this.Create({...r,[e.Kind]:"TemplateLiteral",type:"string",pattern:i})}Transform(e){return new w(e)}Tuple(t,r={}){const[n,i,o]=[!1,t.length,t.length],s=u.Rest(t),a=t.length>0?{...r,[e.Kind]:"Tuple",type:"array",items:s,additionalItems:n,minItems:i,maxItems:o}:{...r,[e.Kind]:"Tuple",type:"array",minItems:i,maxItems:o};return this.Create(a)}Uncapitalize(e,t={}){return{...c.Map(u.Type(e),"Uncapitalize"),...t}}Union(t,r={}){return i.TTemplateLiteral(t)?T.Resolve(t):(()=>{const n=t;if(0===n.length)return this.Never(r);if(1===n.length)return this.Create(u.Type(n[0],r));const i=u.Rest(n);return this.Create({...r,[e.Kind]:"Union",anyOf:i})})()}Unknown(t={}){return this.Create({...t,[e.Kind]:"Unknown"})}Unsafe(t={}){return this.Create({...t,[e.Kind]:t[e.Kind]||"Unsafe"})}Uppercase(e,t={}){return{...c.Map(u.Type(e),"Uppercase"),...t}}}e.JsonTypeBuilder=B;class E extends B{AsyncIterator(t,r={}){return this.Create({...r,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:u.Type(t)})}Awaited(t,r={}){const n=e=>e.length>0?(()=>{const[t,...r]=e;return[this.Awaited(t),...n(r)]})():e;return i.TIntersect(t)?e.Type.Intersect(n(t.allOf)):i.TUnion(t)?e.Type.Union(n(t.anyOf)):i.TPromise(t)?this.Awaited(t.item):u.Type(t,r)}BigInt(t={}){return this.Create({...t,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(e,t={}){return this.Tuple([...e.parameters],{...t})}Constructor(t,r,n){const[i,o]=[u.Rest(t),u.Type(r)];return this.Create({...n,[e.Kind]:"Constructor",type:"Constructor",parameters:i,returns:o})}Date(t={}){return this.Create({...t,[e.Kind]:"Date",type:"Date"})}Function(t,r,n){const[i,o]=[u.Rest(t),u.Type(r)];return this.Create({...n,[e.Kind]:"Function",type:"Function",parameters:i,returns:o})}InstanceType(e,t={}){return u.Type(e.returns,t)}Iterator(t,r={}){return this.Create({...r,[e.Kind]:"Iterator",type:"Iterator",items:u.Type(t)})}Parameters(e,t={}){return this.Tuple(e.parameters,{...t})}Promise(t,r={}){return this.Create({...r,[e.Kind]:"Promise",type:"Promise",item:u.Type(t)})}RegExp(t,r={}){const i=n.IsString(t)?t:t.source;return this.Create({...r,[e.Kind]:"String",type:"string",pattern:i})}RegEx(e,t={}){return this.RegExp(e,t)}ReturnType(e,t={}){return u.Type(e.returns,t)}Symbol(t){return this.Create({...t,[e.Kind]:"Symbol",type:"symbol"})}Undefined(t={}){return this.Create({...t,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(t={}){return this.Create({...t,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(t={}){return this.Create({...t,[e.Kind]:"Void",type:"void"})}}e.JavaScriptTypeBuilder=E,e.JsonType=new B,e.Type=new E}(a);var u="^$|^GHA-\\d{9}-\\d{1}$",p="^[a-zA-Z0-9]*$",c=function(){var e,t=a.Type.String({pattern:"^[a-zA-Z0-9]*$"}),r=a.Type.String({format:"date",formatMaximum:(new Date).toISOString().split("T")[0]}),n=a.Type.String({format:"date",formatMinimum:(new Date).toISOString().split("T")[0]}),i=a.Type.String({pattern:u}),o=a.Type.String({minLength:1});return[{category:"financial_information",type:"mtn_statement",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({msisdn:a.Type.String({pattern:"^233[0-9]{9}$"}),accountHolderName:o,from:a.Type.String({format:"date"}),to:a.Type.String({format:"date"}),timeRun:a.Type.String({format:"date-time"})})},{category:"financial_information",type:"bank_statement",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({issuer:(e=["Absa Bank Ghana Limited","Access Bank Ghana Plc","Agricultural Development Bank of Ghana","Bank of Africa Ghana Limited","CalBank Limited","Consolidated Bank Ghana Limited","Ecobank Ghana Limited","FBN Bank Ghana Limited","Fidelity Bank Ghana Limited","First Atlantic Bank Limited","First National Bank Ghana","GCB Bank Limited","Guaranty Trust Bank Ghana Limited","National Investment Bank Limited","OmniBSIC Bank Ghana Limited","Prudential Bank Limited","Republic Bank Ghana","Societe Generale Ghana Limited","Stanbic Bank Ghana Limited","Standard Chartered Bank Ghana Limited","United Bank for Africa Ghana Limited","Zenith Bank Ghana Limited"],a.Type.Unsafe({type:"string",enum:e})),printDate:a.Type.String({format:"date-time"}),accountHolderName:o,from:a.Type.String({format:"date"}),to:a.Type.String({format:"date"}),accountNumber:a.Type.Optional(a.Type.String())})},{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:u},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:u},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:u},docNumber:{type:"string",pattern:p},userAddress:{type:"string"},physicalAddress:{type:"string"},rentalAmount:{type:"number"},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:u},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:u},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:u},docNumber:{type:"string",pattern:p},userAddress:{type:"string"},physicalAddress:{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:u},docNumber:{type:"string",pattern:p},userAddress:{type:"string"},physicalAddress:{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:u},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:u},docNumber:{type:"string",pattern:p},userAddress:{type:"string"},physicalAddress:{type:"string"},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:u},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:u},docNumber:{type:"string",pattern:p},employeeName:{type:"string"},position:{type:"string"},issuingDate:{type:"string",format:"date"},salaryAmount:{type:"number"}}}},{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:u},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:u},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:u},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_3",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:u},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_4",issuer:{type:"private",country:"GH"},issuingVersion:1,version:1,propertiesSchema:{type:"object",properties:{nationalIdNumber:{type:"string",pattern:u},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:a.Type.Object({businessName:a.Type.String(),taxIdNumber:t,registrationNumber:t,issueDate:r})},{category:"proof_of_registration",type:"operating_permit",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),registrationNumber:a.Type.Optional(t),issueDate:r,expirationDate:n})},{category:"proof_of_registration",type:"district_assembly_certificate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({certificateNumber:t,businessName:t,registrationNumber:a.Type.Optional(t),issueDate:r})},{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"}}}},{category:"proof_of_ownership",type:"form_a",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),registrationNumber:t,taxIdNumber:t,issueDate:r,firstName:a.Type.String(),middleName:a.Type.Optional(a.Type.String()),lastName:a.Type.String(),dateOfBirth:r,nationalIdNumber:i})},{category:"proof_of_ownership",type:"permit",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),issueDate:r})},{category:"proof_of_ownership",type:"property_rate",issuer:{country:"GH"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),issueDate:r})}]},y={GH:c,CA:function(){return[{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"}}}}]},UG:function(){var e=a.Type.String({pattern:"^[a-zA-Z0-9]*$"}),t=a.Type.String({format:"date",formatMaximum:(new Date).toISOString().split("T")[0]}),r=function(e){return a.Type.Unsafe({type:"string",enum:e})},n=a.Type.String({minLength:1});return[{category:"proof_of_registration",type:"certificate_of_registration",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),registrationNumber:e,issueDate:t})},{category:"proof_of_registration",type:"trade_license",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({businessName:a.Type.String(),registrationNumber:e,issuer:r(["KCCA","Other"]),expirationDate:a.Type.Optional(t)})},{category:"proof_of_registration",type:"association_letter",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({isOwnerNameOnDocument:a.Type.Boolean(),isValidIssuer:a.Type.Boolean(),isDocumentStampedAndValid:a.Type.Boolean(),issueDate:t})},{category:"business_ownership",type:"business_registration_form",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({registrationNumber:e,businessName:a.Type.String(),taxIdNumber:a.Type.String(),issueDate:t,ownerName:a.Type.String()})},{category:"financial_information",type:"mtn_statement",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({dateOfStatement:a.Type.String({format:"date-time"}),from:a.Type.String({format:"date"}),to:a.Type.String({format:"date"}),mobileNumber:a.Type.String({pattern:"^233[0-9]{9}$"}),accountHolderName:n})},{category:"financial_information",type:"airtel_statement",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({from:a.Type.String({format:"date"}),to:a.Type.String({format:"date"}),mobileNumber:a.Type.String({pattern:"^233[0-9]{9}$"}),accountHolderName:n})},{category:"financial_information",type:"bank_statement",issuer:{country:"UG"},issuingVersion:1,version:1,propertiesSchema:a.Type.Object({bankName:r(["ABC Bank Uganda Limited","Absa Bank Uganda Limited","Bank of Africa Uganda Limited","Bank of Baroda Uganda Limited","Bank of India Uganda Limited","Cairo Bank Uganda","Centenary Bank","Citibank Uganda","DFCU Bank","Diamond Trust Bank","Ecobank Uganda","Equity Bank Uganda Limited","Exim Bank (Uganda)","Finance Trust Bank","Guaranty Trust Bank","Housing Finance Bank","I&M Bank Uganda","KCB Bank Uganda Limited","NCBA Bank Uganda","Opportunity Bank Uganda Limited","PostBank Uganda","Stanbic Bank Uganda Limited","Standard Chartered Uganda","Tropical Bank","United Bank for Africa","Other"]),printDate:a.Type.Optional(a.Type.String({format:"date"})),from:a.Type.String({format:"date"}),to:a.Type.String({format:"date"}),accountHolderName:n,accountNumber:a.Type.Optional(a.Type.String())})}]}};e.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"]},e.getDocumentId=function(e,t){var r;if(void 0===t&&(t=!0),t&&null!=e&&e.id)return e.id;var n=(null==e?void 0:e.category)+"-"+(null==e?void 0:e.type)+"-"+(null==e||null==(r=e.issuer)?void 0:r.country);return e.version&&(n=n+"-v"+e.version),n.toLowerCase()},e.getDocumentsByCountry=function(e){var t;return(null==(t=y[e])?void 0:t.call(y))||[]},e.getGhanaDocuments=c,e.handlePromise=i,e.isEmptyObject=function(e){return o(e)&&0===Object.keys(e).length},e.isErrorWithCode=function(e){return o(e)&&"code"in e&&"number"==typeof e.code},e.isErrorWithMessage=function(e){return o(e)&&"message"in e&&"string"==typeof e.message},e.isErrorWithName=function(e){return o(e)&&"name"in e&&"string"==typeof e.name},e.isFunction=function(e){return"function"==typeof e},e.isNullish=function(e){return null==e},e.isObject=o,e.noNullish=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((function(e,t,n){var i,o=null!=(i=r[n])?i:"";return e+t+String(o)}),"").replace(/\s+/g," ")},e.sleep=s,e.uniqueArray=function(e){return Array.from(new Set(e))},e.zodErrorToReadable=function(e){return e.issues.map((function(e){var t;return(null==(t=e.path)?void 0:t.join("."))+": "+e.message})).join("\n")},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map

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

"author": "Ballerine <dev@ballerine.com>",
"version": "0.6.2",
"version": "0.6.3",
"description": "common",

@@ -35,2 +35,3 @@ "module": "./dist/esm/index.js",

"@types/json-logic-js": "^2.0.1",
"@types/json-schema": "^7.0.12",
"@types/node": "^18.14.0",

@@ -64,2 +65,3 @@ "@typescript-eslint/eslint-plugin": "^5.48.1",

"dependencies": {
"@sinclair/typebox": "^0.31.7",
"ajv": "^8.12.0",

@@ -66,0 +68,0 @@ "json-schema-to-zod": "^0.6.3"

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc