@vepler/sdk 2.57.3 → 2.86.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.
Files changed (49) hide show
  1. package/dist/commonjs/hooks/registration.d.ts.map +1 -1
  2. package/dist/commonjs/hooks/registration.js +14 -10
  3. package/dist/commonjs/hooks/registration.js.map +1 -1
  4. package/dist/commonjs/lib/config.d.ts +3 -3
  5. package/dist/commonjs/lib/config.js +3 -3
  6. package/dist/commonjs/lib/config.js.map +1 -1
  7. package/dist/commonjs/lib/encodings.d.ts +1 -0
  8. package/dist/commonjs/lib/encodings.d.ts.map +1 -1
  9. package/dist/commonjs/lib/encodings.js +7 -0
  10. package/dist/commonjs/lib/encodings.js.map +1 -1
  11. package/dist/commonjs/sdk/models/operations/getlistingbyid.d.ts +4 -4
  12. package/dist/commonjs/sdk/models/operations/getlistingbysource.d.ts +4 -4
  13. package/dist/commonjs/sdk/models/operations/getlistingsbylocation.d.ts +4 -4
  14. package/dist/commonjs/sdk/models/operations/querylistings.d.ts +4 -4
  15. package/dist/commonjs/sdk/models/operations/querylistingsbysource.d.ts +4 -4
  16. package/dist/commonjs/sdk/models/shared/planningqueryfilters.d.ts +5 -0
  17. package/dist/commonjs/sdk/models/shared/planningqueryfilters.d.ts.map +1 -1
  18. package/dist/commonjs/sdk/models/shared/planningqueryfilters.js +1 -0
  19. package/dist/commonjs/sdk/models/shared/planningqueryfilters.js.map +1 -1
  20. package/dist/esm/hooks/registration.d.ts.map +1 -1
  21. package/dist/esm/hooks/registration.js +14 -10
  22. package/dist/esm/hooks/registration.js.map +1 -1
  23. package/dist/esm/lib/config.d.ts +3 -3
  24. package/dist/esm/lib/config.js +3 -3
  25. package/dist/esm/lib/config.js.map +1 -1
  26. package/dist/esm/lib/encodings.d.ts +1 -0
  27. package/dist/esm/lib/encodings.d.ts.map +1 -1
  28. package/dist/esm/lib/encodings.js +6 -0
  29. package/dist/esm/lib/encodings.js.map +1 -1
  30. package/dist/esm/sdk/models/operations/getlistingbyid.d.ts +4 -4
  31. package/dist/esm/sdk/models/operations/getlistingbysource.d.ts +4 -4
  32. package/dist/esm/sdk/models/operations/getlistingsbylocation.d.ts +4 -4
  33. package/dist/esm/sdk/models/operations/querylistings.d.ts +4 -4
  34. package/dist/esm/sdk/models/operations/querylistingsbysource.d.ts +4 -4
  35. package/dist/esm/sdk/models/shared/planningqueryfilters.d.ts +5 -0
  36. package/dist/esm/sdk/models/shared/planningqueryfilters.d.ts.map +1 -1
  37. package/dist/esm/sdk/models/shared/planningqueryfilters.js +1 -0
  38. package/dist/esm/sdk/models/shared/planningqueryfilters.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/hooks/registration.ts +16 -12
  41. package/src/lib/config.ts +3 -3
  42. package/src/lib/encodings.ts +9 -0
  43. package/src/sdk/models/operations/getlistingbyid.ts +4 -4
  44. package/src/sdk/models/operations/getlistingbysource.ts +4 -4
  45. package/src/sdk/models/operations/getlistingsbylocation.ts +4 -4
  46. package/src/sdk/models/operations/querylistings.ts +4 -4
  47. package/src/sdk/models/operations/querylistingsbysource.ts +4 -4
  48. package/src/sdk/models/shared/planningqueryfilters.ts +6 -0
  49. package/test-local.ts +0 -145
