UNPKG

@crazy-web/feedback

Version:

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

378 lines (377 loc) 16.9 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.fetchPublicFeedbacks = void 0; const config_1 = require("../lib/config"); const fetchPublicFeedbacks = (_a) => __awaiter(void 0, [_a], void 0, function* ({ organizationId, page, websiteId }) { // if (page === 3) { // return { // success: true, // data: [] // } // } // const data = { // "success": true, // "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, // "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", // "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 // }, // { // "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, // "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", // // "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 // // }, // // { // // "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, // // "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", // // "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 // // }, // // { // // "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, // // "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", // // "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 // // }, // // { // // "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, // // "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", // // "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 // // }, // ] // } // return data const url = config_1.serverUrl + `/feedback/issues/public?id=${organizationId}&page=${page}&websiteId=${websiteId}`; const res = yield fetch(url); const result = yield res.json(); return result; }); exports.fetchPublicFeedbacks = fetchPublicFeedbacks;