@pagesolver/sdk 1.3.2 → 2.0.0
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 +39 -119
- package/dist/generated/schema.d.ts +427 -0
- package/dist/generated/schema.d.ts.map +1 -0
- package/dist/generated/schema.js +5 -0
- package/dist/index.d.ts +65 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +146 -3
- package/package.json +43 -47
- package/dist/index.js.map +0 -10
- package/dist/types.d.ts +0 -86
- package/dist/types.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,144 +1,64 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@pagesolver/sdk`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Typed TypeScript SDK for the public PageSolver `websites` API.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package is generated from:
|
|
6
|
+
|
|
7
|
+
- [infra/supabase/functions/websites/openapi.json](/Users/zekepari/Documents/GitHub/pagesolver/infra/supabase/functions/websites/openapi.json)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
6
10
|
|
|
7
11
|
```bash
|
|
8
12
|
npm install @pagesolver/sdk
|
|
9
|
-
# or
|
|
10
|
-
bun add @pagesolver/sdk
|
|
11
|
-
# or
|
|
12
|
-
yarn add @pagesolver/sdk
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
```typescript
|
|
18
|
-
import { PageSolverClient } from "@pagesolver/sdk";
|
|
19
|
-
|
|
20
|
-
const client = new PageSolverClient("your-business-key");
|
|
21
|
-
|
|
22
|
-
// Get comparisons - returns array directly
|
|
23
|
-
const comparisons = await client.getComparisons();
|
|
24
|
-
console.log(comparisons); // ComparisonImage[]
|
|
15
|
+
## Usage
|
|
25
16
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
console.log(showcases); // ShowcaseImage[]
|
|
17
|
+
```ts
|
|
18
|
+
import { createPageSolverSdk } from "@pagesolver/sdk";
|
|
29
19
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
const sdk = createPageSolverSdk({
|
|
21
|
+
baseUrl: "https://your-project.supabase.co/functions/v1/websites",
|
|
22
|
+
businessKey: process.env.PAGESOLVER_BUSINESS_KEY!,
|
|
23
|
+
});
|
|
33
24
|
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
25
|
+
const modules = await sdk.getModules();
|
|
26
|
+
const showcases = await sdk.getShowcases({ collection: "Bathrooms" });
|
|
27
|
+
```
|
|
37
28
|
|
|
38
|
-
|
|
39
|
-
const contact = await client.contact({
|
|
40
|
-
name: "John Doe",
|
|
41
|
-
email: "john@example.com",
|
|
42
|
-
service: "Detailing",
|
|
43
|
-
requested_date: "2025-03-10",
|
|
44
|
-
});
|
|
29
|
+
## Regenerate
|
|
45
30
|
|
|
46
|
-
|
|
31
|
+
```bash
|
|
32
|
+
bun run sdk:generate
|
|
47
33
|
```
|
|
48
34
|
|
|
49
|
-
|
|
35
|
+
The SDK package version is synced from:
|
|
50
36
|
|
|
51
|
-
|
|
37
|
+
- [infra/supabase/functions/websites/openapi.json](/Users/zekepari/Documents/GitHub/pagesolver/infra/supabase/functions/websites/openapi.json)
|
|
52
38
|
|
|
53
|
-
|
|
39
|
+
So when the OpenAPI `info.version` changes, the package version should change with it.
|
|
54
40
|
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
## Verify
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
bun run sdk:check
|
|
57
45
|
```
|
|
58
46
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
#### Methods
|
|
62
|
-
|
|
63
|
-
| Method | Description | Return Type |
|
|
64
|
-
| --- | --- | --- |
|
|
65
|
-
| `getComparisons()` | Fetch before/after comparison images | `ComparisonImage[]` |
|
|
66
|
-
| `getShowcases()` | Fetch showcase gallery images | `ShowcaseImage[]` |
|
|
67
|
-
| `getGoogleReviews()` | Fetch Google Business Profile reviews + metadata | `GoogleReviewsResponse` |
|
|
68
|
-
| `getGoogleHours()` | Fetch Google Business Profile opening hours | `GoogleHoursResponse` |
|
|
69
|
-
| `getInstagramPosts()` | Fetch recent Instagram posts (requires connected account) | `SocialMediaResponse` |
|
|
70
|
-
| `getFacebookPosts()` | Fetch recent Facebook posts (requires connected account) | `SocialMediaResponse` |
|
|
71
|
-
| `contact(data)` | Submit a contact form payload (flat JSON object) | `ContactResponse`
|
|
72
|
-
|
|
73
|
-
All methods throw an `Error` when the API responds with a non-2xx status, so wrap calls in `try/catch` if you want to handle failures gracefully.
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
try {
|
|
77
|
-
const comparisons = await client.getComparisons();
|
|
78
|
-
console.log(`Found ${comparisons.length} comparisons`);
|
|
79
|
-
} catch (error) {
|
|
80
|
-
console.error("Failed to load comparisons", error);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const contact = await client.contact({
|
|
84
|
-
name: "Fresh & Clean",
|
|
85
|
-
phone: "+1 555-0100",
|
|
86
|
-
message: "Need a quote",
|
|
87
|
-
source: "website-landing",
|
|
88
|
-
budget: 250,
|
|
89
|
-
});
|
|
47
|
+
## Build
|
|
90
48
|
|
|
91
|
-
|
|
49
|
+
```bash
|
|
50
|
+
bun run sdk:build
|
|
92
51
|
```
|
|
93
52
|
|
|
94
|
-
##
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
interface ComparisonImage {
|
|
100
|
-
id: string;
|
|
101
|
-
business_id: number;
|
|
102
|
-
before_url: string;
|
|
103
|
-
after_url: string;
|
|
104
|
-
title: string;
|
|
105
|
-
description: string | null;
|
|
106
|
-
updated_at: string;
|
|
107
|
-
created_at: string;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
interface ShowcaseImage {
|
|
111
|
-
id: string;
|
|
112
|
-
business_id: number;
|
|
113
|
-
image_url: string[];
|
|
114
|
-
title: string;
|
|
115
|
-
description: string | null;
|
|
116
|
-
updated_at: string;
|
|
117
|
-
created_at: string;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
type ContactData = Record<string, unknown>; // any flat key/value payload
|
|
121
|
-
|
|
122
|
-
interface ContactResponse {
|
|
123
|
-
success: boolean;
|
|
124
|
-
message: string;
|
|
125
|
-
contactId: string | null;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
interface GoogleReviewsResponse {
|
|
129
|
-
business: BusinessInfo; // includes id, name, optional website/phone
|
|
130
|
-
rating: number | null;
|
|
131
|
-
totalReviews: number;
|
|
132
|
-
reviews: GoogleReview[];
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
interface SocialMediaResponse {
|
|
136
|
-
business: BusinessInfo;
|
|
137
|
-
posts: FacebookPost[] | InstagramPost[];
|
|
138
|
-
platform: "facebook" | "instagram";
|
|
139
|
-
}
|
|
53
|
+
## Publish
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
bun run sdk:publish
|
|
140
57
|
```
|
|
141
58
|
|
|
142
|
-
|
|
59
|
+
For prereleases or alternate npm tags:
|
|
143
60
|
|
|
144
|
-
|
|
61
|
+
```bash
|
|
62
|
+
cd packages/sdk
|
|
63
|
+
bun publish --access public --tag next
|
|
64
|
+
```
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
export interface paths {
|
|
6
|
+
"/v2/modules": {
|
|
7
|
+
parameters: {
|
|
8
|
+
query?: never;
|
|
9
|
+
header?: never;
|
|
10
|
+
path?: never;
|
|
11
|
+
cookie?: never;
|
|
12
|
+
};
|
|
13
|
+
/** List enabled website modules */
|
|
14
|
+
get: {
|
|
15
|
+
parameters: {
|
|
16
|
+
query?: never;
|
|
17
|
+
header?: never;
|
|
18
|
+
path?: never;
|
|
19
|
+
cookie?: never;
|
|
20
|
+
};
|
|
21
|
+
requestBody?: never;
|
|
22
|
+
responses: {
|
|
23
|
+
/** @description Enabled modules */
|
|
24
|
+
200: {
|
|
25
|
+
headers: {
|
|
26
|
+
[name: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
content: {
|
|
29
|
+
"application/json": {
|
|
30
|
+
modules: string[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** @description Missing business key */
|
|
35
|
+
400: {
|
|
36
|
+
headers: {
|
|
37
|
+
[name: string]: unknown;
|
|
38
|
+
};
|
|
39
|
+
content: {
|
|
40
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/** @description Invalid business key */
|
|
44
|
+
401: {
|
|
45
|
+
headers: {
|
|
46
|
+
[name: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
content: {
|
|
49
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
put?: never;
|
|
55
|
+
post?: never;
|
|
56
|
+
delete?: never;
|
|
57
|
+
options?: never;
|
|
58
|
+
head?: never;
|
|
59
|
+
patch?: never;
|
|
60
|
+
trace?: never;
|
|
61
|
+
};
|
|
62
|
+
"/v2/showcases": {
|
|
63
|
+
parameters: {
|
|
64
|
+
query?: never;
|
|
65
|
+
header?: never;
|
|
66
|
+
path?: never;
|
|
67
|
+
cookie?: never;
|
|
68
|
+
};
|
|
69
|
+
/** List showcase items */
|
|
70
|
+
get: {
|
|
71
|
+
parameters: {
|
|
72
|
+
query?: {
|
|
73
|
+
/** @description Optional showcase collection name filter. */
|
|
74
|
+
collection?: string;
|
|
75
|
+
};
|
|
76
|
+
header?: never;
|
|
77
|
+
path?: never;
|
|
78
|
+
cookie?: never;
|
|
79
|
+
};
|
|
80
|
+
requestBody?: never;
|
|
81
|
+
responses: {
|
|
82
|
+
/** @description Showcases and available collections */
|
|
83
|
+
200: {
|
|
84
|
+
headers: {
|
|
85
|
+
[name: string]: unknown;
|
|
86
|
+
};
|
|
87
|
+
content: {
|
|
88
|
+
"application/json": {
|
|
89
|
+
showcases: components["schemas"]["Showcase"][];
|
|
90
|
+
collections: components["schemas"]["Collection"][];
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
/** @description Showcase module is not enabled */
|
|
95
|
+
403: {
|
|
96
|
+
headers: {
|
|
97
|
+
[name: string]: unknown;
|
|
98
|
+
};
|
|
99
|
+
content: {
|
|
100
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
put?: never;
|
|
106
|
+
post?: never;
|
|
107
|
+
delete?: never;
|
|
108
|
+
options?: never;
|
|
109
|
+
head?: never;
|
|
110
|
+
patch?: never;
|
|
111
|
+
trace?: never;
|
|
112
|
+
};
|
|
113
|
+
"/v2/comparisons": {
|
|
114
|
+
parameters: {
|
|
115
|
+
query?: never;
|
|
116
|
+
header?: never;
|
|
117
|
+
path?: never;
|
|
118
|
+
cookie?: never;
|
|
119
|
+
};
|
|
120
|
+
/** List comparison items */
|
|
121
|
+
get: {
|
|
122
|
+
parameters: {
|
|
123
|
+
query?: {
|
|
124
|
+
/** @description Optional comparison collection name filter. */
|
|
125
|
+
collection?: string;
|
|
126
|
+
};
|
|
127
|
+
header?: never;
|
|
128
|
+
path?: never;
|
|
129
|
+
cookie?: never;
|
|
130
|
+
};
|
|
131
|
+
requestBody?: never;
|
|
132
|
+
responses: {
|
|
133
|
+
/** @description Comparisons and available collections */
|
|
134
|
+
200: {
|
|
135
|
+
headers: {
|
|
136
|
+
[name: string]: unknown;
|
|
137
|
+
};
|
|
138
|
+
content: {
|
|
139
|
+
"application/json": {
|
|
140
|
+
comparisons: components["schemas"]["Comparison"][];
|
|
141
|
+
collections: components["schemas"]["Collection"][];
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
/** @description Comparison module is not enabled */
|
|
146
|
+
403: {
|
|
147
|
+
headers: {
|
|
148
|
+
[name: string]: unknown;
|
|
149
|
+
};
|
|
150
|
+
content: {
|
|
151
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
put?: never;
|
|
157
|
+
post?: never;
|
|
158
|
+
delete?: never;
|
|
159
|
+
options?: never;
|
|
160
|
+
head?: never;
|
|
161
|
+
patch?: never;
|
|
162
|
+
trace?: never;
|
|
163
|
+
};
|
|
164
|
+
"/v2/contact": {
|
|
165
|
+
parameters: {
|
|
166
|
+
query?: never;
|
|
167
|
+
header?: never;
|
|
168
|
+
path?: never;
|
|
169
|
+
cookie?: never;
|
|
170
|
+
};
|
|
171
|
+
get?: never;
|
|
172
|
+
put?: never;
|
|
173
|
+
/** Submit a website contact payload */
|
|
174
|
+
post: {
|
|
175
|
+
parameters: {
|
|
176
|
+
query?: never;
|
|
177
|
+
header?: never;
|
|
178
|
+
path?: never;
|
|
179
|
+
cookie?: never;
|
|
180
|
+
};
|
|
181
|
+
requestBody: {
|
|
182
|
+
content: {
|
|
183
|
+
"application/json": components["schemas"]["ContactPayload"];
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
responses: {
|
|
187
|
+
/** @description Contact submission accepted */
|
|
188
|
+
200: {
|
|
189
|
+
headers: {
|
|
190
|
+
[name: string]: unknown;
|
|
191
|
+
};
|
|
192
|
+
content: {
|
|
193
|
+
"application/json": components["schemas"]["ContactResponse"];
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
/** @description Invalid form payload or missing business key */
|
|
197
|
+
400: {
|
|
198
|
+
headers: {
|
|
199
|
+
[name: string]: unknown;
|
|
200
|
+
};
|
|
201
|
+
content: {
|
|
202
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
/** @description Contact module is not enabled */
|
|
206
|
+
403: {
|
|
207
|
+
headers: {
|
|
208
|
+
[name: string]: unknown;
|
|
209
|
+
};
|
|
210
|
+
content: {
|
|
211
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
delete?: never;
|
|
217
|
+
options?: never;
|
|
218
|
+
head?: never;
|
|
219
|
+
patch?: never;
|
|
220
|
+
trace?: never;
|
|
221
|
+
};
|
|
222
|
+
"/v2/reviews": {
|
|
223
|
+
parameters: {
|
|
224
|
+
query?: never;
|
|
225
|
+
header?: never;
|
|
226
|
+
path?: never;
|
|
227
|
+
cookie?: never;
|
|
228
|
+
};
|
|
229
|
+
/** Fetch reviews for the website */
|
|
230
|
+
get: {
|
|
231
|
+
parameters: {
|
|
232
|
+
query?: never;
|
|
233
|
+
header?: never;
|
|
234
|
+
path?: never;
|
|
235
|
+
cookie?: never;
|
|
236
|
+
};
|
|
237
|
+
requestBody?: never;
|
|
238
|
+
responses: {
|
|
239
|
+
/** @description Google reviews for the website */
|
|
240
|
+
200: {
|
|
241
|
+
headers: {
|
|
242
|
+
[name: string]: unknown;
|
|
243
|
+
};
|
|
244
|
+
content: {
|
|
245
|
+
"application/json": {
|
|
246
|
+
website: components["schemas"]["WebsiteSummary"];
|
|
247
|
+
rating: number | null;
|
|
248
|
+
userRatingCount: number;
|
|
249
|
+
reviews: components["schemas"]["GoogleReview"][];
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
/** @description Google review display is not enabled or OAuth is incomplete */
|
|
254
|
+
403: {
|
|
255
|
+
headers: {
|
|
256
|
+
[name: string]: unknown;
|
|
257
|
+
};
|
|
258
|
+
content: {
|
|
259
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
/** @description Google Business Profile is not configured */
|
|
263
|
+
404: {
|
|
264
|
+
headers: {
|
|
265
|
+
[name: string]: unknown;
|
|
266
|
+
};
|
|
267
|
+
content: {
|
|
268
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
put?: never;
|
|
274
|
+
post?: never;
|
|
275
|
+
delete?: never;
|
|
276
|
+
options?: never;
|
|
277
|
+
head?: never;
|
|
278
|
+
patch?: never;
|
|
279
|
+
trace?: never;
|
|
280
|
+
};
|
|
281
|
+
"/v2/facebook": {
|
|
282
|
+
parameters: {
|
|
283
|
+
query?: never;
|
|
284
|
+
header?: never;
|
|
285
|
+
path?: never;
|
|
286
|
+
cookie?: never;
|
|
287
|
+
};
|
|
288
|
+
/** Fetch Facebook content for the website */
|
|
289
|
+
get: {
|
|
290
|
+
parameters: {
|
|
291
|
+
query?: never;
|
|
292
|
+
header?: never;
|
|
293
|
+
path?: never;
|
|
294
|
+
cookie?: never;
|
|
295
|
+
};
|
|
296
|
+
requestBody?: never;
|
|
297
|
+
responses: {
|
|
298
|
+
/** @description Facebook posts for the website */
|
|
299
|
+
200: {
|
|
300
|
+
headers: {
|
|
301
|
+
[name: string]: unknown;
|
|
302
|
+
};
|
|
303
|
+
content: {
|
|
304
|
+
"application/json": {
|
|
305
|
+
website: components["schemas"]["WebsiteSummary"];
|
|
306
|
+
/** @enum {string} */
|
|
307
|
+
platform: "facebook";
|
|
308
|
+
posts: components["schemas"]["FacebookPost"][];
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
/** @description Facebook feed module is not enabled */
|
|
313
|
+
403: {
|
|
314
|
+
headers: {
|
|
315
|
+
[name: string]: unknown;
|
|
316
|
+
};
|
|
317
|
+
content: {
|
|
318
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
/** @description Facebook is not connected */
|
|
322
|
+
404: {
|
|
323
|
+
headers: {
|
|
324
|
+
[name: string]: unknown;
|
|
325
|
+
};
|
|
326
|
+
content: {
|
|
327
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
put?: never;
|
|
333
|
+
post?: never;
|
|
334
|
+
delete?: never;
|
|
335
|
+
options?: never;
|
|
336
|
+
head?: never;
|
|
337
|
+
patch?: never;
|
|
338
|
+
trace?: never;
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
export type webhooks = Record<string, never>;
|
|
342
|
+
export interface components {
|
|
343
|
+
schemas: {
|
|
344
|
+
Collection: {
|
|
345
|
+
/** Format: uuid */
|
|
346
|
+
id: string;
|
|
347
|
+
name: string;
|
|
348
|
+
};
|
|
349
|
+
Showcase: {
|
|
350
|
+
/** Format: uuid */
|
|
351
|
+
id: string;
|
|
352
|
+
business_id: number;
|
|
353
|
+
title: string;
|
|
354
|
+
description?: string | null;
|
|
355
|
+
image_url: string[];
|
|
356
|
+
/** Format: uuid */
|
|
357
|
+
collection_id?: string | null;
|
|
358
|
+
/** Format: date-time */
|
|
359
|
+
created_at: string;
|
|
360
|
+
/** Format: date-time */
|
|
361
|
+
updated_at: string;
|
|
362
|
+
collection?: components["schemas"]["Collection"] | null;
|
|
363
|
+
};
|
|
364
|
+
Comparison: {
|
|
365
|
+
/** Format: uuid */
|
|
366
|
+
id: string;
|
|
367
|
+
business_id: number;
|
|
368
|
+
title: string;
|
|
369
|
+
description?: string | null;
|
|
370
|
+
before_url: string;
|
|
371
|
+
after_url: string;
|
|
372
|
+
/** Format: uuid */
|
|
373
|
+
collection_id?: string | null;
|
|
374
|
+
/** Format: date-time */
|
|
375
|
+
created_at: string;
|
|
376
|
+
/** Format: date-time */
|
|
377
|
+
updated_at: string;
|
|
378
|
+
collection?: components["schemas"]["Collection"] | null;
|
|
379
|
+
};
|
|
380
|
+
WebsiteSummary: {
|
|
381
|
+
id: string;
|
|
382
|
+
name: string;
|
|
383
|
+
url?: string | null;
|
|
384
|
+
};
|
|
385
|
+
GoogleReview: {
|
|
386
|
+
rating: number;
|
|
387
|
+
author: string;
|
|
388
|
+
authorPhoto?: string | null;
|
|
389
|
+
text: string;
|
|
390
|
+
publishTime: string;
|
|
391
|
+
relativePublishTime: string;
|
|
392
|
+
};
|
|
393
|
+
FacebookPost: {
|
|
394
|
+
id: string;
|
|
395
|
+
message?: string | null;
|
|
396
|
+
story?: string | null;
|
|
397
|
+
full_picture?: string | null;
|
|
398
|
+
permalink_url: string;
|
|
399
|
+
created_time: string;
|
|
400
|
+
type?: string | null;
|
|
401
|
+
status_type?: string | null;
|
|
402
|
+
is_published?: boolean | null;
|
|
403
|
+
};
|
|
404
|
+
/** @description Arbitrary website contact payload. Values are normalized to strings before storage. */
|
|
405
|
+
ContactPayload: {
|
|
406
|
+
[key: string]: unknown;
|
|
407
|
+
};
|
|
408
|
+
ContactResponse: {
|
|
409
|
+
success: boolean;
|
|
410
|
+
message: string;
|
|
411
|
+
/** Format: uuid */
|
|
412
|
+
contactId: string | null;
|
|
413
|
+
};
|
|
414
|
+
ErrorResponse: {
|
|
415
|
+
error: string;
|
|
416
|
+
details?: unknown;
|
|
417
|
+
};
|
|
418
|
+
};
|
|
419
|
+
responses: never;
|
|
420
|
+
parameters: never;
|
|
421
|
+
requestBodies: never;
|
|
422
|
+
headers: never;
|
|
423
|
+
pathItems: never;
|
|
424
|
+
}
|
|
425
|
+
export type $defs = Record<string, never>;
|
|
426
|
+
export type operations = Record<string, never>;
|
|
427
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/generated/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,KAAK;IAClB,aAAa,EAAE;QACX,UAAU,EAAE;YACR,KAAK,CAAC,EAAE,KAAK,CAAC;YACd,MAAM,CAAC,EAAE,KAAK,CAAC;YACf,IAAI,CAAC,EAA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MAAM,EAAE,KAAK,CAAC,CAAC;AAC1C,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,68 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { components, paths } from "./generated/schema.js";
|
|
2
|
+
type HttpMethod = "get" | "post";
|
|
3
|
+
type Operation<Path extends keyof paths, Method extends keyof paths[Path] & HttpMethod> = NonNullable<paths[Path][Method]>;
|
|
4
|
+
type JsonRequestBody<Path extends keyof paths, Method extends keyof paths[Path] & HttpMethod> = Operation<Path, Method> extends {
|
|
5
|
+
requestBody: {
|
|
6
|
+
content: {
|
|
7
|
+
"application/json": infer Body;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
} ? Body : never;
|
|
11
|
+
type JsonResponse<Path extends keyof paths, Method extends keyof paths[Path] & HttpMethod, Status extends keyof Operation<Path, Method>["responses"]> = Operation<Path, Method>["responses"][Status] extends {
|
|
12
|
+
content: {
|
|
13
|
+
"application/json": infer Body;
|
|
14
|
+
};
|
|
15
|
+
} ? Body : never;
|
|
16
|
+
export type PageSolverApiPaths = paths;
|
|
17
|
+
export type PageSolverApiComponents = components;
|
|
18
|
+
export type PageSolverApiErrorResponse = components["schemas"]["ErrorResponse"];
|
|
19
|
+
export type ContactPayload = JsonRequestBody<"/v2/contact", "post">;
|
|
20
|
+
export type ContactResponse = JsonResponse<"/v2/contact", "post", 200>;
|
|
21
|
+
export type ModulesResponse = JsonResponse<"/v2/modules", "get", 200>;
|
|
22
|
+
export type ShowcasesResponse = JsonResponse<"/v2/showcases", "get", 200>;
|
|
23
|
+
export type ComparisonsResponse = JsonResponse<"/v2/comparisons", "get", 200>;
|
|
24
|
+
export type ReviewsResponse = JsonResponse<"/v2/reviews", "get", 200>;
|
|
25
|
+
export type FacebookResponse = JsonResponse<"/v2/facebook", "get", 200>;
|
|
26
|
+
export interface PageSolverSdkConfig {
|
|
27
|
+
baseUrl: string;
|
|
28
|
+
businessKey: string;
|
|
29
|
+
fetch?: typeof globalThis.fetch;
|
|
30
|
+
headers?: HeadersInit;
|
|
31
|
+
}
|
|
32
|
+
export interface RequestOptions {
|
|
33
|
+
headers?: HeadersInit;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
}
|
|
36
|
+
export interface CollectionFilterOptions extends RequestOptions {
|
|
37
|
+
collection?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface PageSolverApiErrorOptions<TData> {
|
|
40
|
+
status: number;
|
|
41
|
+
data: TData | null;
|
|
42
|
+
response: Response;
|
|
43
|
+
url: string;
|
|
44
|
+
}
|
|
45
|
+
export declare class PageSolverApiError<TData = PageSolverApiErrorResponse> extends Error {
|
|
46
|
+
readonly status: number;
|
|
47
|
+
readonly data: TData | null;
|
|
48
|
+
readonly response: Response;
|
|
49
|
+
readonly url: string;
|
|
50
|
+
constructor(message: string, options: PageSolverApiErrorOptions<TData>);
|
|
51
|
+
}
|
|
52
|
+
export declare class PageSolverSdk {
|
|
53
|
+
private readonly baseUrl;
|
|
54
|
+
private readonly businessKey;
|
|
55
|
+
private readonly fetchImpl;
|
|
56
|
+
private readonly defaultHeaders?;
|
|
57
|
+
constructor(config: PageSolverSdkConfig);
|
|
58
|
+
getModules(options?: RequestOptions): Promise<ModulesResponse>;
|
|
59
|
+
getShowcases(options?: CollectionFilterOptions): Promise<ShowcasesResponse>;
|
|
60
|
+
getComparisons(options?: CollectionFilterOptions): Promise<ComparisonsResponse>;
|
|
61
|
+
getReviews(options?: RequestOptions): Promise<ReviewsResponse>;
|
|
62
|
+
getFacebook(options?: RequestOptions): Promise<FacebookResponse>;
|
|
63
|
+
submitContact(payload: ContactPayload, options?: RequestOptions): Promise<ContactResponse>;
|
|
6
64
|
private request;
|
|
7
|
-
getComparisons(): Promise<ComparisonImage[]>;
|
|
8
|
-
getShowcases(): Promise<ShowcaseImage[]>;
|
|
9
|
-
getGoogleReviews(): Promise<GoogleReviewsResponse>;
|
|
10
|
-
getGoogleHours(): Promise<GoogleHoursResponse>;
|
|
11
|
-
getInstagramPosts(): Promise<SocialMediaResponse>;
|
|
12
|
-
getFacebookPosts(): Promise<SocialMediaResponse>;
|
|
13
|
-
contact(data: ContactData): Promise<ContactResponse>;
|
|
14
65
|
}
|
|
15
|
-
export
|
|
66
|
+
export declare function createPageSolverSdk(config: PageSolverSdkConfig): PageSolverSdk;
|
|
67
|
+
export type { components, paths } from "./generated/schema.js";
|
|
16
68
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE/D,KAAK,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;AACjC,KAAK,SAAS,CACZ,IAAI,SAAS,MAAM,KAAK,EACxB,MAAM,SAAS,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,IAC3C,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAErC,KAAK,eAAe,CAClB,IAAI,SAAS,MAAM,KAAK,EACxB,MAAM,SAAS,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,IAC3C,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS;IAClC,WAAW,EAAE;QACX,OAAO,EAAE;YACP,kBAAkB,EAAE,MAAM,IAAI,CAAC;SAChC,CAAC;KACH,CAAC;CACH,GACG,IAAI,GACJ,KAAK,CAAC;AAEV,KAAK,YAAY,CACf,IAAI,SAAS,MAAM,KAAK,EACxB,MAAM,SAAS,MAAM,KA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W,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAOhE,aAAa,CACX,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,eAAe,CAAC;YAQb,OAAO;CA6CtB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAE9E;AAyDD,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,146 @@
|
|
|
1
|
-
class
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export class PageSolverApiError extends Error {
|
|
2
|
+
status;
|
|
3
|
+
data;
|
|
4
|
+
response;
|
|
5
|
+
url;
|
|
6
|
+
constructor(message, options) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = "PageSolverApiError";
|
|
9
|
+
this.status = options.status;
|
|
10
|
+
this.data = options.data;
|
|
11
|
+
this.response = options.response;
|
|
12
|
+
this.url = options.url;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class PageSolverSdk {
|
|
16
|
+
baseUrl;
|
|
17
|
+
businessKey;
|
|
18
|
+
fetchImpl;
|
|
19
|
+
defaultHeaders;
|
|
20
|
+
constructor(config) {
|
|
21
|
+
if (!config.baseUrl) {
|
|
22
|
+
throw new Error("PageSolver SDK requires a baseUrl.");
|
|
23
|
+
}
|
|
24
|
+
if (!config.businessKey) {
|
|
25
|
+
throw new Error("PageSolver SDK requires a businessKey.");
|
|
26
|
+
}
|
|
27
|
+
if (!config.fetch && typeof globalThis.fetch !== "function") {
|
|
28
|
+
throw new Error("PageSolver SDK requires a fetch implementation in this runtime.");
|
|
29
|
+
}
|
|
30
|
+
this.baseUrl = normalizeBaseUrl(config.baseUrl);
|
|
31
|
+
this.businessKey = config.businessKey;
|
|
32
|
+
this.fetchImpl = config.fetch ?? globalThis.fetch;
|
|
33
|
+
this.defaultHeaders = config.headers;
|
|
34
|
+
}
|
|
35
|
+
getModules(options) {
|
|
36
|
+
return this.request("/v2/modules", {
|
|
37
|
+
method: "GET",
|
|
38
|
+
...options,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
getShowcases(options = {}) {
|
|
42
|
+
return this.request("/v2/showcases", {
|
|
43
|
+
method: "GET",
|
|
44
|
+
query: options.collection ? { collection: options.collection } : undefined,
|
|
45
|
+
headers: options.headers,
|
|
46
|
+
signal: options.signal,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
getComparisons(options = {}) {
|
|
50
|
+
return this.request("/v2/comparisons", {
|
|
51
|
+
method: "GET",
|
|
52
|
+
query: options.collection ? { collection: options.collection } : undefined,
|
|
53
|
+
headers: options.headers,
|
|
54
|
+
signal: options.signal,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
getReviews(options) {
|
|
58
|
+
return this.request("/v2/reviews", {
|
|
59
|
+
method: "GET",
|
|
60
|
+
...options,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
getFacebook(options) {
|
|
64
|
+
return this.request("/v2/facebook", {
|
|
65
|
+
method: "GET",
|
|
66
|
+
...options,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
submitContact(payload, options) {
|
|
70
|
+
return this.request("/v2/contact", {
|
|
71
|
+
method: "POST",
|
|
72
|
+
body: payload,
|
|
73
|
+
...options,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
async request(path, options) {
|
|
77
|
+
const url = buildRequestUrl(this.baseUrl, path, options.query);
|
|
78
|
+
const headers = new Headers(this.defaultHeaders);
|
|
79
|
+
headers.set("X-Business-Key", this.businessKey);
|
|
80
|
+
headers.set("Accept", "application/json");
|
|
81
|
+
if (options.headers) {
|
|
82
|
+
mergeHeaders(headers, options.headers);
|
|
83
|
+
}
|
|
84
|
+
let body;
|
|
85
|
+
if (options.body !== undefined) {
|
|
86
|
+
headers.set("Content-Type", "application/json");
|
|
87
|
+
body = JSON.stringify(options.body);
|
|
88
|
+
}
|
|
89
|
+
const response = await this.fetchImpl(url.toString(), {
|
|
90
|
+
method: options.method,
|
|
91
|
+
headers,
|
|
92
|
+
body,
|
|
93
|
+
signal: options.signal,
|
|
94
|
+
});
|
|
95
|
+
const payload = await parseJsonResponse(response);
|
|
96
|
+
if (!response.ok) {
|
|
97
|
+
throw new PageSolverApiError(getErrorMessage(payload, response.status), {
|
|
98
|
+
status: response.status,
|
|
99
|
+
data: payload,
|
|
100
|
+
response,
|
|
101
|
+
url: url.toString(),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return payload;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export function createPageSolverSdk(config) {
|
|
108
|
+
return new PageSolverSdk(config);
|
|
109
|
+
}
|
|
110
|
+
function normalizeBaseUrl(baseUrl) {
|
|
111
|
+
return baseUrl.replace(/\/+$/, "");
|
|
112
|
+
}
|
|
113
|
+
function buildRequestUrl(baseUrl, path, query) {
|
|
114
|
+
const url = new URL(path.replace(/^\/+/, ""), `${baseUrl}/`);
|
|
115
|
+
if (!query) {
|
|
116
|
+
return url;
|
|
117
|
+
}
|
|
118
|
+
for (const [key, value] of Object.entries(query)) {
|
|
119
|
+
if (value === null || value === undefined) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
url.searchParams.set(key, String(value));
|
|
123
|
+
}
|
|
124
|
+
return url;
|
|
125
|
+
}
|
|
126
|
+
function mergeHeaders(target, source) {
|
|
127
|
+
new Headers(source).forEach((value, key) => {
|
|
128
|
+
target.set(key, value);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
async function parseJsonResponse(response) {
|
|
132
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
133
|
+
if (!contentType.includes("application/json")) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return response.json();
|
|
137
|
+
}
|
|
138
|
+
function getErrorMessage(payload, status) {
|
|
139
|
+
if (payload &&
|
|
140
|
+
typeof payload === "object" &&
|
|
141
|
+
"error" in payload &&
|
|
142
|
+
typeof payload.error === "string") {
|
|
143
|
+
return payload.error;
|
|
144
|
+
}
|
|
145
|
+
return `PageSolver request failed with status ${status}.`;
|
|
146
|
+
}
|
package/package.json
CHANGED
|
@@ -1,61 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagesolver/sdk",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"import": "./dist/index.js",
|
|
11
|
-
"require": "./dist/index.js",
|
|
12
|
-
"types": "./dist/index.d.ts"
|
|
13
|
-
}
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Typed TypeScript SDK for the public PageSolver websites API.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Prompt Solutions"
|
|
14
7
|
},
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"prepare": "bun run build",
|
|
27
|
-
"prepublishOnly": "bun run lint && bun run type-check && bun run test && bun run build",
|
|
28
|
-
"version:patch": "npm version patch",
|
|
29
|
-
"version:minor": "npm version minor",
|
|
30
|
-
"version:major": "npm version major"
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/zekepari/pagesolver.git",
|
|
14
|
+
"directory": "packages/sdk"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://pagesolver.com",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/zekepari/pagesolver/issues"
|
|
31
19
|
},
|
|
32
20
|
"keywords": [
|
|
33
21
|
"pagesolver",
|
|
34
|
-
"api",
|
|
35
22
|
"sdk",
|
|
36
23
|
"typescript",
|
|
37
|
-
"
|
|
24
|
+
"openapi",
|
|
25
|
+
"supabase"
|
|
38
26
|
],
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./generated/schema": {
|
|
39
|
+
"types": "./dist/generated/schema.d.ts",
|
|
40
|
+
"import": "./dist/generated/schema.js"
|
|
41
|
+
}
|
|
47
42
|
},
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
"@biomejs/biome": "^1.8.3",
|
|
51
|
-
"@types/bun": "latest",
|
|
52
|
-
"typescript": "^5.5.2"
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
53
45
|
},
|
|
54
|
-
"
|
|
55
|
-
"
|
|
46
|
+
"scripts": {
|
|
47
|
+
"generate": "openapi-typescript ../../infra/supabase/functions/websites/openapi.json -o ./src/generated/schema.ts",
|
|
48
|
+
"build:dist": "tsc --project tsconfig.build.json",
|
|
49
|
+
"build": "bun run --cwd ../.. sdk:sync-version && bun run generate && bun run build:dist",
|
|
50
|
+
"typecheck": "bun run --cwd ../.. sdk:sync-version && bun run generate && tsc --project tsconfig.build.json --noEmit",
|
|
51
|
+
"publish:npm": "bun publish --access public",
|
|
52
|
+
"prepublishOnly": "bun run build"
|
|
56
53
|
},
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"bun": ">=1.0.0"
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"typescript": "^5"
|
|
60
56
|
}
|
|
61
57
|
}
|
package/dist/index.js.map
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"// Import all types from the types file\nimport type {\n ComparisonImage,\n ComparisonsResponse,\n ContactData,\n ContactResponse,\n FacebookPost,\n GoogleHoursResponse,\n GoogleReview,\n GoogleReviewsResponse,\n InstagramPost,\n ShowcaseImage,\n ShowcasesResponse,\n SocialMediaResponse,\n} from \"./types\";\n\nexport class PageSolverClient {\n private baseUrl = \"https://pagesolver.com/api/v1\";\n private businessKey: string;\n\n constructor(businessKey: string) {\n this.businessKey = businessKey;\n }\n\n private async request<T>(\n endpoint: string,\n options: RequestInit = {}\n ): Promise<T> {\n try {\n const url = `${this.baseUrl}${endpoint}`;\n\n const headers = {\n \"Content-Type\": \"application/json\",\n \"x-business-key\": this.businessKey,\n ...options.headers,\n };\n\n const response = await fetch(url, {\n ...options,\n headers,\n });\n\n let data: unknown;\n const contentType = response.headers.get(\"Content-Type\");\n if (contentType?.includes(\"application/json\")) {\n data = await response.json();\n } else {\n data = await response.text();\n }\n\n if (!response.ok) {\n const errorMessage =\n (data as { error?: string })?.error || \"An unknown error occurred\";\n throw new Error(`API Error (${response.status}): ${errorMessage}`);\n }\n\n return data as T;\n } catch (error) {\n if (error instanceof Error) {\n throw error;\n }\n throw new Error(\"Network error occurred\");\n }\n }\n\n // Comparison Images\n async getComparisons(): Promise<ComparisonImage[]> {\n const response = await this.request<ComparisonsResponse>(\n \"/business/comparisons\"\n );\n return response.comparisons;\n }\n\n // Showcase Images\n async getShowcases(): Promise<ShowcaseImage[]> {\n const response = await this.request<ShowcasesResponse>(\n \"/business/showcases\"\n );\n return response.showcases;\n }\n\n // Google Reviews\n async getGoogleReviews(): Promise<GoogleReviewsResponse> {\n return await this.request<GoogleReviewsResponse>(\n \"/business/google/reviews\"\n );\n }\n\n // Google Hours\n async getGoogleHours(): Promise<GoogleHoursResponse> {\n return await this.request<GoogleHoursResponse>(\"/business/google/hours\");\n }\n\n // Social Media - Instagram\n async getInstagramPosts(): Promise<SocialMediaResponse> {\n return await this.request<SocialMediaResponse>(\n \"/business/social/instagram\"\n );\n }\n\n // Social Media - Facebook\n async getFacebookPosts(): Promise<SocialMediaResponse> {\n return await this.request<SocialMediaResponse>(\"/business/social/facebook\");\n }\n\n // Contact\n async contact(data: ContactData): Promise<ContactResponse> {\n return await this.request<ContactResponse>(\"/business/contact\", {\n method: \"POST\",\n body: JSON.stringify(data),\n });\n }\n}\n\n// Re-export all types for consumers\nexport type {\n ComparisonImage,\n ComparisonsResponse,\n ShowcaseImage,\n ShowcasesResponse,\n ContactData,\n ContactResponse,\n GoogleReview,\n GoogleReviewsResponse,\n GoogleHoursResponse,\n BusinessHours,\n CurrentTime,\n FacebookPost,\n InstagramPost,\n SocialMediaResponse,\n BusinessInfo,\n} from \"./types\";\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "AAgBO,MAAM,CAAiB,CACpB,QAAU,gCACV,YAER,WAAW,CAAC,EAAqB,CAC/B,KAAK,YAAc,OAGP,QAAU,CACtB,EACA,EAAuB,CAAC,EACZ,CACZ,GAAI,CACF,IAAM,EAAM,GAAG,KAAK,UAAU,IAExB,EAAU,CACd,eAAgB,mBAChB,iBAAkB,KAAK,eACpB,EAAQ,OACb,EAEM,EAAW,MAAM,MAAM,EAAK,IAC7B,EACH,SACF,CAAC,EAEG,EAEJ,GADoB,EAAS,QAAQ,IAAI,cAAc,GACtC,SAAS,kBAAkB,EAC1C,EAAO,MAAM,EAAS,KAAK,EAE3B,OAAO,MAAM,EAAS,KAAK,EAG7B,GAAI,CAAC,EAAS,GAAI,CAChB,IAAM,EACH,GAA6B,OAAS,4BACzC,MAAU,MAAM,cAAc,EAAS,YAAY,GAAc,EAGnE,OAAO,EACP,MAAO,EAAO,CACd,GAAI,aAAiB,MACnB,MAAM,EAER,MAAU,MAAM,wBAAwB,QAKtC,eAAc,EAA+B,CAIjD,OAHiB,MAAM,KAAK,QAC1B,uBACF,GACgB,iBAIZ,aAAY,EAA6B,CAI7C,OAHiB,MAAM,KAAK,QAC1B,qBACF,GACgB,eAIZ,iBAAgB,EAAmC,CACvD,OAAO,MAAM,KAAK,QAChB,0BACF,OAII,eAAc,EAAiC,CACnD,OAAO,MAAM,KAAK,QAA6B,wBAAwB,OAInE,kBAAiB,EAAiC,CACtD,OAAO,MAAM,KAAK,QAChB,4BACF,OAII,iBAAgB,EAAiC,CACrD,OAAO,MAAM,KAAK,QAA6B,2BAA2B,OAItE,QAAO,CAAC,EAA6C,CACzD,OAAO,MAAM,KAAK,QAAyB,oBAAqB,CAC9D,OAAQ,OACR,KAAM,KAAK,UAAU,CAAI,CAC3B,CAAC,EAEL",
|
|
8
|
-
"debugId": "9C704430797AA1A264756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export interface BusinessInfo {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
address?: string;
|
|
5
|
-
phone?: string;
|
|
6
|
-
website?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ComparisonImage {
|
|
9
|
-
id: string;
|
|
10
|
-
business_id: number;
|
|
11
|
-
before_url: string;
|
|
12
|
-
after_url: string;
|
|
13
|
-
title: string;
|
|
14
|
-
description: string | null;
|
|
15
|
-
updated_at: string;
|
|
16
|
-
created_at: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ComparisonsResponse {
|
|
19
|
-
comparisons: ComparisonImage[];
|
|
20
|
-
}
|
|
21
|
-
export interface ShowcaseImage {
|
|
22
|
-
id: string;
|
|
23
|
-
business_id: number;
|
|
24
|
-
image_url: string[];
|
|
25
|
-
title: string;
|
|
26
|
-
description: string | null;
|
|
27
|
-
updated_at: string;
|
|
28
|
-
created_at: string;
|
|
29
|
-
}
|
|
30
|
-
export interface ShowcasesResponse {
|
|
31
|
-
showcases: ShowcaseImage[];
|
|
32
|
-
}
|
|
33
|
-
export type ContactData = Record<string, unknown>;
|
|
34
|
-
export interface ContactResponse {
|
|
35
|
-
success: boolean;
|
|
36
|
-
message: string;
|
|
37
|
-
contactId: string | null;
|
|
38
|
-
}
|
|
39
|
-
export interface GoogleReview {
|
|
40
|
-
rating: number;
|
|
41
|
-
text: string;
|
|
42
|
-
author: string;
|
|
43
|
-
publishTime: string;
|
|
44
|
-
}
|
|
45
|
-
export interface GoogleReviewsResponse {
|
|
46
|
-
business: BusinessInfo;
|
|
47
|
-
rating: number | null;
|
|
48
|
-
totalReviews: number;
|
|
49
|
-
reviews: GoogleReview[];
|
|
50
|
-
}
|
|
51
|
-
export interface BusinessHours {
|
|
52
|
-
day: string;
|
|
53
|
-
hours: string;
|
|
54
|
-
}
|
|
55
|
-
export interface CurrentTime {
|
|
56
|
-
day: string;
|
|
57
|
-
time: string;
|
|
58
|
-
}
|
|
59
|
-
export interface GoogleHoursResponse {
|
|
60
|
-
business: BusinessInfo;
|
|
61
|
-
status: string;
|
|
62
|
-
isOpenNow: boolean;
|
|
63
|
-
hours: BusinessHours[];
|
|
64
|
-
currentTime: CurrentTime;
|
|
65
|
-
}
|
|
66
|
-
export interface FacebookPost {
|
|
67
|
-
id: string;
|
|
68
|
-
message?: string;
|
|
69
|
-
created_time: string;
|
|
70
|
-
permalink_url?: string;
|
|
71
|
-
full_picture?: string;
|
|
72
|
-
}
|
|
73
|
-
export interface InstagramPost {
|
|
74
|
-
id: string;
|
|
75
|
-
caption?: string;
|
|
76
|
-
media_type: "IMAGE" | "VIDEO" | "CAROUSEL_ALBUM";
|
|
77
|
-
media_url: string;
|
|
78
|
-
permalink: string;
|
|
79
|
-
timestamp: string;
|
|
80
|
-
}
|
|
81
|
-
export interface SocialMediaResponse {
|
|
82
|
-
business: BusinessInfo;
|
|
83
|
-
posts: FacebookPost[] | InstagramPost[];
|
|
84
|
-
platform: "facebook" | "instagram";
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC;AAGD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,aAAa,EAAE,CAAC;CAC5B;AAGD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IAC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