@twin.org/core 0.0.2-next.9 → 0.0.3-next.2
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/es/encoding/base32.js +75 -0
- package/dist/es/encoding/base32.js.map +1 -0
- package/dist/es/encoding/base58.js +124 -0
- package/dist/es/encoding/base58.js.map +1 -0
- package/dist/es/encoding/base64.js +231 -0
- package/dist/es/encoding/base64.js.map +1 -0
- package/dist/es/encoding/base64Url.js +42 -0
- package/dist/es/encoding/base64Url.js.map +1 -0
- package/dist/es/errors/alreadyExistsError.js +22 -0
- package/dist/es/errors/alreadyExistsError.js.map +1 -0
- package/dist/es/errors/baseError.js +257 -0
- package/dist/es/errors/baseError.js.map +1 -0
- package/dist/es/errors/conflictError.js +23 -0
- package/dist/es/errors/conflictError.js.map +1 -0
- package/dist/es/errors/generalError.js +21 -0
- package/dist/es/errors/generalError.js.map +1 -0
- package/dist/es/errors/guardError.js +27 -0
- package/dist/es/errors/guardError.js.map +1 -0
- package/dist/es/errors/notFoundError.js +22 -0
- package/dist/es/errors/notFoundError.js.map +1 -0
- package/dist/es/errors/notImplementedError.js +24 -0
- package/dist/es/errors/notImplementedError.js.map +1 -0
- package/dist/es/errors/notSupportedError.js +21 -0
- package/dist/es/errors/notSupportedError.js.map +1 -0
- package/dist/es/errors/unauthorizedError.js +21 -0
- package/dist/es/errors/unauthorizedError.js.map +1 -0
- package/dist/es/errors/unprocessableError.js +21 -0
- package/dist/es/errors/unprocessableError.js.map +1 -0
- package/dist/es/errors/validationError.js +23 -0
- package/dist/es/errors/validationError.js.map +1 -0
- package/dist/es/factories/componentFactory.js +9 -0
- package/dist/es/factories/componentFactory.js.map +1 -0
- package/dist/es/factories/factory.js +256 -0
- package/dist/es/factories/factory.js.map +1 -0
- package/dist/es/helpers/arrayHelper.js +44 -0
- package/dist/es/helpers/arrayHelper.js.map +1 -0
- package/dist/es/helpers/envHelper.js +39 -0
- package/dist/es/helpers/envHelper.js.map +1 -0
- package/dist/es/helpers/errorHelper.js +100 -0
- package/dist/es/helpers/errorHelper.js.map +1 -0
- package/dist/es/helpers/filenameHelper.js +32 -0
- package/dist/es/helpers/filenameHelper.js.map +1 -0
- package/dist/es/helpers/hexHelper.js +45 -0
- package/dist/es/helpers/hexHelper.js.map +1 -0
- package/dist/es/helpers/jsonHelper.js +163 -0
- package/dist/es/helpers/jsonHelper.js.map +1 -0
- package/dist/es/helpers/numberHelper.js +30 -0
- package/dist/es/helpers/numberHelper.js.map +1 -0
- package/dist/es/helpers/objectHelper.js +333 -0
- package/dist/es/helpers/objectHelper.js.map +1 -0
- package/dist/es/helpers/randomHelper.js +18 -0
- package/dist/es/helpers/randomHelper.js.map +1 -0
- package/dist/es/helpers/stringHelper.js +241 -0
- package/dist/es/helpers/stringHelper.js.map +1 -0
- package/dist/es/helpers/uint8ArrayHelper.js +26 -0
- package/dist/es/helpers/uint8ArrayHelper.js.map +1 -0
- package/dist/es/index.js +57 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IComponent.js +4 -0
- package/dist/es/models/IComponent.js.map +1 -0
- package/dist/es/models/IError.js +4 -0
- package/dist/es/models/IError.js.map +1 -0
- package/dist/es/models/II18nShared.js +2 -0
- package/dist/es/models/II18nShared.js.map +1 -0
- package/dist/es/models/IKeyValue.js +2 -0
- package/dist/es/models/IKeyValue.js.map +1 -0
- package/dist/es/models/ILabelledValue.js +2 -0
- package/dist/es/models/ILabelledValue.js.map +1 -0
- package/dist/es/models/ILocale.js +2 -0
- package/dist/es/models/ILocale.js.map +1 -0
- package/dist/es/models/ILocaleDictionary.js +4 -0
- package/dist/es/models/ILocaleDictionary.js.map +1 -0
- package/dist/es/models/ILocalesIndex.js +2 -0
- package/dist/es/models/ILocalesIndex.js.map +1 -0
- package/dist/es/models/IPatchOperation.js +4 -0
- package/dist/es/models/IPatchOperation.js.map +1 -0
- package/dist/es/models/IUrlParts.js +4 -0
- package/dist/es/models/IUrlParts.js.map +1 -0
- package/dist/es/models/IValidationFailure.js +2 -0
- package/dist/es/models/IValidationFailure.js.map +1 -0
- package/dist/es/models/coerceType.js +49 -0
- package/dist/es/models/coerceType.js.map +1 -0
- package/dist/es/models/compressionType.js +17 -0
- package/dist/es/models/compressionType.js.map +1 -0
- package/dist/es/models/objectOrArray.js +2 -0
- package/dist/es/models/objectOrArray.js.map +1 -0
- package/dist/es/types/bitString.js +98 -0
- package/dist/es/types/bitString.js.map +1 -0
- package/dist/es/types/url.js +144 -0
- package/dist/es/types/url.js.map +1 -0
- package/dist/es/types/urn.js +212 -0
- package/dist/es/types/urn.js.map +1 -0
- package/dist/es/utils/asyncCache.js +179 -0
- package/dist/es/utils/asyncCache.js.map +1 -0
- package/dist/es/utils/coerce.js +269 -0
- package/dist/es/utils/coerce.js.map +1 -0
- package/dist/es/utils/compression.js +49 -0
- package/dist/es/utils/compression.js.map +1 -0
- package/dist/es/utils/converter.js +256 -0
- package/dist/es/utils/converter.js.map +1 -0
- package/dist/es/utils/guards.js +369 -0
- package/dist/es/utils/guards.js.map +1 -0
- package/dist/es/utils/i18n.js +243 -0
- package/dist/es/utils/i18n.js.map +1 -0
- package/dist/es/utils/is.js +351 -0
- package/dist/es/utils/is.js.map +1 -0
- package/dist/es/utils/sharedStore.js +48 -0
- package/dist/es/utils/sharedStore.js.map +1 -0
- package/dist/es/utils/validation.js +774 -0
- package/dist/es/utils/validation.js.map +1 -0
- package/dist/types/encoding/base32.d.ts +4 -0
- package/dist/types/encoding/base58.d.ts +4 -0
- package/dist/types/encoding/base64.d.ts +4 -0
- package/dist/types/encoding/base64Url.d.ts +4 -0
- package/dist/types/errors/alreadyExistsError.d.ts +5 -2
- package/dist/types/errors/baseError.d.ts +1 -1
- package/dist/types/errors/conflictError.d.ts +5 -2
- package/dist/types/errors/generalError.d.ts +1 -1
- package/dist/types/errors/guardError.d.ts +1 -1
- package/dist/types/errors/notFoundError.d.ts +5 -2
- package/dist/types/errors/notImplementedError.d.ts +6 -2
- package/dist/types/errors/notSupportedError.d.ts +5 -2
- package/dist/types/errors/unauthorizedError.d.ts +5 -2
- package/dist/types/errors/unprocessableError.d.ts +1 -1
- package/dist/types/errors/validationError.d.ts +2 -2
- package/dist/types/factories/componentFactory.d.ts +2 -2
- package/dist/types/factories/factory.d.ts +4 -0
- package/dist/types/helpers/arrayHelper.d.ts +1 -1
- package/dist/types/helpers/errorHelper.d.ts +1 -1
- package/dist/types/helpers/jsonHelper.d.ts +5 -1
- package/dist/types/helpers/numberHelper.d.ts +17 -0
- package/dist/types/helpers/objectHelper.d.ts +14 -0
- package/dist/types/helpers/stringHelper.d.ts +6 -6
- package/dist/types/index.d.ts +54 -53
- package/dist/types/models/IComponent.d.ts +6 -7
- package/dist/types/models/ILocalesIndex.d.ts +1 -1
- package/dist/types/models/IValidationFailure.d.ts +0 -4
- package/dist/types/types/bitString.d.ts +4 -0
- package/dist/types/types/url.d.ts +8 -3
- package/dist/types/types/urn.d.ts +7 -2
- package/dist/types/utils/coerce.d.ts +1 -1
- package/dist/types/utils/compression.d.ts +5 -1
- package/dist/types/utils/guards.d.ts +2 -3
- package/dist/types/utils/i18n.d.ts +16 -1
- package/dist/types/utils/is.d.ts +1 -1
- package/dist/types/utils/validation.d.ts +1 -1
- package/docs/changelog.md +283 -0
- package/docs/reference/classes/AlreadyExistsError.md +8 -4
- package/docs/reference/classes/AsyncCache.md +5 -5
- package/docs/reference/classes/Base32.md +8 -0
- package/docs/reference/classes/Base58.md +8 -0
- package/docs/reference/classes/Base64.md +8 -0
- package/docs/reference/classes/Base64Url.md +8 -0
- package/docs/reference/classes/BaseError.md +3 -3
- package/docs/reference/classes/BitString.md +8 -0
- package/docs/reference/classes/Coerce.md +20 -20
- package/docs/reference/classes/Compression.md +8 -0
- package/docs/reference/classes/ConflictError.md +8 -4
- package/docs/reference/classes/ErrorHelper.md +2 -2
- package/docs/reference/classes/Factory.md +11 -3
- package/docs/reference/classes/GeneralError.md +3 -3
- package/docs/reference/classes/GuardError.md +3 -3
- package/docs/reference/classes/Guards.md +8 -4
- package/docs/reference/classes/I18n.md +54 -2
- package/docs/reference/classes/Is.md +10 -4
- package/docs/reference/classes/JsonHelper.md +8 -0
- package/docs/reference/classes/NotFoundError.md +8 -4
- package/docs/reference/classes/NotImplementedError.md +14 -4
- package/docs/reference/classes/NotSupportedError.md +8 -4
- package/docs/reference/classes/NumberHelper.md +55 -0
- package/docs/reference/classes/ObjectHelper.md +58 -8
- package/docs/reference/classes/SharedStore.md +2 -2
- package/docs/reference/classes/StringHelper.md +8 -8
- package/docs/reference/classes/UnauthorizedError.md +8 -4
- package/docs/reference/classes/UnprocessableError.md +3 -3
- package/docs/reference/classes/Url.md +17 -3
- package/docs/reference/classes/Urn.md +19 -5
- package/docs/reference/classes/Validation.md +2 -2
- package/docs/reference/classes/ValidationError.md +3 -3
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IComponent.md +19 -25
- package/docs/reference/interfaces/IValidationFailure.md +0 -8
- package/locales/.validate-ignore +1 -0
- package/locales/en.json +4 -5
- package/package.json +22 -10
- package/dist/cjs/index.cjs +0 -5175
- package/dist/esm/index.mjs +0 -5133
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D;;GAEG;AACH,MAAM,OAAO,UAAU;IACtB;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAClB,QAAgB,EAChB,KAAc,EACd,QAA8B,EAC9B,iBAA0B;QAE1B,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,EAAE,EAAE,CAAC;YACT,QAAQ,CAAC,IAAI,CAAC;gBACb,QAAQ;gBACR,MAAM,EAAE,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Is } from \"./is.js\";\nimport { ValidationError } from \"../errors/validationError.js\";\nimport type { IValidationFailure } from \"../models/IValidationFailure.js\";\n\n/**\n * Class to handle validation operations.\n */\nexport class Validation {\n\t/**\n\t * Is the property null or undefined.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a empty.\n\t */\n\tpublic static empty(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is undefined | null {\n\t\tconst is = Is.empty(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beEmpty\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property is not null or undefined.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a not empty.\n\t */\n\tpublic static notEmpty(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): boolean {\n\t\tconst is = Is.notEmpty(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beNotEmpty\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property a string.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @param options Additional options for the validation.\n\t * @param options.minLength The minimum length of the string.\n\t * @param options.maxLength The maximum length of the string.\n\t * @param options.format Specific format to check.\n\t * @returns True if the value is a valid string.\n\t */\n\tpublic static string(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string,\n\t\toptions?: {\n\t\t\tformat?: \"base64\" | \"base58\" | \"hex\" | RegExp;\n\t\t\tminLength?: number;\n\t\t\tmaxLength?: number;\n\t\t}\n\t): value is string {\n\t\tconst is = Is.string(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beText\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t} else {\n\t\t\tconst minLength = options?.minLength;\n\t\t\tconst maxLength = options?.maxLength;\n\t\t\tconst minLimitDefined = Is.integer(minLength);\n\t\t\tconst maxLimitDefined = Is.integer(maxLength);\n\t\t\tconst belowMin = minLimitDefined && value.length < minLength;\n\t\t\tconst aboveMax = maxLimitDefined && value.length > maxLength;\n\n\t\t\tif (options?.format === \"base58\" && !Is.stringBase58(value)) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beTextBase58\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (options?.format === \"base64\" && !Is.stringBase64(value)) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beTextBase64\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (options?.format === \"hex\" && !Is.stringHex(value)) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beTextHex\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (Is.regexp(options?.format) && !options.format.test(value)) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beTextRegExp\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tformat: options?.format\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (minLimitDefined && maxLimitDefined && (belowMin || aboveMax)) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beTextMinMax\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tminLength,\n\t\t\t\t\t\tmaxLength\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (minLimitDefined && belowMin) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beTextMin\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tminLength\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (maxLimitDefined && aboveMax) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beTextMax\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tmaxLength\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn failures.length === 0;\n\t}\n\n\t/**\n\t * Is the property a string with a value.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @param options Additional options for the validation.\n\t * @param options.minLength The minimum length of the string.\n\t * @param options.maxLength The maximum length of the string.\n\t * @returns True if the value is a valid string.\n\t */\n\tpublic static stringValue(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string,\n\t\toptions?: {\n\t\t\tminLength?: number;\n\t\t\tmaxLength?: number;\n\t\t}\n\t): value is string {\n\t\tconst is = Is.stringValue(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beTextValue\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t} else {\n\t\t\tconst minLength = options?.minLength;\n\t\t\tconst maxLength = options?.maxLength;\n\t\t\tconst minLimitDefined = Is.integer(minLength);\n\t\t\tconst maxLimitDefined = Is.integer(maxLength);\n\t\t\tconst belowMin = minLimitDefined && value.length < minLength;\n\t\t\tconst aboveMax = maxLimitDefined && value.length > maxLength;\n\n\t\t\tif (minLimitDefined && maxLimitDefined && (belowMin || aboveMax)) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beTextMinMax\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tminLength,\n\t\t\t\t\t\tmaxLength\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (minLimitDefined && belowMin) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beTextMin\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tminLength\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (maxLimitDefined && aboveMax) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beTextMax\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tmaxLength\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn failures.length === 0;\n\t}\n\n\t/**\n\t * Is the property a number.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @param options Additional options for the validation.\n\t * @param options.minValue The minimum value of the number.\n\t * @param options.maxValue The maximum value of the number.\n\t * @returns True if the value is a valid number.\n\t */\n\tpublic static number(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string,\n\t\toptions?: {\n\t\t\tminValue?: number;\n\t\t\tmaxValue?: number;\n\t\t}\n\t): value is number {\n\t\tconst is = Is.number(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beNumber\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t} else {\n\t\t\tconst minValue = options?.minValue;\n\t\t\tconst maxValue = options?.maxValue;\n\t\t\tconst minLimitDefined = Is.number(minValue);\n\t\t\tconst maxLimitDefined = Is.number(maxValue);\n\t\t\tconst belowMin = minLimitDefined && value < minValue;\n\t\t\tconst aboveMax = maxLimitDefined && value > maxValue;\n\n\t\t\tif (minLimitDefined && maxLimitDefined && (belowMin || aboveMax)) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beNumberMinMax\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tminValue,\n\t\t\t\t\t\tmaxValue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (minLimitDefined && belowMin) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beNumberMin\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tminValue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (maxLimitDefined && aboveMax) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beNumberMax\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tmaxValue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn failures.length === 0;\n\t}\n\n\t/**\n\t * Is the property an integer.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @param options Additional options for the validation.\n\t * @param options.minValue The minimum value of the integer.\n\t * @param options.maxValue The maximum value of the integer.\n\t * @returns True if the value is a valid integer.\n\t */\n\tpublic static integer(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string,\n\t\toptions?: {\n\t\t\tminValue?: number;\n\t\t\tmaxValue?: number;\n\t\t}\n\t): value is number {\n\t\tconst is = Is.integer(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beWholeNumber\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t} else {\n\t\t\tconst minValue = options?.minValue;\n\t\t\tconst maxValue = options?.maxValue;\n\t\t\tconst minLimitDefined = Is.integer(minValue);\n\t\t\tconst maxLimitDefined = Is.integer(maxValue);\n\t\t\tconst belowMin = minLimitDefined && value < minValue;\n\t\t\tconst aboveMax = maxLimitDefined && value > maxValue;\n\n\t\t\tif (minLimitDefined && maxLimitDefined && (belowMin || aboveMax)) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beWholeNumberMinMax\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tminValue,\n\t\t\t\t\t\tmaxValue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (minLimitDefined && belowMin) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beWholeNumberMin\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tminValue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (maxLimitDefined && aboveMax) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beWholeNumberMax\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tmaxValue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn failures.length === 0;\n\t}\n\n\t/**\n\t * Is the property a bigint.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @param options Additional options for the validation.\n\t * @param options.minValue The minimum value of the bigint.\n\t * @param options.maxValue The maximum value of the bigint.\n\t * @returns True if the value is a valid bigint.\n\t */\n\tpublic static bigint(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string,\n\t\toptions?: {\n\t\t\tminValue?: bigint;\n\t\t\tmaxValue?: bigint;\n\t\t}\n\t): value is bigint {\n\t\tconst is = Is.bigint(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beBigInteger\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t} else {\n\t\t\tconst minValue = options?.minValue;\n\t\t\tconst maxValue = options?.maxValue;\n\t\t\tconst minLimitDefined = Is.bigint(minValue);\n\t\t\tconst maxLimitDefined = Is.bigint(maxValue);\n\t\t\tconst belowMin = minLimitDefined && value < minValue;\n\t\t\tconst aboveMax = maxLimitDefined && value > maxValue;\n\n\t\t\tif (minLimitDefined && maxLimitDefined && (belowMin || aboveMax)) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beBigIntegerMinMax\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tminValue,\n\t\t\t\t\t\tmaxValue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (minLimitDefined && belowMin) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beBigIntegerMin\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tminValue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (maxLimitDefined && aboveMax) {\n\t\t\t\tfailures.push({\n\t\t\t\t\tproperty,\n\t\t\t\t\treason: \"validation.beBigIntegerMax\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tmaxValue\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn failures.length === 0;\n\t}\n\n\t/**\n\t * Is the property a boolean.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a boolean.\n\t */\n\tpublic static boolean(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is boolean {\n\t\tconst is = Is.boolean(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beBoolean\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property a date.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a date.\n\t */\n\tpublic static date(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is Date {\n\t\tif (Is.dateEmpty(value)) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beDate\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst is = Is.date(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beDate\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property a date in ISO 8601 format.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a date.\n\t */\n\tpublic static dateString(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is string {\n\t\tif (!Is.stringValue(value)) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beDate\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst is = Is.dateString(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beDate\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property a date/time in ISO 8601 format.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a date/time.\n\t */\n\tpublic static dateTimeString(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is string {\n\t\tif (!Is.stringValue(value)) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beDateTime\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst is = Is.dateTimeString(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beDateTime\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property a time in ISO 8601 format.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a time.\n\t */\n\tpublic static timeString(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is string {\n\t\tif (!Is.stringValue(value)) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beTime\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst is = Is.timeString(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beTime\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property a timestamp in milliseconds.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a timestamp in milliseconds.\n\t */\n\tpublic static timestampMilliseconds(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is number {\n\t\tif (!Is.integer(value)) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beTimestampMilliseconds\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst is = Is.timestampMilliseconds(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beTimestampMilliseconds\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property a timestamp in seconds.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a timestamp in seconds.\n\t */\n\tpublic static timestampSeconds(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is number {\n\t\tif (!Is.integer(value)) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beTimestampSeconds\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst is = Is.timestampSeconds(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beTimestampSeconds\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property an object.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a object.\n\t */\n\tpublic static object<T = { [id: string]: unknown }>(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is T {\n\t\tconst is = Is.object<T>(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beObject\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property an array.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is an array.\n\t */\n\tpublic static array<T>(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is T[] {\n\t\tconst is = Is.array<T>(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beArray\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property an array with at least one item.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is an array with at least one element.\n\t */\n\tpublic static arrayValue<T>(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is T[] {\n\t\tconst is = Is.array(value) && value.length > 0;\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beArrayValue\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property one of a list of items.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param options The options the value must be one of.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is one of the items in the options.\n\t */\n\tpublic static arrayOneOf<T>(\n\t\tproperty: string,\n\t\tvalue: T,\n\t\toptions: T[],\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is T {\n\t\tif (Is.empty(value)) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beIncluded\",\n\t\t\t\tproperties: {\n\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\tvalue,\n\t\t\t\t\toptions\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst is = Is.arrayOneOf(value, options);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beIncluded\",\n\t\t\t\tproperties: {\n\t\t\t\t\tfieldName: fieldNameResource ?? \"validation.defaultFieldName\",\n\t\t\t\t\tvalue,\n\t\t\t\t\toptions\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property a Uint8Array.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a Uint8Array.\n\t */\n\tpublic static uint8Array(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is Uint8Array {\n\t\tconst is = Is.uint8Array(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beByteArray\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property valid JSON.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is valid JSON.\n\t */\n\tpublic static json(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is string {\n\t\tconst is = Is.json(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beJSON\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Is the property a string in e-mail format.\n\t * @param property The name of the property.\n\t * @param value The value to test.\n\t * @param failures The list of failures to add to.\n\t * @param fieldNameResource Optional i18n resource of the field name to display in the message.\n\t * @returns True if the value is a valid looking e-mail.\n\t */\n\tpublic static email(\n\t\tproperty: string,\n\t\tvalue: unknown,\n\t\tfailures: IValidationFailure[],\n\t\tfieldNameResource?: string\n\t): value is string {\n\t\tconst is = Is.email(value);\n\t\tif (!is) {\n\t\t\tfailures.push({\n\t\t\t\tproperty,\n\t\t\t\treason: \"validation.beEmail\",\n\t\t\t\tproperties: { fieldName: fieldNameResource ?? \"validation.defaultFieldName\", value }\n\t\t\t});\n\t\t}\n\t\treturn is;\n\t}\n\n\t/**\n\t * Throw the validation failures as a ValidationError.\n\t * @param source The source of the error.\n\t * @param objectName The object that was being validated.\n\t * @param failures The validation failures.\n\t * @throws ValidationError From the converted failures.\n\t */\n\tpublic static asValidationError(\n\t\tsource: string,\n\t\tobjectName: string,\n\t\tfailures: IValidationFailure[]\n\t): void {\n\t\tif (Is.arrayValue<IValidationFailure>(failures)) {\n\t\t\tthrow new ValidationError(source, objectName, failures);\n\t\t}\n\t}\n\n\t/**\n\t * Map a list of failures to their properties in a map.\n\t * @param failures The validation failures to combine into the map for the properties.\n\t * @param propertyMap The map to add the failures to.\n\t * @param clearMap Should the map be cleared before adding the failures.\n\t */\n\tpublic static toPropertyMap(\n\t\tfailures: IValidationFailure[],\n\t\tpropertyMap: { [property: string]: IValidationFailure[] },\n\t\tclearMap: boolean = true\n\t): void {\n\t\tif (clearMap) {\n\t\t\tfor (const prop in propertyMap) {\n\t\t\t\tdelete propertyMap[prop];\n\t\t\t}\n\t\t}\n\n\t\tfor (const validationFailure of failures) {\n\t\t\tif (Is.array(propertyMap[validationFailure.property])) {\n\t\t\t\tpropertyMap[validationFailure.property].push(validationFailure);\n\t\t\t} else {\n\t\t\t\tpropertyMap[validationFailure.property] = [validationFailure];\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Class to help with base63 Encoding/Decoding.
|
|
3
3
|
*/
|
|
4
4
|
export declare class Base32 {
|
|
5
|
+
/**
|
|
6
|
+
* Runtime name for the class.
|
|
7
|
+
*/
|
|
8
|
+
static readonly CLASS_NAME: string;
|
|
5
9
|
/**
|
|
6
10
|
* Convert the base 32 string to a byte array.
|
|
7
11
|
* @param base32 The base32 string to convert.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Class to help with base58 Encoding/Decoding.
|
|
3
3
|
*/
|
|
4
4
|
export declare class Base58 {
|
|
5
|
+
/**
|
|
6
|
+
* Runtime name for the class.
|
|
7
|
+
*/
|
|
8
|
+
static readonly CLASS_NAME: string;
|
|
5
9
|
/**
|
|
6
10
|
* Convert the base 58 string to a byte array.
|
|
7
11
|
* @param base58 The base58 string to convert.
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* https://www.rfc-editor.org/rfc/rfc4648#section-5.
|
|
4
4
|
*/
|
|
5
5
|
export declare class Base64Url {
|
|
6
|
+
/**
|
|
7
|
+
* Runtime name for the class.
|
|
8
|
+
*/
|
|
9
|
+
static readonly CLASS_NAME: string;
|
|
6
10
|
/**
|
|
7
11
|
* Convert the base 64 string to a byte array.
|
|
8
12
|
* @param base64Url The base64 url string to convert.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError } from "./baseError";
|
|
1
|
+
import { BaseError } from "./baseError.js";
|
|
2
2
|
/**
|
|
3
3
|
* Class to handle errors which are triggered by data already existing.
|
|
4
4
|
*/
|
|
@@ -12,7 +12,10 @@ export declare class AlreadyExistsError extends BaseError {
|
|
|
12
12
|
* @param source The source of the error.
|
|
13
13
|
* @param message The message as a code.
|
|
14
14
|
* @param existingId The id for the item.
|
|
15
|
+
* @param properties Any additional information for the error.
|
|
15
16
|
* @param cause The cause of the error if we have wrapped another error.
|
|
16
17
|
*/
|
|
17
|
-
constructor(source: string, message: string, existingId?: string,
|
|
18
|
+
constructor(source: string, message: string, existingId?: string, properties?: {
|
|
19
|
+
[id: string]: unknown;
|
|
20
|
+
}, cause?: unknown);
|
|
18
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError } from "./baseError";
|
|
1
|
+
import { BaseError } from "./baseError.js";
|
|
2
2
|
/**
|
|
3
3
|
* Class to handle errors which are triggered by conflicting data.
|
|
4
4
|
*/
|
|
@@ -13,7 +13,10 @@ export declare class ConflictError extends BaseError {
|
|
|
13
13
|
* @param message The message as a code.
|
|
14
14
|
* @param conflictId The id that has conflicts.
|
|
15
15
|
* @param conflicts The conflicts that occurred.
|
|
16
|
+
* @param properties Any additional information for the error.
|
|
16
17
|
* @param cause The cause or the error if we have wrapped another error.
|
|
17
18
|
*/
|
|
18
|
-
constructor(source: string, message: string, conflictId?: string, conflicts?: string[],
|
|
19
|
+
constructor(source: string, message: string, conflictId?: string, conflicts?: string[], properties?: {
|
|
20
|
+
[id: string]: unknown;
|
|
21
|
+
}, cause?: unknown);
|
|
19
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError } from "./baseError";
|
|
1
|
+
import { BaseError } from "./baseError.js";
|
|
2
2
|
/**
|
|
3
3
|
* Class to handle errors which are triggered by data not being found.
|
|
4
4
|
*/
|
|
@@ -12,7 +12,10 @@ export declare class NotFoundError extends BaseError {
|
|
|
12
12
|
* @param source The source of the error.
|
|
13
13
|
* @param message The message as a code.
|
|
14
14
|
* @param notFoundId The id for the item.
|
|
15
|
+
* @param properties Any additional information for the error.
|
|
15
16
|
* @param cause The cause of the error if we have wrapped another error.
|
|
16
17
|
*/
|
|
17
|
-
constructor(source: string, message: string, notFoundId?: string,
|
|
18
|
+
constructor(source: string, message: string, notFoundId?: string, properties?: {
|
|
19
|
+
[id: string]: unknown;
|
|
20
|
+
}, cause?: unknown);
|
|
18
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError } from "./baseError";
|
|
1
|
+
import { BaseError } from "./baseError.js";
|
|
2
2
|
/**
|
|
3
3
|
* Class to handle errors.
|
|
4
4
|
*/
|
|
@@ -11,6 +11,10 @@ export declare class NotImplementedError extends BaseError {
|
|
|
11
11
|
* Create a new instance of NotImplementedError.
|
|
12
12
|
* @param source The source of the error.
|
|
13
13
|
* @param method The method for the error.
|
|
14
|
+
* @param properties Any additional information for the error.
|
|
15
|
+
* @param cause The cause of the error if we have wrapped another error.
|
|
14
16
|
*/
|
|
15
|
-
constructor(source: string, method: string
|
|
17
|
+
constructor(source: string, method: string, properties?: {
|
|
18
|
+
[id: string]: unknown;
|
|
19
|
+
}, cause?: unknown);
|
|
16
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError } from "./baseError";
|
|
1
|
+
import { BaseError } from "./baseError.js";
|
|
2
2
|
/**
|
|
3
3
|
* Class to handle errors when a feature is unsupported.
|
|
4
4
|
*/
|
|
@@ -11,7 +11,10 @@ export declare class NotSupportedError extends BaseError {
|
|
|
11
11
|
* Create a new instance of NotSupportedError.
|
|
12
12
|
* @param source The source of the error.
|
|
13
13
|
* @param message The message as a code.
|
|
14
|
+
* @param properties Any additional information for the error.
|
|
14
15
|
* @param cause The cause of the error if we have wrapped another error.
|
|
15
16
|
*/
|
|
16
|
-
constructor(source: string, message: string,
|
|
17
|
+
constructor(source: string, message: string, properties?: {
|
|
18
|
+
[id: string]: unknown;
|
|
19
|
+
}, cause?: unknown);
|
|
17
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError } from "./baseError";
|
|
1
|
+
import { BaseError } from "./baseError.js";
|
|
2
2
|
/**
|
|
3
3
|
* Class to handle errors which are triggered by access not being unauthorized.
|
|
4
4
|
*/
|
|
@@ -11,7 +11,10 @@ export declare class UnauthorizedError extends BaseError {
|
|
|
11
11
|
* Create a new instance of UnauthorizedError.
|
|
12
12
|
* @param source The source of the error.
|
|
13
13
|
* @param message The message as a code.
|
|
14
|
+
* @param properties Any additional information for the error.
|
|
14
15
|
* @param cause The cause of the error if we have wrapped another error.
|
|
15
16
|
*/
|
|
16
|
-
constructor(source: string, message: string,
|
|
17
|
+
constructor(source: string, message: string, properties?: {
|
|
18
|
+
[id: string]: unknown;
|
|
19
|
+
}, cause?: unknown);
|
|
17
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseError } from "./baseError";
|
|
2
|
-
import type { IValidationFailure } from "../models/IValidationFailure";
|
|
1
|
+
import { BaseError } from "./baseError.js";
|
|
2
|
+
import type { IValidationFailure } from "../models/IValidationFailure.js";
|
|
3
3
|
/**
|
|
4
4
|
* Class to handle errors which are triggered by entity validation.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Factory } from "./factory";
|
|
2
|
-
import type { IComponent } from "../models/IComponent";
|
|
1
|
+
import { Factory } from "./factory.js";
|
|
2
|
+
import type { IComponent } from "../models/IComponent.js";
|
|
3
3
|
/**
|
|
4
4
|
* Factory for creating implementation of component types.
|
|
5
5
|
*/
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Factory for creating implementation of generic types.
|
|
3
3
|
*/
|
|
4
4
|
export declare class Factory<T> {
|
|
5
|
+
/**
|
|
6
|
+
* Runtime name for the class.
|
|
7
|
+
*/
|
|
8
|
+
static readonly CLASS_NAME: string;
|
|
5
9
|
/**
|
|
6
10
|
* Create a new factory, which is shared throughout all library instances.
|
|
7
11
|
* @param typeName The type name for the instances.
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import type { IPatchOperation } from "../models/IPatchOperation";
|
|
1
|
+
import type { IPatchOperation } from "../models/IPatchOperation.js";
|
|
2
2
|
/**
|
|
3
3
|
* Helpers methods for JSON objects.
|
|
4
4
|
*/
|
|
5
5
|
export declare class JsonHelper {
|
|
6
|
+
/**
|
|
7
|
+
* Runtime name for the class.
|
|
8
|
+
*/
|
|
9
|
+
static readonly CLASS_NAME: string;
|
|
6
10
|
/**
|
|
7
11
|
* Serializes in canonical format.
|
|
8
12
|
* Based on https://www.rfc-editor.org/rfc/rfc8785.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class to help with numbers.
|
|
3
|
+
*/
|
|
4
|
+
export declare class NumberHelper {
|
|
5
|
+
/**
|
|
6
|
+
* Runtime name for the class.
|
|
7
|
+
*/
|
|
8
|
+
static readonly CLASS_NAME: string;
|
|
9
|
+
/**
|
|
10
|
+
* Clamps a number between a minimum and maximum value.
|
|
11
|
+
* @param value The value to clamp.
|
|
12
|
+
* @param minValue The minimum value.
|
|
13
|
+
* @param maxValue The maximum value.
|
|
14
|
+
* @returns The clamped value.
|
|
15
|
+
*/
|
|
16
|
+
static clamp(value: number, minValue?: number, maxValue?: number): number;
|
|
17
|
+
}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Class to help with objects.
|
|
3
3
|
*/
|
|
4
4
|
export declare class ObjectHelper {
|
|
5
|
+
/**
|
|
6
|
+
* Runtime name for the class.
|
|
7
|
+
*/
|
|
8
|
+
static readonly CLASS_NAME: string;
|
|
5
9
|
/**
|
|
6
10
|
* Convert an object to bytes.
|
|
7
11
|
* @param obj The object to convert.
|
|
@@ -80,6 +84,16 @@ export declare class ObjectHelper {
|
|
|
80
84
|
* @returns The partial object.
|
|
81
85
|
*/
|
|
82
86
|
static omit<T>(obj: T | undefined, keys?: (keyof T)[]): Partial<T>;
|
|
87
|
+
/**
|
|
88
|
+
* Split an object into two with the specified keys.
|
|
89
|
+
* @param obj The object to split.
|
|
90
|
+
* @param keys The property keys to split.
|
|
91
|
+
* @returns The two partial objects.
|
|
92
|
+
*/
|
|
93
|
+
static split<T>(obj: T | undefined, keys?: (keyof T)[]): {
|
|
94
|
+
picked: Partial<T> | undefined;
|
|
95
|
+
omitted: Partial<T> | undefined;
|
|
96
|
+
};
|
|
83
97
|
/**
|
|
84
98
|
* Converter the non JSON primitives to extended types.
|
|
85
99
|
* @param obj The object to convert.
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare class StringHelper {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Implementation signature for trimTrailingSlashes.
|
|
7
7
|
* @param value The value to trim.
|
|
8
|
-
* @returns The trimmed
|
|
8
|
+
* @returns The trimmed string or the original.
|
|
9
9
|
*/
|
|
10
|
-
static trimTrailingSlashes(value: string
|
|
10
|
+
static trimTrailingSlashes(value: string): string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Implementation signature for trimLeadingSlashes.
|
|
13
13
|
* @param value The value to trim.
|
|
14
|
-
* @returns The trimmed
|
|
14
|
+
* @returns The trimmed string or the original.
|
|
15
15
|
*/
|
|
16
|
-
static trimLeadingSlashes(value: string
|
|
16
|
+
static trimLeadingSlashes(value: string): string;
|
|
17
17
|
/**
|
|
18
18
|
* Convert the input string to kebab case.
|
|
19
19
|
* @param input The input to convert.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
export * from "./encoding/base32";
|
|
2
|
-
export * from "./encoding/base58";
|
|
3
|
-
export * from "./encoding/base64";
|
|
4
|
-
export * from "./encoding/base64Url";
|
|
5
|
-
export * from "./errors/alreadyExistsError";
|
|
6
|
-
export * from "./errors/baseError";
|
|
7
|
-
export * from "./errors/conflictError";
|
|
8
|
-
export * from "./errors/generalError";
|
|
9
|
-
export * from "./errors/guardError";
|
|
10
|
-
export * from "./errors/notFoundError";
|
|
11
|
-
export * from "./errors/notImplementedError";
|
|
12
|
-
export * from "./errors/notSupportedError";
|
|
13
|
-
export * from "./errors/unauthorizedError";
|
|
14
|
-
export * from "./errors/unprocessableError";
|
|
15
|
-
export * from "./errors/validationError";
|
|
16
|
-
export * from "./factories/componentFactory";
|
|
17
|
-
export * from "./factories/factory";
|
|
18
|
-
export * from "./helpers/arrayHelper";
|
|
19
|
-
export * from "./helpers/envHelper";
|
|
20
|
-
export * from "./helpers/errorHelper";
|
|
21
|
-
export * from "./helpers/filenameHelper";
|
|
22
|
-
export * from "./helpers/hexHelper";
|
|
23
|
-
export * from "./helpers/jsonHelper";
|
|
24
|
-
export * from "./helpers/
|
|
25
|
-
export * from "./helpers/
|
|
26
|
-
export * from "./helpers/
|
|
27
|
-
export * from "./helpers/
|
|
28
|
-
export * from "./
|
|
29
|
-
export * from "./models/
|
|
30
|
-
export * from "./models/
|
|
31
|
-
export * from "./models/
|
|
32
|
-
export * from "./models/
|
|
33
|
-
export * from "./models/
|
|
34
|
-
export * from "./models/
|
|
35
|
-
export * from "./models/
|
|
36
|
-
export * from "./models/
|
|
37
|
-
export * from "./models/
|
|
38
|
-
export * from "./models/
|
|
39
|
-
export * from "./models/
|
|
40
|
-
export * from "./models/
|
|
41
|
-
export * from "./models/
|
|
42
|
-
export * from "./
|
|
43
|
-
export * from "./types/
|
|
44
|
-
export * from "./types/
|
|
45
|
-
export * from "./
|
|
46
|
-
export * from "./utils/
|
|
47
|
-
export * from "./utils/
|
|
48
|
-
export * from "./utils/
|
|
49
|
-
export * from "./utils/
|
|
50
|
-
export * from "./utils/
|
|
51
|
-
export * from "./utils/
|
|
52
|
-
export * from "./utils/
|
|
53
|
-
export * from "./utils/
|
|
1
|
+
export * from "./encoding/base32.js";
|
|
2
|
+
export * from "./encoding/base58.js";
|
|
3
|
+
export * from "./encoding/base64.js";
|
|
4
|
+
export * from "./encoding/base64Url.js";
|
|
5
|
+
export * from "./errors/alreadyExistsError.js";
|
|
6
|
+
export * from "./errors/baseError.js";
|
|
7
|
+
export * from "./errors/conflictError.js";
|
|
8
|
+
export * from "./errors/generalError.js";
|
|
9
|
+
export * from "./errors/guardError.js";
|
|
10
|
+
export * from "./errors/notFoundError.js";
|
|
11
|
+
export * from "./errors/notImplementedError.js";
|
|
12
|
+
export * from "./errors/notSupportedError.js";
|
|
13
|
+
export * from "./errors/unauthorizedError.js";
|
|
14
|
+
export * from "./errors/unprocessableError.js";
|
|
15
|
+
export * from "./errors/validationError.js";
|
|
16
|
+
export * from "./factories/componentFactory.js";
|
|
17
|
+
export * from "./factories/factory.js";
|
|
18
|
+
export * from "./helpers/arrayHelper.js";
|
|
19
|
+
export * from "./helpers/envHelper.js";
|
|
20
|
+
export * from "./helpers/errorHelper.js";
|
|
21
|
+
export * from "./helpers/filenameHelper.js";
|
|
22
|
+
export * from "./helpers/hexHelper.js";
|
|
23
|
+
export * from "./helpers/jsonHelper.js";
|
|
24
|
+
export * from "./helpers/numberHelper.js";
|
|
25
|
+
export * from "./helpers/objectHelper.js";
|
|
26
|
+
export * from "./helpers/randomHelper.js";
|
|
27
|
+
export * from "./helpers/stringHelper.js";
|
|
28
|
+
export * from "./helpers/uint8ArrayHelper.js";
|
|
29
|
+
export * from "./models/coerceType.js";
|
|
30
|
+
export * from "./models/compressionType.js";
|
|
31
|
+
export * from "./models/IComponent.js";
|
|
32
|
+
export * from "./models/IError.js";
|
|
33
|
+
export * from "./models/II18nShared.js";
|
|
34
|
+
export * from "./models/IKeyValue.js";
|
|
35
|
+
export * from "./models/ILabelledValue.js";
|
|
36
|
+
export * from "./models/ILocale.js";
|
|
37
|
+
export * from "./models/ILocaleDictionary.js";
|
|
38
|
+
export * from "./models/ILocalesIndex.js";
|
|
39
|
+
export * from "./models/IPatchOperation.js";
|
|
40
|
+
export * from "./models/IUrlParts.js";
|
|
41
|
+
export * from "./models/IValidationFailure.js";
|
|
42
|
+
export * from "./models/objectOrArray.js";
|
|
43
|
+
export * from "./types/bitString.js";
|
|
44
|
+
export * from "./types/url.js";
|
|
45
|
+
export * from "./types/urn.js";
|
|
46
|
+
export * from "./utils/asyncCache.js";
|
|
47
|
+
export * from "./utils/coerce.js";
|
|
48
|
+
export * from "./utils/compression.js";
|
|
49
|
+
export * from "./utils/converter.js";
|
|
50
|
+
export * from "./utils/guards.js";
|
|
51
|
+
export * from "./utils/i18n.js";
|
|
52
|
+
export * from "./utils/is.js";
|
|
53
|
+
export * from "./utils/sharedStore.js";
|
|
54
|
+
export * from "./utils/validation.js";
|
|
@@ -3,27 +3,26 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface IComponent {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Returns the class name of the component.
|
|
7
|
+
* @returns The class name of the component.
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
+
className(): string;
|
|
9
10
|
/**
|
|
10
11
|
* Bootstrap the component by creating and initializing any resources it needs.
|
|
11
12
|
* @param nodeLoggingComponentType The node logging component type.
|
|
12
13
|
* @returns True if the bootstrapping process was successful.
|
|
13
14
|
*/
|
|
14
|
-
bootstrap?(nodeLoggingComponentType
|
|
15
|
+
bootstrap?(nodeLoggingComponentType?: string): Promise<boolean>;
|
|
15
16
|
/**
|
|
16
17
|
* The component needs to be started when the node is initialized.
|
|
17
|
-
* @param nodeIdentity The identity of the node starting the component.
|
|
18
18
|
* @param nodeLoggingComponentType The node logging component type.
|
|
19
19
|
* @returns Nothing.
|
|
20
20
|
*/
|
|
21
|
-
start?(
|
|
21
|
+
start?(nodeLoggingComponentType?: string): Promise<void>;
|
|
22
22
|
/**
|
|
23
23
|
* The component needs to be stopped when the node is closed.
|
|
24
|
-
* @param nodeIdentity The identity of the node stopping the component.
|
|
25
24
|
* @param nodeLoggingComponentType The node logging component type.
|
|
26
25
|
* @returns Nothing.
|
|
27
26
|
*/
|
|
28
|
-
stop?(
|
|
27
|
+
stop?(nodeLoggingComponentType?: string): Promise<void>;
|
|
29
28
|
}
|
|
@@ -10,10 +10,6 @@ export interface IValidationFailure {
|
|
|
10
10
|
* The reason the validation failed as an i18 resource error.
|
|
11
11
|
*/
|
|
12
12
|
reason: string;
|
|
13
|
-
/**
|
|
14
|
-
* The optional human readable name for the field as an i18 resource.
|
|
15
|
-
*/
|
|
16
|
-
fieldName?: string;
|
|
17
13
|
/**
|
|
18
14
|
* Additional properties for the validation failure.
|
|
19
15
|
*/
|