@xapp/dynamo-service
Advanced tools
Comparing version 0.0.89 to 0.0.90
@@ -15,2 +15,3 @@ "use strict"; | ||
const Object_1 = require("../utils/Object"); | ||
const ValidationError_1 = require("./ValidationError"); | ||
const MAX_PUT_ALL_ATTEMPTS = 15; | ||
@@ -214,3 +215,3 @@ class DynamoService { | ||
else { | ||
throw new Error("Could not construct DynamoService. Bad input."); | ||
throw new ValidationError_1.ValidationError("Could not construct DynamoService. Bad input."); | ||
} | ||
@@ -217,0 +218,0 @@ } |
@@ -5,2 +5,3 @@ "use strict"; | ||
exports.DynamoService = DynamoService_1.DynamoService; | ||
const ValidationError_1 = require("./ValidationError"); | ||
const DynamoQueryBuilder_1 = require("../dynamo-query-builder/DynamoQueryBuilder"); | ||
@@ -72,9 +73,9 @@ const Object_1 = require("../utils/Object"); | ||
if (primaryKeys.length === 0) { | ||
throw new Error("Table " + tableName + " must include a primary key."); | ||
throw new ValidationError_1.ValidationError("Table " + tableName + " must include a primary key."); | ||
} | ||
if (primaryKeys.length > 1) { | ||
throw new Error("Table " + tableName + " must only have one primary key."); | ||
throw new ValidationError_1.ValidationError("Table " + tableName + " must only have one primary key."); | ||
} | ||
if (sortKeys.length > 1) { | ||
throw new Error("Table " + tableName + " can not have more than one sort key."); | ||
throw new ValidationError_1.ValidationError("Table " + tableName + " can not have more than one sort key."); | ||
} | ||
@@ -215,3 +216,3 @@ this.primaryKey = primaryKeys[0]; | ||
catch (e) { | ||
throw new Error("The the object requires the keys '" + requiredKeys.join(",") + "'."); | ||
throw new ValidationError_1.ValidationError("The the object requires the keys '" + requiredKeys.join(",") + "'."); | ||
} | ||
@@ -224,3 +225,3 @@ } | ||
catch (e) { | ||
throw new Error("The keys '" + constantKeys.join(",") + "' are constant and can not be modified."); | ||
throw new ValidationError_1.ValidationError("The keys '" + constantKeys.join(",") + "' are constant and can not be modified."); | ||
} | ||
@@ -232,3 +233,3 @@ } | ||
if (knownKeys.indexOf(key) < 0) { | ||
throw new Error("Key '" + key + "' is not defined in the table."); | ||
throw new ValidationError_1.ValidationError("Key '" + key + "' is not defined in the table."); | ||
} | ||
@@ -243,3 +244,3 @@ } | ||
if (bannedKeys[key].test(value)) { | ||
throw new Error("Invalid character found in key '" + value + "'."); | ||
throw new ValidationError_1.ValidationError("Invalid character found in key '" + value + "'."); | ||
} | ||
@@ -254,3 +255,3 @@ } | ||
if (keysWithEnums[key].indexOf(value) < 0) { | ||
throw new Error("Invalid enum value '" + value + "' for key '" + key + "'."); | ||
throw new ValidationError_1.ValidationError("Invalid enum value '" + value + "' for key '" + key + "'."); | ||
} | ||
@@ -265,3 +266,3 @@ } | ||
if (!format[key].test(value)) { | ||
throw new Error("Invalid format '" + value + "' for key '" + key + "'."); | ||
throw new ValidationError_1.ValidationError("Invalid format '" + value + "' for key '" + key + "'."); | ||
} | ||
@@ -268,0 +269,0 @@ } |
{ | ||
"name": "@xapp/dynamo-service", | ||
"version": "0.0.89", | ||
"version": "0.0.90", | ||
"description": "A dynamo help class which will help maintain data integrity.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
145949
30
3907