@pagesolver/sdk 2.0.1 → 2.0.2
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 +20 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Typed TypeScript SDK for the public PageSolver `websites` API.
|
|
4
4
|
|
|
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
5
|
## Install
|
|
10
6
|
|
|
11
7
|
```bash
|
|
@@ -25,7 +21,7 @@ const modules = await sdk.getModules();
|
|
|
25
21
|
const showcases = await sdk.getShowcases({ collection: "Bathrooms" });
|
|
26
22
|
```
|
|
27
23
|
|
|
28
|
-
The SDK targets the production PageSolver `websites`
|
|
24
|
+
The SDK targets the production PageSolver `websites` API by default.
|
|
29
25
|
|
|
30
26
|
Pass `baseUrl` only when you explicitly want a non-production backend, such as local or preview:
|
|
31
27
|
|
|
@@ -36,39 +32,27 @@ const sdk = createClient({
|
|
|
36
32
|
});
|
|
37
33
|
```
|
|
38
34
|
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
bun run sdk:generate
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
The SDK contract version is synced from:
|
|
46
|
-
|
|
47
|
-
- [infra/supabase/functions/websites/openapi.json](/Users/zekepari/Documents/GitHub/pagesolver/infra/supabase/functions/websites/openapi.json)
|
|
48
|
-
|
|
49
|
-
The npm package version may advance independently for SDK ergonomics and runtime improvements.
|
|
50
|
-
|
|
51
|
-
## Verify
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
bun run sdk:check
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Build
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
bun run sdk:build
|
|
61
|
-
```
|
|
35
|
+
## API
|
|
62
36
|
|
|
63
|
-
|
|
37
|
+
- `getModules()`
|
|
38
|
+
- `getShowcases({ collection? })`
|
|
39
|
+
- `getComparisons({ collection? })`
|
|
40
|
+
- `getReviews()`
|
|
41
|
+
- `getFacebook()`
|
|
42
|
+
- `submitContact(payload)`
|
|
64
43
|
|
|
65
|
-
|
|
66
|
-
bun run sdk:publish
|
|
67
|
-
```
|
|
44
|
+
## Errors
|
|
68
45
|
|
|
69
|
-
|
|
46
|
+
Non-2xx responses throw `PageSolverApiError`.
|
|
70
47
|
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
|
|
48
|
+
```ts
|
|
49
|
+
import { PageSolverApiError } from "@pagesolver/sdk";
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
await sdk.getModules();
|
|
53
|
+
} catch (error) {
|
|
54
|
+
if (error instanceof PageSolverApiError) {
|
|
55
|
+
console.error(error.status, error.data);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
74
58
|
```
|