chrono-forge
Version:
A comprehensive framework for building resilient Temporal workflows, advanced state management, and real-time streaming activities in TypeScript. Designed for a seamless developer experience with powerful abstractions, dynamic orchestration, and full cont
15 lines (14 loc) • 653 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Query = void 0;
require("reflect-metadata");
const metadata_1 = require("./metadata");
const Query = (options) => {
return (target, propertyKey) => {
const queries = Reflect.getOwnMetadata(metadata_1.QUERY_METADATA_KEY, target) ?? [];
const queryName = typeof options === 'string' ? options : (options?.name ?? propertyKey);
queries.push([queryName, propertyKey, options && typeof options === 'object' ? options : undefined]);
Reflect.defineMetadata(metadata_1.QUERY_METADATA_KEY, queries, target);
};
};
exports.Query = Query;