@reviewskits/types 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # types
2
+
3
+ To install dependencies:
4
+
5
+ ```bash
6
+ bun install
7
+ ```
8
+
9
+ To run:
10
+
11
+ ```bash
12
+ bun run index.ts
13
+ ```
14
+
15
+ This project was created using `bun init` in bun v1.3.0. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
@@ -0,0 +1,94 @@
1
+ export type TestimonialStatus = 'pending' | 'approved' | 'rejected';
2
+ export type TestimonialSource = 'form' | 'import' | 'api';
3
+ export interface User {
4
+ id: string;
5
+ name: string;
6
+ email: string;
7
+ image?: string;
8
+ }
9
+ export interface Testimonial {
10
+ id: string;
11
+ content: string;
12
+ rating?: number;
13
+ status: TestimonialStatus;
14
+ source: TestimonialSource;
15
+ author: {
16
+ name: string;
17
+ email?: string;
18
+ title?: string;
19
+ };
20
+ created_at: Date;
21
+ }
22
+ export interface Form {
23
+ id: string;
24
+ name: string;
25
+ slug: string;
26
+ is_active: boolean;
27
+ created_at: Date;
28
+ }
29
+ /**
30
+ * Configuration passed when initialising a Reviewskits SDK.
31
+ */
32
+ export interface ReviewsKitConfig {
33
+ /** Your Reviewskits host URL (e.g. https://api.reviewskits.com) */
34
+ host: string;
35
+ /** Your public API key (pk_…) */
36
+ pk: string;
37
+ }
38
+ /**
39
+ * The shape of a review author as returned by the SDK.
40
+ */
41
+ export interface ReviewAuthor {
42
+ name: string;
43
+ email?: string;
44
+ title?: string;
45
+ url?: string;
46
+ }
47
+ /**
48
+ * A fully-mapped review object ready to be used in your UI.
49
+ */
50
+ export interface Review {
51
+ id: string;
52
+ content: string;
53
+ rating: number;
54
+ author: ReviewAuthor;
55
+ /** ISO 8601 date string */
56
+ createdAt: string;
57
+ /** Source platform (e.g. "google", "direct") */
58
+ source: string;
59
+ metadata?: Record<string, unknown>;
60
+ }
61
+ /**
62
+ * Parameters accepted by the reviews endpoint.
63
+ */
64
+ export interface ReviewApiParams {
65
+ formId: string;
66
+ page?: number;
67
+ limit?: number;
68
+ minRating?: number;
69
+ }
70
+ /**
71
+ * Raw review shape returned directly by the API (before mapping).
72
+ */
73
+ export interface RawReview {
74
+ id: string;
75
+ content: string;
76
+ rating: number;
77
+ authorName: string;
78
+ authorEmail?: string;
79
+ authorTitle?: string;
80
+ authorUrl?: string;
81
+ createdAt: string;
82
+ type: string;
83
+ metadata?: Record<string, unknown>;
84
+ }
85
+ export interface ReviewApiResponseMeta {
86
+ total: number;
87
+ page: number;
88
+ limit: number;
89
+ totalPages: number;
90
+ }
91
+ export interface ReviewApiResponse {
92
+ data: RawReview[];
93
+ meta: ReviewApiResponseMeta;
94
+ }
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ // ─── Back-end model types ─────────────────────────────────────────────────────
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@reviewskits/types",
3
+ "version": "0.0.1",
4
+ "files": [
5
+ "dist"
6
+ ],
7
+ "module": "./dist/index.js",
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "dev": "tsc --watch",
13
+ "lint": "tsc --noEmit",
14
+ "test": "echo 'No tests yet'"
15
+ },
16
+ "private": false,
17
+ "devDependencies": {
18
+ "@types/bun": "latest"
19
+ },
20
+ "peerDependencies": {
21
+ "typescript": "^5.9.3"
22
+ }
23
+ }