@pagesolver/sdk 1.3.1 → 1.4.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 CHANGED
@@ -27,28 +27,26 @@ console.log(comparisons); // ComparisonImage[]
27
27
  const showcases = await client.getShowcases();
28
28
  console.log(showcases); // ShowcaseImage[]
29
29
 
30
- // Get quick quotes - returns array directly
31
- const quickQuotes = await client.getQuickQuotes();
32
- console.log(quickQuotes); // QuickQuote[]
30
+ // Google Business Profile reviews
31
+ const reviews = await client.getGoogleReviews();
33
32
 
34
- // Send contact form - returns boolean
35
- const success = await client.contact({
33
+ // Check which modules are enabled for this business
34
+ const modules = await client.getModules();
35
+ console.log(modules); // e.g. ["comparison_gallery", "google_review_display", ...]
36
+
37
+ // Latest social posts
38
+ const instagram = await client.getInstagramPosts();
39
+ const facebook = await client.getFacebookPosts();
40
+
41
+ // Smart contact submissions (any flat JSON payload works)
42
+ const contact = await client.contact({
36
43
  name: "John Doe",
37
44
  email: "john@example.com",
38
- message: "Hello from the SDK!",
45
+ service: "Detailing",
46
+ requested_date: "2025-03-10",
39
47
  });
40
48
 
41
- if (success) {
42
- console.log("Contact form sent successfully!");
43
- }
44
-
45
- // Error handling with try/catch
46
- try {
47
- const comparisons = await client.getComparisons();
48
- console.log(`Found ${comparisons.length} comparisons`);
49
- } catch (error) {
50
- console.error("Failed to get comparisons:", error.message);
51
- }
49
+ console.log(contact.success, contact.contactId);
52
50
  ```
53
51
 
54
52
  ## API Reference
@@ -65,130 +63,94 @@ new PageSolverClient(businessKey: string)
65
63
 
66
64
  #### Methods
67
65
 
68
- ##### `getComparisons()`
69
-
70
- Retrieves all comparison images for your business.
71
-
72
- ```typescript
73
- const comparisons = await client.getComparisons();
74
- // Returns: ComparisonImage[]
75
- ```
76
-
77
- ##### `getShowcases()`
66
+ | Method | Description | Return Type |
67
+ | --- | --- | --- |
68
+ | `getComparisons()` | Fetch before/after comparison images | `ComparisonImage[]` |
69
+ | `getShowcases()` | Fetch showcase gallery images | `ShowcaseImage[]` |
70
+ | `getGoogleReviews()` | Fetch Google Business Profile reviews + metadata | `GoogleReviewsResponse` |
71
+ | `getModules()` | Get list of activated modules for the business | `Module[]` |
72
+ | `getInstagramPosts()` | Fetch recent Instagram posts (requires connected account) | `SocialMediaResponse` |
73
+ | `getFacebookPosts()` | Fetch recent Facebook posts (requires connected account) | `SocialMediaResponse` |
74
+ | `contact(data)` | Submit a contact form payload (flat JSON object) | `ContactResponse` |
78
75
 
79
- Retrieves all showcase images for your business.
76
+ 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.
80
77
 
81
78
  ```typescript
82
- const showcases = await client.getShowcases();
83
- // Returns: ShowcaseImage[]
84
- ```
85
-
86
- ##### `getQuickQuotes()`
87
-
88
- Retrieves all quick quotes for your business.
89
-
90
- ```typescript
91
- const quotes = await client.getQuickQuotes();
92
- // Returns: QuickQuote[]
93
- ```
94
-
95
- ##### `contact(data: ContactData)`
96
-
97
- Sends a contact form submission.
79
+ try {
80
+ const comparisons = await client.getComparisons();
81
+ console.log(`Found ${comparisons.length} comparisons`);
82
+ } catch (error) {
83
+ console.error("Failed to load comparisons", error);
84
+ }
98
85
 
99
- ```typescript
100
- const success = await client.contact({
101
- name: "John Doe",
102
- email: "john@example.com",
103
- phone: "+1234567890", // optional
104
- message: "Hello!", // optional
86
+ const contact = await client.contact({
87
+ name: "Fresh & Clean",
88
+ phone: "+1 555-0100",
89
+ message: "Need a quote",
90
+ source: "website-landing",
91
+ budget: 250,
105
92
  });
106
- // Returns: boolean
93
+
94
+ console.log(contact.message); // "Contact submission received successfully"
107
95
  ```
108
96
 
109
97
  ## Types
110
98
 
111
- ### ComparisonImage
99
+ ### Notable Types
112
100
 
113
101
  ```typescript
114
102
  interface ComparisonImage {
115
103
  id: string;
116
- businessId: string;
117
- beforeUrl: string;
118
- afterUrl: string;
119
- description: string | null;
120
- createdAt: Date;
104
+ business_id: number;
105
+ before_url: string;
106
+ after_url: string;
121
107
  title: string;
108
+ description: string | null;
109
+ updated_at: string;
110
+ created_at: string;
122
111
  }
123
- ```
124
112
 
125
- ### ShowcaseImage
126
-
127
- ```typescript
128
113
  interface ShowcaseImage {
129
114
  id: string;
130
- businessId: string;
131
- blobUrl: string[];
132
- createdAt: Date;
133
- description: string | null;
115
+ business_id: number;
116
+ image_url: string[];
134
117
  title: string;
135
- }
136
- ```
137
-
138
- ### QuickQuote
139
-
140
- ```typescript
141
- interface QuickQuote {
142
- id: string;
143
- businessId: string;
144
- parentId: string | null;
145
- name: string;
146
118
  description: string | null;
147
- basePrice: string | null;
148
- enabled: boolean;
149
- createdAt: Date;
150
- updatedAt: Date;
119
+ updated_at: string;
120
+ created_at: string;
151
121
  }
152
- ```
153
122
 
154
- ### ContactData
123
+ type ContactData = Record<string, unknown>; // any flat key/value payload
155
124
 
156
- ```typescript
157
- interface ContactData {
158
- name: string;
159
- email: string;
160
- phone?: string;
161
- message?: string;
125
+ interface ContactResponse {
126
+ success: boolean;
127
+ message: string;
128
+ contactId: string | null;
162
129
  }
163
- ```
164
-
165
- ### ApiResponse
166
130
 
167
- ```typescript
168
- interface ApiResponse<T> {
169
- data?: T;
170
- error?: string;
171
- status: number;
131
+ interface GoogleReviewsResponse {
132
+ business: BusinessInfo; // includes id, name, optional website/phone
133
+ rating: number | null;
134
+ totalReviews: number;
135
+ reviews: GoogleReview[];
172
136
  }
173
- ```
174
-
175
- ## Error Handling
176
-
177
- All methods return an `ApiResponse<T>` object that contains either:
178
-
179
- - `data`: The successful response data
180
- - `error`: An error message if the request failed
181
- - `status`: HTTP status code
182
137
 
183
- ```typescript
184
- const result = await client.getComparisons();
185
-
186
- if (result.error) {
187
- console.error("Error:", result.error);
188
- console.error("Status:", result.status);
189
- } else {
190
- console.log("Success:", result.data);
138
+ interface SocialMediaResponse {
139
+ business: BusinessInfo;
140
+ posts: FacebookPost[] | InstagramPost[];
141
+ platform: "facebook" | "instagram";
191
142
  }
143
+
144
+ // Module types - used for feature detection
145
+ type Module =
146
+ | "comparison_gallery"
147
+ | "showcase_gallery"
148
+ | "smart_contact"
149
+ | "google_review_display"
150
+ | "google_review_requests"
151
+ | "facebook_feed_sync"
152
+ | "instagram_feed_sync"
153
+ | "xero_payment_notifications";
192
154
  ```
193
155
 
194
156
  ## License
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ComparisonImage, ContactData, ContactResponse, GoogleHoursResponse, GoogleReviewsResponse, ShowcaseImage, SocialMediaResponse } from "./types";
1
+ import type { ComparisonImage, ContactData, ContactResponse, GoogleReviewsResponse, Module, ShowcaseImage, SocialMediaResponse } from "./types";
2
2
  export declare class PageSolverClient {
3
3
  private baseUrl;
4
4
  private businessKey;
@@ -7,10 +7,10 @@ export declare class PageSolverClient {
7
7
  getComparisons(): Promise<ComparisonImage[]>;
8
8
  getShowcases(): Promise<ShowcaseImage[]>;
9
9
  getGoogleReviews(): Promise<GoogleReviewsResponse>;
10
- getGoogleHours(): Promise<GoogleHoursResponse>;
10
+ getModules(): Promise<Module[]>;
11
11
  getInstagramPosts(): Promise<SocialMediaResponse>;
12
12
  getFacebookPosts(): Promise<SocialMediaResponse>;
13
13
  contact(data: ContactData): Promise<ContactResponse>;
14
14
  }
15
- export type { ComparisonImage, ComparisonsResponse, ShowcaseImage, ShowcasesResponse, ContactData, ContactResponse, GoogleReview, GoogleReviewsResponse, GoogleHoursResponse, BusinessHours, CurrentTime, FacebookPost, InstagramPost, SocialMediaResponse, BusinessInfo, } from "./types";
15
+ export type { ComparisonImage, ComparisonsResponse, ShowcaseImage, ShowcasesResponse, ContactData, ContactResponse, GoogleReview, GoogleReviewsResponse, FacebookPost, InstagramPost, SocialMediaResponse, BusinessInfo, Module, ModulesResponse, } from "./types";
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAA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a,EAAE,CAAC;IAQxC,gBAAgB,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAOlD,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAM/B,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAOjD,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAKhD,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC;CAM3D;AAGD,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,MAAM,EACN,eAAe,GAChB,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- class B{baseUrl="https://pagesolver.com/api/v1";businessKey;constructor(j){this.businessKey=j}async request(j,w={}){try{let q=`${this.baseUrl}${j}`,z={"Content-Type":"application/json","x-business-key":this.businessKey,...w.headers},k=await fetch(q,{...w,headers:z}),v;if(k.headers.get("Content-Type")?.includes("application/json"))v=await k.json();else v=await k.text();if(!k.ok){let A=v?.error||"An unknown error occurred";throw Error(`API Error (${k.status}): ${A}`)}return v}catch(q){if(q instanceof Error)throw q;throw Error("Network error occurred")}}async getComparisons(){return(await this.request("/business/comparisons")).comparisons}async getShowcases(){return(await this.request("/business/showcases")).showcases}async getGoogleReviews(){return await this.request("/business/google/reviews")}async getGoogleHours(){return await this.request("/business/google/hours")}async getInstagramPosts(){return await this.request("/business/social/instagram")}async getFacebookPosts(){return await this.request("/business/social/facebook")}async contact(j){return await this.request("/business/contact",{method:"POST",body:JSON.stringify(j)})}}export{B as PageSolverClient};
1
+ class B{baseUrl="https://pagesolver.com/api/v1";businessKey;constructor(j){this.businessKey=j}async request(j,w={}){try{let q=`${this.baseUrl}${j}`,z={"Content-Type":"application/json","x-business-key":this.businessKey,...w.headers},k=await fetch(q,{...w,headers:z}),v;if(k.headers.get("Content-Type")?.includes("application/json"))v=await k.json();else v=await k.text();if(!k.ok){let A=v?.error||"An unknown error occurred";throw Error(`API Error (${k.status}): ${A}`)}return v}catch(q){if(q instanceof Error)throw q;throw Error("Network error occurred")}}async getComparisons(){return(await this.request("/business/comparisons")).comparisons}async getShowcases(){return(await this.request("/business/showcases")).showcases}async getGoogleReviews(){return await this.request("/business/google/reviews")}async getModules(){return(await this.request("/business/modules")).modules}async getInstagramPosts(){return await this.request("/business/social/instagram")}async getFacebookPosts(){return await this.request("/business/social/facebook")}async contact(j){return await this.request("/business/contact",{method:"POST",body:JSON.stringify(j)})}}export{B as PageSolverClient};
2
2
 
3
- //# debugId=9C704430797AA1A264756E2164756E21
3
+ //# debugId=FD76B09BB023C76364756E2164756E21
package/dist/index.js.map CHANGED
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
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"
5
+ "// Import all types from the types file\nimport type {\n ComparisonImage,\n ComparisonsResponse,\n ContactData,\n ContactResponse,\n FacebookPost,\n GoogleReview,\n GoogleReviewsResponse,\n InstagramPost,\n Module,\n ModulesResponse,\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 // Modules - Get all activated modules for the business\n async getModules(): Promise<Module[]> {\n const response = await this.request<ModulesResponse>(\"/business/modules\");\n return response.modules;\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 FacebookPost,\n InstagramPost,\n SocialMediaResponse,\n BusinessInfo,\n Module,\n ModulesResponse,\n} from \"./types\";\n"
6
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,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M,KAAK,UAAU,CAAI,CAC3B,CAAC,EAEL",
8
+ "debugId": "FD76B09BB023C76364756E2164756E21",
9
9
  "names": []
10
10
  }
package/dist/types.d.ts CHANGED
@@ -5,6 +5,14 @@ export interface BusinessInfo {
5
5
  phone?: string;
6
6
  website?: string;
7
7
  }
8
+ export type Module = "comparison_gallery" | "showcase_gallery" | "smart_contact" | "google_review_display" | "google_review_requests" | "facebook_feed_sync" | "instagram_feed_sync" | "xero_payment_notifications";
9
+ export interface ModulesResponse {
10
+ modules: Module[];
11
+ }
12
+ export interface Collection {
13
+ id: string;
14
+ name: string;
15
+ }
8
16
  export interface ComparisonImage {
9
17
  id: string;
10
18
  business_id: number;
@@ -14,9 +22,11 @@ export interface ComparisonImage {
14
22
  description: string | null;
15
23
  updated_at: string;
16
24
  created_at: string;
25
+ collection: Collection | null;
17
26
  }
18
27
  export interface ComparisonsResponse {
19
28
  comparisons: ComparisonImage[];
29
+ collections: Collection[];
20
30
  }
21
31
  export interface ShowcaseImage {
22
32
  id: string;
@@ -26,16 +36,13 @@ export interface ShowcaseImage {
26
36
  description: string | null;
27
37
  updated_at: string;
28
38
  created_at: string;
39
+ collection: Collection | null;
29
40
  }
30
41
  export interface ShowcasesResponse {
31
42
  showcases: ShowcaseImage[];
43
+ collections: Collection[];
32
44
  }
33
- export interface ContactData {
34
- name: string;
35
- email: string;
36
- phone?: string;
37
- message?: string;
38
- }
45
+ export type ContactData = Record<string, unknown>;
39
46
  export interface ContactResponse {
40
47
  success: boolean;
41
48
  message: string;
@@ -53,21 +60,6 @@ export interface GoogleReviewsResponse {
53
60
  totalReviews: number;
54
61
  reviews: GoogleReview[];
55
62
  }
56
- export interface BusinessHours {
57
- day: string;
58
- hours: string;
59
- }
60
- export interface CurrentTime {
61
- day: string;
62
- time: string;
63
- }
64
- export interface GoogleHoursResponse {
65
- business: BusinessInfo;
66
- status: string;
67
- isOpenNow: boolean;
68
- hours: BusinessHours[];
69
- currentTime: CurrentTime;
70
- }
71
63
  export interface FacebookPost {
72
64
  id: string;
73
65
  message?: string;
@@ -1 +1 @@
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,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC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;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,YAAY,EAAE,GAAG,aAAa,EAAE,CAAC;IACxC,QAAQ,EAAE,UAAU,GAAG,WAAW,CAAC;CACpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagesolver/sdk",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Official SDK for PageSolver API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",