Spaces:
Running
Running
Download apps/api/dist/analytics/analytics.router.js from Benaah/MicProtocol: direct link, hf CLI and curl.
- Browser
- Download file 3.48 kB
-
https://huggingface.co/spaces/Benaah/MicProtocol/resolve/main/apps/api/dist/analytics/analytics.router.js
- Command line
-
hf download hf://spaces/Benaah/MicProtocol/apps/api/dist/analytics/analytics.router.js
-
curl -L -o analytics.router.js https://huggingface.co/spaces/Benaah/MicProtocol/resolve/main/apps/api/dist/analytics/analytics.router.js
3.48 kB
| ; | |
| var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | |
| var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | |
| if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | |
| else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | |
| return c > 3 && r && Object.defineProperty(target, key, r), r; | |
| }; | |
| var __metadata = (this && this.__metadata) || function (k, v) { | |
| if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | |
| }; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.AnalyticsRouter = void 0; | |
| const common_1 = require("@nestjs/common"); | |
| const zod_1 = require("zod"); | |
| const trpc_init_1 = require("../trpc/trpc.init"); | |
| const subscription_features_1 = require("../billing/subscription-features"); | |
| const analytics_service_1 = require("./analytics.service"); | |
| let AnalyticsRouter = class AnalyticsRouter { | |
| analyticsService; | |
| constructor(analyticsService) { | |
| this.analyticsService = analyticsService; | |
| } | |
| get router() { | |
| return (0, trpc_init_1.router)({ | |
| dashboard: trpc_init_1.workspaceProcedure | |
| .input(zod_1.z.object({ podcastId: zod_1.z.string().uuid() })) | |
| .query(async ({ input, ctx }) => { | |
| return this.analyticsService.getDashboardMetrics(input.podcastId, ctx.userId); | |
| }), | |
| pipeline: trpc_init_1.workspaceProcedure | |
| .input(zod_1.z.object({ podcastId: zod_1.z.string().uuid() })) | |
| .query(async ({ input, ctx }) => { | |
| return this.analyticsService.getGuestPipeline(input.podcastId, ctx.userId); | |
| }), | |
| outreach: (0, trpc_init_1.requireFeature)(subscription_features_1.SubscriptionFeature.ADVANCED_ANALYTICS) | |
| .input(zod_1.z.object({ podcastId: zod_1.z.string().uuid() })) | |
| .query(async ({ input, ctx }) => { | |
| return this.analyticsService.getOutreachMetrics(input.podcastId, ctx.userId); | |
| }), | |
| scheduling: (0, trpc_init_1.requireFeature)(subscription_features_1.SubscriptionFeature.ADVANCED_ANALYTICS) | |
| .input(zod_1.z.object({ | |
| podcastId: zod_1.z.string().uuid(), | |
| daysBack: zod_1.z.number().int().min(7).max(365).default(90), | |
| })) | |
| .query(async ({ input, ctx }) => { | |
| return this.analyticsService.getSchedulingMetrics(input.podcastId, ctx.userId, input.daysBack); | |
| }), | |
| recentActivity: trpc_init_1.workspaceProcedure | |
| .input(zod_1.z.object({ | |
| podcastId: zod_1.z.string().uuid(), | |
| limit: zod_1.z.number().int().min(1).max(100).default(20), | |
| })) | |
| .query(async ({ input, ctx }) => { | |
| return this.analyticsService.getRecentActivity(input.podcastId, ctx.userId, input.limit); | |
| }), | |
| }); | |
| } | |
| }; | |
| exports.AnalyticsRouter = AnalyticsRouter; | |
| exports.AnalyticsRouter = AnalyticsRouter = __decorate([ | |
| (0, common_1.Injectable)(), | |
| __metadata("design:paramtypes", [analytics_service_1.AnalyticsService]) | |
| ], AnalyticsRouter); | |
| //# sourceMappingURL=analytics.router.js.map |