b23-lib 3.2.4 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Classes/Cart.mjs +1 -1
- package/dist/Classes/Order.mjs +1 -1
- package/dist/Classes/ShoppingContainer.mjs +1 -1
- package/dist/{chunk-VTBHWXR4.mjs → chunk-3TUSUSXQ.mjs} +2 -2
- package/dist/{chunk-VTBHWXR4.mjs.map → chunk-3TUSUSXQ.mjs.map} +1 -1
- package/dist/index.d.mts +48 -1
- package/dist/index.d.ts +48 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export{d as Fetch,b as Logger,c as ResponseUtility}from'./chunk-AMIRIUMH.mjs';import {b}from'./chunk-MHLRJ4IJ.mjs';export{a as Utils}from'./chunk-MHLRJ4IJ.mjs';import'./chunk-FCRJAAPY.mjs';import'./chunk-2B2XI6FG.mjs';import'./chunk-LI5JQ6UC.mjs';import {j,a,b as b$1,c as
|
|
2
|
-
export{
|
|
1
|
+
import {b as b$2}from'./chunk-AMIRIUMH.mjs';export{d as Fetch,b as Logger,c as ResponseUtility}from'./chunk-AMIRIUMH.mjs';import {b}from'./chunk-MHLRJ4IJ.mjs';export{a as Utils}from'./chunk-MHLRJ4IJ.mjs';import'./chunk-FCRJAAPY.mjs';import'./chunk-2B2XI6FG.mjs';import'./chunk-LI5JQ6UC.mjs';import {j,a,b as b$1,c,d as d$1}from'./chunk-QK4XJ3GB.mjs';import'./chunk-R5DM7WCD.mjs';import'./chunk-UXZBULDS.mjs';var l={$id:"standards",definitions:{lowercaseText:{type:"string",pattern:"^(?!\\s)(?!.*\\s$)[a-z]*$"},lowercaseText10:{type:"string",pattern:"^(?!\\s)(?!.*\\s$)[a-z]{0,10}$"},lowercaseText16:{type:"string",pattern:"^(?!\\s)(?!.*\\s$)[a-z]{0,16}$"},lowercaseText30:{type:"string",pattern:"^(?!\\s)(?!.*\\s$)[a-z]{0,30}$"},lowercaseText50:{type:"string",pattern:"^(?!\\s)(?!.*\\s$)[a-z]{0,50}$"},lowercaseText256:{type:"string",pattern:"^(?!\\s)(?!.*\\s$)[a-z]{0,256}$"},text:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).*$"},text10:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).{0,10}$"},text16:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).{0,16}$"},text30:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).{0,30}$"},text50:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).{0,50}$"},text256:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).{0,256}$"},requiredText:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).+$"},requiredText10:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).{1,10}$"},requiredText16:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).{1,16}$"},requiredText30:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).{1,30}$"},requiredText50:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).{1,50}$"},requiredText256:{type:"string",pattern:"^(?!\\s)(?!.*\\s$).{1,256}$"},url:{type:"string",pattern:"^https://[^\\s/$.?#].[^\\s]*$",maxLength:2048},uuid:{type:"string",minLength:1,pattern:"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"},productKey:{type:"string",pattern:b.productKeyRegex.source},productSku:{type:"string",pattern:b.productSKURegex.source},genderCategory:{type:"string",enum:Object.values(j)},price:{type:"object",properties:{amount:{type:"number",minimum:0},currency:{$ref:"#/definitions/currency"}},additionalProperties:!1,required:["amount","currency"]},color:{type:"object",properties:{name:{type:"string"},hex:{type:"string"}},additionalProperties:!1,required:["name"]},attributeValue:{oneOf:[{type:"string"},{$ref:"#/definitions/color"}]},selectionAttributes:{type:"object",properties:{color:{$ref:"#/definitions/color"}},required:["color"],additionalProperties:{$ref:"#/definitions/attributeValue"}},firstName:{$ref:"#/definitions/requiredText30"},lastName:{$ref:"#/definitions/text30"},company:{$ref:"#/definitions/text50"},phone:{type:"string",pattern:"^[0-9]{10}$"},email:{type:"string",pattern:"^[^\\s]+@[^\\s]+\\.[^\\s]+$"},addressLine1:{$ref:"#/definitions/requiredText50"},addressLine2:{$ref:"#/definitions/text50"},city:{$ref:"#/definitions/requiredText30"},postalCode:{$ref:"#/definitions/requiredText16"},state:{type:"string",enum:["AP","AR","AS","BR","CT","GA","GJ","HR","HP","JH","KA","KL","MP","MH","MN","ML","MZ","NL","OR","PB","RJ","SK","TN","TG","TR","UP","UT","WB","AN","CH","DH","LD","DL","PY","LA","JK"]},country:{type:"string",enum:Object.values(a)},currency:{type:"string",enum:Object.values(b$1)},locale:{type:"string",enum:Object.values(c)},language:{type:"string",enum:Object.values(d$1)},localeOrLanguage:{type:"string",enum:[...Object.values(c),...Object.values(d$1)]},addressType:{type:"string",enum:["shipping","billing","billing&shipping"]},address:{type:"object",properties:{firstName:{$ref:"standards#/definitions/firstName"},lastName:{$ref:"standards#/definitions/lastName"},company:{$ref:"standards#/definitions/company"},phone:{$ref:"standards#/definitions/phone"},email:{$ref:"standards#/definitions/email"},addressLine1:{$ref:"standards#/definitions/addressLine1"},addressLine2:{$ref:"standards#/definitions/addressLine2"},city:{$ref:"standards#/definitions/city"},postalCode:{$ref:"standards#/definitions/postalCode"},state:{$ref:"standards#/definitions/state"},country:{$ref:"standards#/definitions/country"}},required:["firstName","lastName","phone","email","addressLine1","postalCode","state","country"]}}};var $={getStandardSchemaDefinition(){return l}},h=$;var d=class{cache=new Map;maxSize;ttl;cleanupInterval;constructor(e=1e3,t=5*60*1e3){if(!Number.isFinite(e)||e<1)throw new RangeError("maxSize must be a finite number greater than or equal to 1.");if(!Number.isFinite(t)||t<1)throw new RangeError("ttl must be a finite number greater than or equal to 1.");this.maxSize=e,this.ttl=t,this.cleanupInterval=setInterval(()=>this.cleanup(),60*1e3),this.cleanupInterval.unref&&this.cleanupInterval.unref();}cleanup(){let e=Date.now();for(let[t,r]of this.cache.entries())e>=r.expiry&&this.cache.delete(t);}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r);}this.cache.set(e,{value:t,expiry:Date.now()+this.ttl});}get(e){let t=this.cache.get(e);if(t){if(Date.now()>=t.expiry){this.cache.delete(e);return}return this.cache.delete(e),b$2.logMessage("MemoryCache.get",`Successfully read cache data for key: ${e}`),this.cache.set(e,t),t.value}}dispose(){clearInterval(this.cleanupInterval);}},x=d;
|
|
2
|
+
export{x as MemoryCache,h as Schema};//# sourceMappingURL=index.mjs.map
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Schema/definition.ts","../src/Schema/index.ts"],"names":["definition_default","ProductModel","GenderCategory","OperationalCountry","OperationalCountryCurrency","OperationalLocale","OperationalLanguage","Schema","Schema_default"],"mappings":"4WAGA,IAAOA,CAAQ,CAAA,CACb,GAAO,CAAA,WAAA,CACP,WAAe,CAAA,CACX,aAAiB,CAAA,CACb,IAAQ,CAAA,QAAA,CACR,OAAW,CAAA,2BACf,CACA,CAAA,eAAA,CAAmB,CACf,IAAA,CAAQ,QACR,CAAA,OAAA,CAAW,gCACf,CAAA,CACA,eAAmB,CAAA,CACf,IAAQ,CAAA,QAAA,CACR,OAAW,CAAA,gCACf,CACA,CAAA,eAAA,CAAmB,CACf,IAAA,CAAQ,QACR,CAAA,OAAA,CAAW,gCACf,CAAA,CACA,eAAmB,CAAA,CACf,IAAQ,CAAA,QAAA,CACR,OAAW,CAAA,gCACf,CACA,CAAA,gBAAA,CAAoB,CAChB,IAAA,CAAQ,QACR,CAAA,OAAA,C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CAAA,MAAA,CAAOD,GAAiB,CAAA,CAAG,GAAG,MAAA,CAAO,MAAOC,CAAAA,CAAmB,CAAC,CACxF,CACA,CAAA,WAAA,CAAe,CACX,IAAA,CAAQ,QACR,CAAA,IAAA,CAAQ,CAAC,UAAA,CAAY,SAAW,CAAA,kBAAkB,CACtD,CAAA,CACA,OAAW,CAAA,CACP,IAAQ,CAAA,QAAA,CACR,UAAc,CAAA,CACV,SAAa,CAAA,CAAC,IAAQ,CAAA,kCAAkC,CACxD,CAAA,QAAA,CAAY,CAAE,IAAA,CAAQ,iCAAkC,CAAA,CACxD,OAAW,CAAA,CAAE,IAAQ,CAAA,gCAAiC,CACtD,CAAA,KAAA,CAAS,CAAE,IAAA,CAAQ,8BAA+B,CAAA,CAClD,KAAS,CAAA,CAAE,IAAQ,CAAA,8BAA+B,CAClD,CAAA,YAAA,CAAgB,CAAE,IAAA,CAAQ,qCAAsC,CAAA,CAChE,YAAgB,CAAA,CAAE,IAAQ,CAAA,qCAAsC,CAChE,CAAA,IAAA,CAAQ,CAAE,IAAA,CAAQ,6BAA8B,CAAA,CAChD,UAAc,CAAA,CAAE,IAAQ,CAAA,mCAAoC,CAC5D,CAAA,KAAA,CAAS,CAAE,IAAA,CAAQ,8BAA+B,CAAA,CAClD,OAAW,CAAA,CAAE,IAAQ,CAAA,gCAAiC,CAC1D,CAAA,CACA,QAAY,CAAA,CAAC,WAAa,CAAA,UAAA,CAAY,OAAS,CAAA,OAAA,CAAS,cAAgB,CAAA,YAAA,CAAc,OAAS,CAAA,SAAS,CAC5G,CACJ,CACF,CAAA,CCzMMC,IAAAA,CAAAA,CAAS,CACb,2BAAA,EAA8B,CAC5B,OAAOP,CACT,CACF,EAEOQ,CAAQD,CAAAA","file":"index.mjs","sourcesContent":["import { GenderCategory, OperationalCountry, OperationalCountryCurrency, OperationalLanguage, OperationalLocale } from \"../Classes/Enum\";\r\nimport ProductModel from \"../Classes/Product\";\r\n\r\nexport default {\r\n \"$id\": \"standards\",\r\n \"definitions\": {\r\n \"lowercaseText\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]*$\"\r\n },\r\n \"lowercaseText10\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]{0,10}$\"\r\n },\r\n \"lowercaseText16\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]{0,16}$\"\r\n },\r\n \"lowercaseText30\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]{0,30}$\"\r\n },\r\n \"lowercaseText50\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]{0,50}$\"\r\n },\r\n \"lowercaseText256\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]{0,256}$\"\r\n },\r\n \"text\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).*$\"\r\n },\r\n \"text10\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{0,10}$\"\r\n },\r\n \"text16\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{0,16}$\"\r\n },\r\n \"text30\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{0,30}$\"\r\n },\r\n \"text50\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{0,50}$\"\r\n },\r\n \"text256\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{0,256}$\"\r\n },\r\n \"requiredText\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).+$\"\r\n },\r\n \"requiredText10\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{1,10}$\"\r\n },\r\n \"requiredText16\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{1,16}$\"\r\n },\r\n \"requiredText30\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{1,30}$\"\r\n },\r\n \"requiredText50\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{1,50}$\"\r\n },\r\n \"requiredText256\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{1,256}$\"\r\n },\r\n \"url\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^https://[^\\\\s/$.?#].[^\\\\s]*$\",\r\n \"maxLength\": 2048\r\n },\r\n \"uuid\": {\r\n \"type\": \"string\",\r\n \"minLength\": 1,\r\n \"pattern\": \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\"\r\n },\r\n \"productKey\": {\r\n \"type\": \"string\",\r\n \"pattern\": ProductModel.productKeyRegex.source\r\n },\r\n \"productSku\": {\r\n \"type\": \"string\",\r\n \"pattern\": ProductModel.productSKURegex.source\r\n },\r\n \"genderCategory\": {\r\n \"type\": \"string\",\r\n \"enum\": Object.values(GenderCategory)\r\n },\r\n \"price\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"amount\": { \"type\": \"number\", \"minimum\": 0 },\r\n \"currency\": { \"$ref\": \"#/definitions/currency\" }\r\n },\r\n \"additionalProperties\": false,\r\n \"required\": [\"amount\", \"currency\"]\r\n },\r\n \"color\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"name\": {\r\n \"type\": \"string\"\r\n },\r\n \"hex\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false,\r\n \"required\": [\r\n \"name\"\r\n ]\r\n },\r\n \"attributeValue\": {\r\n \"oneOf\": [\r\n { \"type\": \"string\" },\r\n {\r\n \"$ref\": \"#/definitions/color\"\r\n }\r\n ]\r\n },\r\n \"selectionAttributes\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"color\": { \"$ref\": \"#/definitions/color\" }\r\n },\r\n \"required\": [\"color\"],\r\n \"additionalProperties\": {\r\n \"$ref\": \"#/definitions/attributeValue\"\r\n }\r\n },\r\n \"firstName\": { \"$ref\": \"#/definitions/requiredText30\" },\r\n \"lastName\": { \"$ref\": \"#/definitions/text30\" },\r\n \"company\": { \"$ref\": \"#/definitions/text50\" },\r\n \"phone\": { \r\n \"type\" : \"string\",\r\n \"pattern\": \"^[0-9]{10}$\"\r\n },\r\n \"email\": { \r\n \"type\" : \"string\",\r\n \"pattern\": \"^[^\\\\s]+@[^\\\\s]+\\\\.[^\\\\s]+$\"\r\n },\r\n \"addressLine1\": { \"$ref\": \"#/definitions/requiredText50\" },\r\n \"addressLine2\": { \"$ref\": \"#/definitions/text50\" },\r\n \"city\": { \"$ref\": \"#/definitions/requiredText30\" },\r\n \"postalCode\": { \"$ref\": \"#/definitions/requiredText16\" },\r\n \"state\": {\r\n \"type\": \"string\",\r\n \"enum\": [\"AP\", \"AR\", \"AS\", \"BR\", \"CT\", \"GA\", \"GJ\", \"HR\", \"HP\", \"JH\", \"KA\", \"KL\", \"MP\", \"MH\", \"MN\", \"ML\", \"MZ\", \"NL\", \"OR\", \"PB\", \"RJ\", \"SK\", \"TN\", \"TG\", \"TR\", \"UP\", \"UT\", \"WB\", \"AN\", \"CH\", \"DH\", \"LD\", \"DL\", \"PY\", \"LA\", \"JK\"]\r\n },\r\n \"country\": {\r\n \"type\": \"string\",\r\n \"enum\": Object.values(OperationalCountry)\r\n },\r\n \"currency\": {\r\n \"type\": \"string\",\r\n \"enum\": Object.values(OperationalCountryCurrency)\r\n },\r\n \"locale\": {\r\n \"type\": \"string\",\r\n \"enum\": Object.values(OperationalLocale)\r\n },\r\n \"language\": {\r\n \"type\": \"string\",\r\n \"enum\": Object.values(OperationalLanguage)\r\n },\r\n \"localeOrLanguage\": {\r\n \"type\": \"string\",\r\n \"enum\": [...Object.values(OperationalLocale), ...Object.values(OperationalLanguage)]\r\n },\r\n \"addressType\": {\r\n \"type\": \"string\",\r\n \"enum\": [\"shipping\", \"billing\", \"billing&shipping\"]\r\n },\r\n \"address\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"firstName\": {\"$ref\": \"standards#/definitions/firstName\"},\r\n \"lastName\": { \"$ref\": \"standards#/definitions/lastName\" },\r\n \"company\": { \"$ref\": \"standards#/definitions/company\" },\r\n \"phone\": { \"$ref\": \"standards#/definitions/phone\" },\r\n \"email\": { \"$ref\": \"standards#/definitions/email\" },\r\n \"addressLine1\": { \"$ref\": \"standards#/definitions/addressLine1\" },\r\n \"addressLine2\": { \"$ref\": \"standards#/definitions/addressLine2\" },\r\n \"city\": { \"$ref\": \"standards#/definitions/city\" },\r\n \"postalCode\": { \"$ref\": \"standards#/definitions/postalCode\" },\r\n \"state\": { \"$ref\": \"standards#/definitions/state\" },\r\n \"country\": { \"$ref\": \"standards#/definitions/country\" }\r\n },\r\n \"required\": [\"firstName\", \"lastName\", \"phone\", \"email\", \"addressLine1\", \"postalCode\", \"state\", \"country\"]\r\n }\r\n }\r\n}","import SchemaDefinitions from './definition';\r\n\r\nconst Schema = {\r\n getStandardSchemaDefinition() {\r\n return SchemaDefinitions;\r\n }\r\n}\r\n\r\nexport default Schema;\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/Schema/definition.ts","../src/Schema/index.ts","../src/MemoryCache/index.ts"],"names":["definition_default","ProductModel","GenderCategory","OperationalCountry","OperationalCountryCurrency","OperationalLocale","OperationalLanguage","Schema","Schema_default","MemoryCache","maxSize","ttl","now","key","item","value","firstKey","Logger_default","MemoryCache_default"],"mappings":"wZAGA,IAAOA,EAAQ,CACb,GAAA,CAAO,YACP,WA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,CAAK,MAAM,MAAOD,CAAAA,CAAG,CACrB,CAAA,MACJ,CACA,OAAK,IAAA,CAAA,KAAA,CAAM,OAAOA,CAAG,CAAA,CACrBI,IAAO,UAAW,CAAA,iBAAA,CAAmB,CAAyCJ,sCAAAA,EAAAA,CAAG,EAAE,CACnF,CAAA,IAAA,CAAK,MAAM,GAAIA,CAAAA,CAAAA,CAAKC,CAAI,CACjBA,CAAAA,CAAAA,CAAK,MAChB,CAMA,OAAA,EAAU,CACN,aAAc,CAAA,IAAA,CAAK,eAAe,EACtC,CACJ,EAEOI,CAAQT,CAAAA","file":"index.mjs","sourcesContent":["import { GenderCategory, OperationalCountry, OperationalCountryCurrency, OperationalLanguage, OperationalLocale } from \"../Classes/Enum\";\r\nimport ProductModel from \"../Classes/Product\";\r\n\r\nexport default {\r\n \"$id\": \"standards\",\r\n \"definitions\": {\r\n \"lowercaseText\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]*$\"\r\n },\r\n \"lowercaseText10\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]{0,10}$\"\r\n },\r\n \"lowercaseText16\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]{0,16}$\"\r\n },\r\n \"lowercaseText30\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]{0,30}$\"\r\n },\r\n \"lowercaseText50\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]{0,50}$\"\r\n },\r\n \"lowercaseText256\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$)[a-z]{0,256}$\"\r\n },\r\n \"text\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).*$\"\r\n },\r\n \"text10\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{0,10}$\"\r\n },\r\n \"text16\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{0,16}$\"\r\n },\r\n \"text30\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{0,30}$\"\r\n },\r\n \"text50\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{0,50}$\"\r\n },\r\n \"text256\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{0,256}$\"\r\n },\r\n \"requiredText\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).+$\"\r\n },\r\n \"requiredText10\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{1,10}$\"\r\n },\r\n \"requiredText16\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{1,16}$\"\r\n },\r\n \"requiredText30\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{1,30}$\"\r\n },\r\n \"requiredText50\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{1,50}$\"\r\n },\r\n \"requiredText256\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^(?!\\\\s)(?!.*\\\\s$).{1,256}$\"\r\n },\r\n \"url\": {\r\n \"type\": \"string\",\r\n \"pattern\": \"^https://[^\\\\s/$.?#].[^\\\\s]*$\",\r\n \"maxLength\": 2048\r\n },\r\n \"uuid\": {\r\n \"type\": \"string\",\r\n \"minLength\": 1,\r\n \"pattern\": \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\"\r\n },\r\n \"productKey\": {\r\n \"type\": \"string\",\r\n \"pattern\": ProductModel.productKeyRegex.source\r\n },\r\n \"productSku\": {\r\n \"type\": \"string\",\r\n \"pattern\": ProductModel.productSKURegex.source\r\n },\r\n \"genderCategory\": {\r\n \"type\": \"string\",\r\n \"enum\": Object.values(GenderCategory)\r\n },\r\n \"price\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"amount\": { \"type\": \"number\", \"minimum\": 0 },\r\n \"currency\": { \"$ref\": \"#/definitions/currency\" }\r\n },\r\n \"additionalProperties\": false,\r\n \"required\": [\"amount\", \"currency\"]\r\n },\r\n \"color\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"name\": {\r\n \"type\": \"string\"\r\n },\r\n \"hex\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"additionalProperties\": false,\r\n \"required\": [\r\n \"name\"\r\n ]\r\n },\r\n \"attributeValue\": {\r\n \"oneOf\": [\r\n { \"type\": \"string\" },\r\n {\r\n \"$ref\": \"#/definitions/color\"\r\n }\r\n ]\r\n },\r\n \"selectionAttributes\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"color\": { \"$ref\": \"#/definitions/color\" }\r\n },\r\n \"required\": [\"color\"],\r\n \"additionalProperties\": {\r\n \"$ref\": \"#/definitions/attributeValue\"\r\n }\r\n },\r\n \"firstName\": { \"$ref\": \"#/definitions/requiredText30\" },\r\n \"lastName\": { \"$ref\": \"#/definitions/text30\" },\r\n \"company\": { \"$ref\": \"#/definitions/text50\" },\r\n \"phone\": { \r\n \"type\" : \"string\",\r\n \"pattern\": \"^[0-9]{10}$\"\r\n },\r\n \"email\": { \r\n \"type\" : \"string\",\r\n \"pattern\": \"^[^\\\\s]+@[^\\\\s]+\\\\.[^\\\\s]+$\"\r\n },\r\n \"addressLine1\": { \"$ref\": \"#/definitions/requiredText50\" },\r\n \"addressLine2\": { \"$ref\": \"#/definitions/text50\" },\r\n \"city\": { \"$ref\": \"#/definitions/requiredText30\" },\r\n \"postalCode\": { \"$ref\": \"#/definitions/requiredText16\" },\r\n \"state\": {\r\n \"type\": \"string\",\r\n \"enum\": [\"AP\", \"AR\", \"AS\", \"BR\", \"CT\", \"GA\", \"GJ\", \"HR\", \"HP\", \"JH\", \"KA\", \"KL\", \"MP\", \"MH\", \"MN\", \"ML\", \"MZ\", \"NL\", \"OR\", \"PB\", \"RJ\", \"SK\", \"TN\", \"TG\", \"TR\", \"UP\", \"UT\", \"WB\", \"AN\", \"CH\", \"DH\", \"LD\", \"DL\", \"PY\", \"LA\", \"JK\"]\r\n },\r\n \"country\": {\r\n \"type\": \"string\",\r\n \"enum\": Object.values(OperationalCountry)\r\n },\r\n \"currency\": {\r\n \"type\": \"string\",\r\n \"enum\": Object.values(OperationalCountryCurrency)\r\n },\r\n \"locale\": {\r\n \"type\": \"string\",\r\n \"enum\": Object.values(OperationalLocale)\r\n },\r\n \"language\": {\r\n \"type\": \"string\",\r\n \"enum\": Object.values(OperationalLanguage)\r\n },\r\n \"localeOrLanguage\": {\r\n \"type\": \"string\",\r\n \"enum\": [...Object.values(OperationalLocale), ...Object.values(OperationalLanguage)]\r\n },\r\n \"addressType\": {\r\n \"type\": \"string\",\r\n \"enum\": [\"shipping\", \"billing\", \"billing&shipping\"]\r\n },\r\n \"address\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"firstName\": {\"$ref\": \"standards#/definitions/firstName\"},\r\n \"lastName\": { \"$ref\": \"standards#/definitions/lastName\" },\r\n \"company\": { \"$ref\": \"standards#/definitions/company\" },\r\n \"phone\": { \"$ref\": \"standards#/definitions/phone\" },\r\n \"email\": { \"$ref\": \"standards#/definitions/email\" },\r\n \"addressLine1\": { \"$ref\": \"standards#/definitions/addressLine1\" },\r\n \"addressLine2\": { \"$ref\": \"standards#/definitions/addressLine2\" },\r\n \"city\": { \"$ref\": \"standards#/definitions/city\" },\r\n \"postalCode\": { \"$ref\": \"standards#/definitions/postalCode\" },\r\n \"state\": { \"$ref\": \"standards#/definitions/state\" },\r\n \"country\": { \"$ref\": \"standards#/definitions/country\" }\r\n },\r\n \"required\": [\"firstName\", \"lastName\", \"phone\", \"email\", \"addressLine1\", \"postalCode\", \"state\", \"country\"]\r\n }\r\n }\r\n}","import SchemaDefinitions from './definition';\r\n\r\nconst Schema = {\r\n getStandardSchemaDefinition() {\r\n return SchemaDefinitions;\r\n }\r\n}\r\n\r\nexport default Schema;\r\n","import Logger from \"../Logger\";\r\n\r\n/**\r\n * In-memory cache with per-entry TTL expiration and LRU-style eviction.\r\n *\r\n * Keys are `string` and values are generic (`T`).\r\n * Expired entries are removed lazily on `get` and periodically by a cleanup timer.\r\n */\r\nclass MemoryCache<T> {\r\n private cache: Map<string, { value: T; expiry: number }> = new Map();\r\n private maxSize: number;\r\n private ttl: number;\r\n private cleanupInterval: ReturnType<typeof setInterval>;\r\n\r\n /**\r\n * Creates a cache instance.\r\n *\r\n * @param maxSize Maximum number of live entries allowed in cache. Must be >= 1.\r\n * @param ttl Time-to-live in milliseconds for each entry from write time. Must be >= 1.\r\n */\r\n constructor(maxSize: number = 1000, ttl: number = 5 * 60 * 1000) {\r\n if (!Number.isFinite(maxSize) || maxSize < 1) {\r\n throw new RangeError('maxSize must be a finite number greater than or equal to 1.');\r\n }\r\n if (!Number.isFinite(ttl) || ttl < 1) {\r\n throw new RangeError('ttl must be a finite number greater than or equal to 1.');\r\n }\r\n\r\n this.maxSize = maxSize;\r\n this.ttl = ttl;\r\n this.cleanupInterval = setInterval(() => this.cleanup(), 60 * 1000);\r\n if (this.cleanupInterval.unref) {\r\n this.cleanupInterval.unref();\r\n }\r\n }\r\n\r\n /**\r\n * Removes expired entries from the cache.\r\n */\r\n private cleanup() {\r\n const now = Date.now();\r\n for (const [key, item] of this.cache.entries()) {\r\n if (now >= item.expiry) {\r\n this.cache.delete(key);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Stores or updates a value in cache.\r\n * If the key already exists, the value and expiry are replaced.\r\n * If capacity is reached and key is new, least-recently-used entry is evicted.\r\n *\r\n * @param key Cache key.\r\n * @param value Value to store.\r\n */\r\n set(key: string, value: T) {\r\n if (this.cache.has(key)) {\r\n this.cache.delete(key);\r\n } else if (this.cache.size >= this.maxSize) {\r\n const firstKey = this.cache.keys().next().value;\r\n if (firstKey !== undefined) {\r\n this.cache.delete(firstKey);\r\n }\r\n }\r\n this.cache.set(key, { value, expiry: Date.now() + this.ttl });\r\n }\r\n\r\n /**\r\n * Reads a value by key.\r\n * Returns `undefined` if the key does not exist or if the entry has expired.\r\n * Access refreshes recency for eviction order (LRU behavior).\r\n *\r\n * @param key Cache key.\r\n * @returns Cached value or `undefined`.\r\n */\r\n get(key: string): T | undefined {\r\n const item = this.cache.get(key);\r\n if (!item) return undefined;\r\n if (Date.now() >= item.expiry) {\r\n this.cache.delete(key);\r\n return undefined;\r\n }\r\n this.cache.delete(key);\r\n Logger.logMessage('MemoryCache.get', `Successfully read cache data for key: ${key}`);\r\n this.cache.set(key, item);\r\n return item.value;\r\n }\r\n\r\n /**\r\n * Stops the background cleanup timer.\r\n * Call when the cache instance is no longer needed.\r\n */\r\n dispose() {\r\n clearInterval(this.cleanupInterval);\r\n }\r\n}\r\n\r\nexport default MemoryCache;\r\n"]}
|