package/test-local.ts DELETED
@@ -1,145 +0,0 @@
1
- #!/usr/bin/env bun
2
-
3
- /**
4
- * Local Testing Script for Vepler SDK
5
- *
6
- * Usage:
7
- * 1. Set your API key: export VEPLER_API_KEY=your-key-here
8
- * 2. Run the test: bun run test-local.ts
9
- */
10
-
11
- import { SDK } from "./src/index";
12
-
13
- // Configuration
14
- const API_KEY = process.env.VEPLER_API_KEY || "";
15
- const API_URL = process.env.VEPLER_API_URL || "https://api.vepler.com";
16
-
17
- if (!API_KEY) {
18
- console.error("❌ Error: VEPLER_API_KEY environment variable is required");
19
- console.error("Set it with: export VEPLER_API_KEY=your-api-key");
20
- process.exit(1);
21
- }
22
-
23
- // Initialize SDK
24
- const sdk = new SDK({
25
- serverURL: API_URL,
26
- apiKey: API_KEY,
27
- });
28
-
29
- // Test results
30
- const results: { test: string; status: "✅" | "❌"; error?: string }[] = [];
31
-
32
- async function test(name: string, fn: () => Promise<void>) {
33
- console.log(`\nTesting: ${name}...`);
34
- try {
35
- await fn();
36
- results.push({ test: name, status: "✅" });
37
- console.log(`✅ ${name} passed`);
38
- } catch (error) {
39
- results.push({
40
- test: name,
41
- status: "❌",
42
- error: error instanceof Error ? error.message : String(error),
43
- });
44
- console.log(`❌ ${name} failed:`, error);
45
- }
46
- }
47
-
48
- async function runTests() {
49
- console.log("🧪 Vepler SDK Local Testing");
50
- console.log("============================");
51
- console.log(`API URL: ${API_URL}`);
52
- console.log(`API Key: ${API_KEY.slice(0, 8)}...`);
53
-
54
- // Test 1: Health Check (public endpoint)
55
- await test("Health Check", async () => {
56
- const response = await fetch(`${API_URL}/health`);
57
- if (!response.ok) {
58
- throw new Error(`Health check failed: ${response.status}`);
59
- }
60
- const data = await response.json();
61
- console.log(" Health response:", data);
62
- });
63
-
64
- // Test 2: Get Listing by ID
65
- await test("Get Listing by ID", async () => {
66
- try {
67
- const result = await sdk.listings.getListingById({
68
- id: "listing_test_123",
69
- forceAggregate: false,
70
- });
71
- console.log(" Listing found:", result);
72
- } catch (error: any) {
73
- if (error.statusCode === 404) {
74
- console.log(" Expected 404 for test listing ID");
75
- } else {
76
- throw error;
77
- }
78
- }
79
- });
80
-
81
- // Test 3: Query Listings
82
- await test("Query Listings", async () => {
83
- const result = await sdk.listings.queryListings({
84
- limit: 5,
85
- });
86
- console.log(` Found ${result.listings?.length || 0} listings`);
87
- });
88
-
89
- // Test 4: Get Listing by Source
90
- await test("Get Listing by Source", async () => {
91
- try {
92
- const result = await sdk.listings.getListingBySource({
93
- provider: "rightmove",
94
- key: "test-key",
95
- forceAggregate: false,
96
- });
97
- console.log(" Listing found:", result);
98
- } catch (error: any) {
99
- if (error.statusCode === 404) {
100
- console.log(" Expected 404 for test source");
101
- } else {
102
- throw error;
103
- }
104
- }
105
- });
106
-
107
- // Test 5: Authentication Check
108
- await test("Authentication Required", async () => {
109
- const response = await fetch(`${API_URL}/v1/listings/test`, {
110
- headers: {
111
- "X-API-Key": API_KEY,
112
- },
113
- });
114
-
115
- if (response.status === 401) {
116
- throw new Error("Authentication failed - check API key");
117
- }
118
- console.log(` Authentication working: ${response.status}`);
119
- });
120
-
121
- // Print summary
122
- console.log("\n📊 Test Summary");
123
- console.log("================");
124
- results.forEach((r) => {
125
- console.log(`${r.status} ${r.test}`);
126
- if (r.error) {
127
- console.log(` Error: ${r.error}`);
128
- }
129
- });
130
-
131
- const passed = results.filter((r) => r.status === "✅").length;
132
- const failed = results.filter((r) => r.status === "❌").length;
133
-
134
- console.log(`\nTotal: ${passed} passed, ${failed} failed`);
135
-
136
- if (failed > 0) {
137
- process.exit(1);
138
- }
139
- }
140
-
141
- // Run the tests
142
- runTests().catch((error) => {
143
- console.error("Fatal error:", error);
144
- process.exit(1);
145
- });