UNPKG

@crazy-web/feedback

Version:

A feedback form handler package that shows a popup based on allowed URLs.

259 lines (258 loc) 13.8 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.fetchRoadMaps = void 0; const config_1 = require("../lib/config"); const fetchRoadMaps = (_a) => __awaiter(void 0, [_a], void 0, function* ({ organizationId, websiteId }) { // const data = { // "success": true, // "data": [ // { // "status": "under_review", // "data": [ // { // "id": "e50da271-d0dc-403f-afd5-b4a6704683ec", // "title": "Roadmap and feature request", // "description": "Discover what new features users want you to build", // "status": "completed", // "type": "bug", // "comments":0, // "user_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "votes": 1136, // "is_public": true, // "created_at": "2025-03-10T17:11:00.045+00:00", // "updated_at": "2025-03-10T17:11:00.045+00:00", // "feedback_id": null, // "user_name": "Raj", // "user_email": "rajjwl2002@gmail.com", // "source": { // "id": "localhost", // "name": "slider", // "type": "Website" // }, // "last_retrieved_message": false, // "account_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "meta_data": null // }, // { // "id": "e50da271-d0dc-403f-afd5-b4a6704683ec", // "title": "Soc 2 full compliance", // "description": "Ensures that Beamer has the proper infrastructure, tools, and processes to protect customer information from unauthorized access both from within and outside the firm", // "status": "completed", // "type": "improvement", // "user_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "comments":0, // "votes": 556, // "is_public": true, // "created_at": "2025-03-10T17:11:00.045+00:00", // "updated_at": "2025-03-10T17:11:00.045+00:00", // "feedback_id": null, // "user_name": "Raj", // "user_email": "rajjwl2002@gmail.com", // "source": { // "id": "localhost", // "name": "slider", // "type": "Website" // }, // "last_retrieved_message": false, // "account_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "meta_data": null // }, // { // "id": "e50da271-d0dc-403f-afd5-b4a6704683ec", // "title": "Email notifications for product updates", // "description": "Send email notifications for your product updates directly from Beamer", // "status": "under_review", // "type": "task", // "user_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "votes": 455, // "is_public": true, // "created_at": "2025-03-10T17:11:00.045+00:00", // "updated_at": "2025-03-10T17:11:00.045+00:00", // "feedback_id": null, // "user_name": "Raj", // "user_email": "rajjwl2002@gmail.com", // "source": { // "id": "localhost", // "name": "slider", // "type": "Website" // }, // "last_retrieved_message": false, // "account_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "meta_data": null // }, // ] // }, // { // "status": "completed", // "data": [ // { // "id": "e50da271-d0dc-403f-afd5-b4a6704683ec", // "title": "Roadmap and feature request", // "description": "Discover what new features users want you to build", // "status": "completed", // "type": "bug", // "user_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "votes": 1136, // "comments":0, // "is_public": true, // "created_at": "2025-03-10T17:11:00.045+00:00", // "updated_at": "2025-03-10T17:11:00.045+00:00", // "feedback_id": null, // "user_name": "Raj", // "user_email": "rajjwl2002@gmail.com", // "source": { // "id": "localhost", // "name": "slider", // "type": "Website" // }, // "last_retrieved_message": false, // "account_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "meta_data": null // }, // { // "id": "e50da271-d0dc-403f-afd5-b4a6704683ec", // "title": "Soc 2 full compliance", // "description": "Ensures that Beamer has the proper infrastructure, tools, and processes to protect customer information from unauthorized access both from within and outside the firm", // "comments":0, // "status": "completed", // "type": "improvement", // "user_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "votes": 556, // "is_public": true, // "created_at": "2025-03-10T17:11:00.045+00:00", // "updated_at": "2025-03-10T17:11:00.045+00:00", // "feedback_id": null, // "user_name": "Raj", // "user_email": "rajjwl2002@gmail.com", // "source": { // "id": "localhost", // "name": "slider", // "type": "Website" // }, // "last_retrieved_message": false, // "account_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "meta_data": null // }, // { // "id": "e50da271-d0dc-403f-afd5-b4a6704683ec", // "title": "Email notifications for product updates", // "description": "Send email notifications for your product updates directly from Beamer", // "status": "under_review", // "type": "task", // "user_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "votes": 455, // "is_public": true, // "created_at": "2025-03-10T17:11:00.045+00:00", // "updated_at": "2025-03-10T17:11:00.045+00:00", // "feedback_id": null, // "user_name": "Raj", // "user_email": "rajjwl2002@gmail.com", // "source": { // "id": "localhost", // "name": "slider", // "type": "Website" // }, // "last_retrieved_message": false, // "account_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "meta_data": null // }, // ] // }, // { // "status": "in_progress", // "data": [ // { // "id": "e50da271-d0dc-403f-afd5-b4a6704683ec", // "title": "Roadmap and feature request", // "description": "Discover what new features users want you to build", // "status": "completed", // "type": "bug", // "user_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "votes": 1136, // "comments":0, // "is_public": true, // "created_at": "2025-03-10T17:11:00.045+00:00", // "updated_at": "2025-03-10T17:11:00.045+00:00", // "feedback_id": null, // "user_name": "Raj", // "user_email": "rajjwl2002@gmail.com", // "source": { // "id": "localhost", // "name": "slider", // "type": "Website" // }, // "last_retrieved_message": false, // "account_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "meta_data": null // }, // { // "id": "e50da271-d0dc-403f-afd5-b4a6704683ec", // "title": "Soc 2 full compliance", // "description": "Ensures that Beamer has the proper infrastructure, tools, and processes to protect customer information from unauthorized access both from within and outside the firm", // "comments":0, // "status": "completed", // "type": "improvement", // "user_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "votes": 556, // "is_public": true, // "created_at": "2025-03-10T17:11:00.045+00:00", // "updated_at": "2025-03-10T17:11:00.045+00:00", // "feedback_id": null, // "user_name": "Raj", // "user_email": "rajjwl2002@gmail.com", // "source": { // "id": "localhost", // "name": "slider", // "type": "Website" // }, // "last_retrieved_message": false, // "account_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "meta_data": null // }, // { // "id": "e50da271-d0dc-403f-afd5-b4a6704683ec", // "title": "Email notifications for product updates", // "description": "Send email notifications for your product updates directly from Beamer", // "status": "under_review", // "type": "task", // "user_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "votes": 455, // "is_public": true, // "created_at": "2025-03-10T17:11:00.045+00:00", // "updated_at": "2025-03-10T17:11:00.045+00:00", // "feedback_id": null, // "user_name": "Raj", // "user_email": "rajjwl2002@gmail.com", // "source": { // "id": "localhost", // "name": "slider", // "type": "Website" // }, // "last_retrieved_message": false, // "account_id": "21008c54-e3bf-4a84-a89c-d1e681221d88", // "meta_data": null // }, // ] // }, // { // "status": "planned", // "data":[] // } // ] // } // return data const url = config_1.serverUrl + `/feedback/issues/roadmaps?id=${organizationId}&website_id=${websiteId}`; const res = yield fetch(url); const result = yield res.json(); return result; }); exports.fetchRoadMaps = fetchRoadMaps;