@aws/dynamodb-data-marshaller
Advanced tools
Comparing version 0.3.0 to 0.4.0
export * from './InvalidSchemaError'; | ||
export * from './InvalidValueError'; | ||
export * from './isKey'; | ||
export * from './KeySchema'; | ||
export * from './keysFromSchema'; | ||
export * from './marshallItem'; | ||
@@ -5,0 +7,0 @@ export * from './marshallKey'; |
@@ -7,2 +7,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./isKey"), exports); | ||
tslib_1.__exportStar(require("./keysFromSchema"), exports); | ||
tslib_1.__exportStar(require("./marshallItem"), exports); | ||
@@ -9,0 +10,0 @@ tslib_1.__exportStar(require("./marshallKey"), exports); |
@@ -190,10 +190,19 @@ "use strict"; | ||
if (!(input instanceof dynamodb_auto_marshaller_1.BinarySet)) { | ||
input = new dynamodb_auto_marshaller_1.BinarySet(input); | ||
var set = new dynamodb_auto_marshaller_1.BinarySet(); | ||
try { | ||
for (var input_4 = tslib_1.__values(input), input_4_1 = input_4.next(); !input_4_1.done; input_4_1 = input_4.next()) { | ||
var item = input_4_1.value; | ||
set.add(marshallBinary(item)); | ||
} | ||
} | ||
catch (e_6_1) { e_6 = { error: e_6_1 }; } | ||
finally { | ||
try { | ||
if (input_4_1 && !input_4_1.done && (_s = input_4.return)) _s.call(input_4); | ||
} | ||
finally { if (e_6) throw e_6.error; } | ||
} | ||
input = set; | ||
} | ||
return marshallSet(input, marshallBinary, function (bin) { | ||
if (typeof bin === 'string') { | ||
return bin.length === 0; | ||
} | ||
return bin.byteLength === 0; | ||
}, 'BS'); | ||
return marshallSet(input, marshallBinary, function (bin) { return bin.byteLength === 0; }, 'BS'); | ||
} | ||
@@ -216,8 +225,8 @@ if (schemaType.memberType === 'Number') { | ||
} | ||
catch (e_6_1) { e_6 = { error: e_6_1 }; } | ||
catch (e_7_1) { e_7 = { error: e_7_1 }; } | ||
finally { | ||
try { | ||
if (original_1_1 && !original_1_1.done && (_s = original_1.return)) _s.call(original_1); | ||
if (original_1_1 && !original_1_1.done && (_t = original_1.return)) _t.call(original_1); | ||
} | ||
finally { if (e_6) throw e_6.error; } | ||
finally { if (e_7) throw e_7.error; } | ||
} | ||
@@ -244,3 +253,3 @@ } | ||
throw new InvalidSchemaError_1.InvalidSchemaError(schemaType, 'Unrecognized schema node'); | ||
var e_2, _g, e_3, _l, e_4, _o, e_5, _r, e_6, _s; | ||
var e_2, _g, e_3, _l, e_4, _o, e_5, _r, e_6, _s, e_7, _t; | ||
} | ||
@@ -276,3 +285,3 @@ exports.marshallValue = marshallValue; | ||
} | ||
catch (e_7_1) { e_7 = { error: e_7_1 }; } | ||
catch (e_8_1) { e_8 = { error: e_8_1 }; } | ||
finally { | ||
@@ -282,3 +291,3 @@ try { | ||
} | ||
finally { if (e_7) throw e_7.error; } | ||
finally { if (e_8) throw e_8.error; } | ||
} | ||
@@ -289,3 +298,3 @@ if (collected.length === 0) { | ||
return _b = {}, _b[setTag] = collected, _b; | ||
var e_7, _a, _b; | ||
var e_8, _a, _b; | ||
} | ||
@@ -292,0 +301,0 @@ function isArrayBuffer(arg) { |
@@ -0,5 +1,5 @@ | ||
import { ScalarAttributeType } from './KeySchema'; | ||
import { Schema } from './Schema'; | ||
import { BinaryValue, MarshallingOptions } from "@aws/dynamodb-auto-marshaller"; | ||
import { AttributeValue } from 'aws-sdk/clients/dynamodb'; | ||
import { Schema } from './Schema'; | ||
import { MarshallingOptions } from "@aws/dynamodb-auto-marshaller"; | ||
import { BinaryValue } from "@aws/dynamodb-auto-marshaller"; | ||
/** | ||
@@ -116,2 +116,10 @@ * The enumeration of types supported by this marshaller package. | ||
/** | ||
* The attribute type to be used for this field when creating or updating | ||
* the DynamoDB table definition for this record. | ||
* | ||
* Required if the custom field is being used as a key and the schema is | ||
* used to create or update a table or index. | ||
*/ | ||
attributeType?: ScalarAttributeType; | ||
/** | ||
* A function that converts an input value into a DynamoDB attribute value. | ||
@@ -118,0 +126,0 @@ * This function will not be invoked if the input value is undefined. |
@@ -79,3 +79,9 @@ "use strict"; | ||
&& typeof arg.marshall === 'function' | ||
&& typeof arg.unmarshall === 'function'; | ||
&& typeof arg.unmarshall === 'function' | ||
&& [ | ||
void 0, | ||
'S', | ||
'N', | ||
'B', | ||
].indexOf(arg.attributeType) > -1; | ||
case 'Document': | ||
@@ -82,0 +88,0 @@ return isDocumentType(arg, alreadyVisited); |
import { AttributePath } from '@aws/dynamodb-expressions'; | ||
import { Schema } from './Schema'; | ||
export declare function toSchemaName(path: AttributePath | string, schema: Schema): AttributePath; | ||
export declare function getSchemaName(propertyName: string, schema: Schema): string; |
@@ -53,2 +53,3 @@ "use strict"; | ||
} | ||
exports.getSchemaName = getSchemaName; | ||
//# sourceMappingURL=toSchemaName.js.map |
{ | ||
"name": "@aws/dynamodb-data-marshaller", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "A schema-based data marshaller for Amazon DynamoDB", | ||
"keywords": [ | ||
"aws", | ||
"dynamodb" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/awslabs/dynamodb-data-mapper-js.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/awslabs/dynamodb-data-mapper-js/issues" | ||
}, | ||
"homepage": "https://awslabs.github.io/dynamodb-data-mapper-js/packages/dynamodb-data-marshaller/", | ||
"main": "./build/index.js", | ||
@@ -27,4 +39,4 @@ "types": "./build/index.d.ts", | ||
"dependencies": { | ||
"@aws/dynamodb-auto-marshaller": "^0.3.0", | ||
"@aws/dynamodb-expressions": "^0.3.0", | ||
"@aws/dynamodb-auto-marshaller": "^0.4.0", | ||
"@aws/dynamodb-expressions": "^0.4.0", | ||
"tslib": "^1.8.1", | ||
@@ -31,0 +43,0 @@ "utf8-bytes": "^0.0.1" |
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
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
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
92153
40
1256
1
1
0
+ Added@aws/dynamodb-auto-marshaller@0.4.1(transitive)
+ Added@aws/dynamodb-expressions@0.4.1(transitive)
- Removed@aws/dynamodb-auto-marshaller@0.3.0(transitive)
- Removed@aws/dynamodb-expressions@0.3.0(transitive)