"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildCommonMetadata = void 0;
const protobuf_1 = require("@bufbuild/protobuf");
const buildCommonMetadata = ({ id, type, organization, timestamp, tags }) => {
    let timestamps;
    if (timestamp) {
        timestamps = {
            created: protobuf_1.Timestamp.fromDate(timestamp.created),
            updated: protobuf_1.Timestamp.fromDate(timestamp.updated),
            deactivated: timestamp.deactivated ? protobuf_1.Timestamp.fromDate(timestamp.deactivated) : undefined
        };
    }
    return {
        id,
        type,
        organization,
        timestamps,
        tags
    };
};
exports.buildCommonMetadata = buildCommonMetadata;
//# sourceMappingURL=index.js.map