@aws/dynamodb-data-mapper-annotations
Version:
Annotations providing easy integration between TypeScript domain objects and the @aws/dynamodb-data-mapper library
115 lines • 4.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var _1 = require("./");
var dynamodb_data_mapper_1 = require("@aws/dynamodb-data-mapper");
var Author = /** @class */ (function () {
function Author() {
}
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", String)
], Author.prototype, "name", void 0);
tslib_1.__decorate([
_1.attribute({ memberType: { type: 'String' } }),
tslib_1.__metadata("design:type", Map)
], Author.prototype, "socialMediaHandles", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", Uint8Array)
], Author.prototype, "photo", void 0);
return Author;
}());
exports.Author = Author;
var Comment = /** @class */ (function () {
function Comment() {
}
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", Date)
], Comment.prototype, "timestamp", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", Boolean)
], Comment.prototype, "approved", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", String)
], Comment.prototype, "subject", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", String)
], Comment.prototype, "text", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", String)
], Comment.prototype, "author", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", Number)
], Comment.prototype, "upvotes", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", Number)
], Comment.prototype, "downvotes", void 0);
tslib_1.__decorate([
_1.attribute({ memberType: dynamodb_data_mapper_1.embed(Comment) }),
tslib_1.__metadata("design:type", Array)
], Comment.prototype, "replies", void 0);
return Comment;
}());
exports.Comment = Comment;
var Post = /** @class */ (function () {
function Post() {
}
tslib_1.__decorate([
_1.autoGeneratedHashKey(),
tslib_1.__metadata("design:type", String)
], Post.prototype, "id", void 0);
tslib_1.__decorate([
_1.rangeKey(),
tslib_1.__metadata("design:type", Date)
], Post.prototype, "createdAt", void 0);
tslib_1.__decorate([
_1.versionAttribute(),
tslib_1.__metadata("design:type", Number)
], Post.prototype, "version", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", Author)
], Post.prototype, "author", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", String)
], Post.prototype, "content", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", String)
], Post.prototype, "title", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", String)
], Post.prototype, "subtitle", void 0);
tslib_1.__decorate([
_1.attribute(),
tslib_1.__metadata("design:type", String)
], Post.prototype, "imageLink", void 0);
tslib_1.__decorate([
_1.attribute({ memberType: { type: 'String' } }),
tslib_1.__metadata("design:type", Array)
], Post.prototype, "corrections", void 0);
tslib_1.__decorate([
_1.attribute({ memberType: dynamodb_data_mapper_1.embed(Comment) }),
tslib_1.__metadata("design:type", Array)
], Post.prototype, "replies", void 0);
tslib_1.__decorate([
_1.attribute({ memberType: 'String' }),
tslib_1.__metadata("design:type", Set)
], Post.prototype, "tags", void 0);
Post = tslib_1.__decorate([
_1.table('Posts')
], Post);
return Post;
}());
exports.Post = Post;
//# sourceMappingURL=exampleSchema.fixture.js.map