

const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
const require_decorate = require('../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js');
const require_JsonTransformer = require('../utils/JsonTransformer.js');
const require_Metadata = require('./Metadata.js');
const require_transformers = require('../utils/transformers.js');
let class_transformer = require("class-transformer");
class_transformer = require_rolldown_runtime.__toESM(class_transformer);

//#region src/storage/BaseRecord.ts
var _ref, _ref2, _ref3;
var BaseRecord = class BaseRecord {
	constructor() {
		this._tags = {};
		this.type = BaseRecord.type;
		this.allowCache = BaseRecord.allowCache;
		this.metadata = new require_Metadata.Metadata({});
	}
	/**
	* Set the value for a tag
	* @param name name of the tag
	* @param value value of the tag
	*/
	setTag(name, value) {
		this._tags[name] = value;
	}
	/**
	* Get the value for a tag
	* @param name name of the tag
	* @returns The tag value, or undefined if not found
	*/
	getTag(name) {
		return this.getTags()[name];
	}
	/**
	* Set custom tags. This will merge the tags object with passed in tag properties
	*
	* @param tags the tags to set
	*/
	setTags(tags) {
		this._tags = {
			...this._tags,
			...tags
		};
	}
	/**
	* Replace tags. This will replace the whole tags object.
	* Default tags will still be overridden when retrieving tags
	*
	* @param tags the tags to set
	*/
	replaceTags(tags) {
		this._tags = tags;
	}
	toJSON() {
		return require_JsonTransformer.JsonTransformer.toJSON(this);
	}
	/**
	* Clones the record.
	*/
	clone() {
		return require_JsonTransformer.JsonTransformer.clone(this);
	}
};
BaseRecord.type = "BaseRecord";
BaseRecord.allowCache = false;
require_decorate.__decorate([require_transformers.DateTransformer(), require_decorateMetadata.__decorateMetadata("design:type", typeof (_ref = typeof Date !== "undefined" && Date) === "function" ? _ref : Object)], BaseRecord.prototype, "createdAt", void 0);
require_decorate.__decorate([require_transformers.DateTransformer(), require_decorateMetadata.__decorateMetadata("design:type", typeof (_ref2 = typeof Date !== "undefined" && Date) === "function" ? _ref2 : Object)], BaseRecord.prototype, "updatedAt", void 0);
require_decorate.__decorate([(0, class_transformer.Exclude)(), require_decorateMetadata.__decorateMetadata("design:type", Object)], BaseRecord.prototype, "type", void 0);
require_decorate.__decorate([(0, class_transformer.Exclude)(), require_decorateMetadata.__decorateMetadata("design:type", Object)], BaseRecord.prototype, "allowCache", void 0);
require_decorate.__decorate([require_transformers.MetadataTransformer(), require_decorateMetadata.__decorateMetadata("design:type", typeof (_ref3 = typeof require_Metadata.Metadata !== "undefined" && require_Metadata.Metadata) === "function" ? _ref3 : Object)], BaseRecord.prototype, "metadata", void 0);

//#endregion
exports.BaseRecord = BaseRecord;