synup-js 0.1.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 +290 -0
- package/dist/index.cjs +1405 -0
- package/dist/index.d.cts +911 -0
- package/dist/index.d.ts +911 -0
- package/dist/index.js +1376 -0
- package/package.json +49 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,911 @@
|
|
|
1
|
+
interface PageInfo {
|
|
2
|
+
hasNextPage: boolean;
|
|
3
|
+
hasPreviousPage: boolean;
|
|
4
|
+
startCursor: string | null;
|
|
5
|
+
endCursor: string | null;
|
|
6
|
+
total?: number;
|
|
7
|
+
}
|
|
8
|
+
interface PaginatedResponse<T> {
|
|
9
|
+
success: boolean;
|
|
10
|
+
data: T[];
|
|
11
|
+
pageInfo: PageInfo;
|
|
12
|
+
totalCount?: number;
|
|
13
|
+
raw: any;
|
|
14
|
+
}
|
|
15
|
+
interface PaginationOptions {
|
|
16
|
+
first?: number;
|
|
17
|
+
after?: string;
|
|
18
|
+
before?: string;
|
|
19
|
+
last?: number;
|
|
20
|
+
fetchAll?: boolean;
|
|
21
|
+
pageSize?: number;
|
|
22
|
+
}
|
|
23
|
+
interface HttpCore {
|
|
24
|
+
apiGet<T = any>(path: string, params?: Record<string, any>): Promise<T>;
|
|
25
|
+
apiPost<T = any>(path: string, body: Record<string, any>): Promise<T>;
|
|
26
|
+
listingsGet<T = any>(locationId: string | number, path: string, params?: Record<string, any>): Promise<T>;
|
|
27
|
+
encodeLocationId(id: string | number): string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Location {
|
|
31
|
+
id: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
storeId?: string;
|
|
34
|
+
street?: string;
|
|
35
|
+
city?: string;
|
|
36
|
+
stateIso?: string;
|
|
37
|
+
postalCode?: string;
|
|
38
|
+
countryIso?: string;
|
|
39
|
+
phone?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
ownerEmail?: string;
|
|
42
|
+
ownerName?: string;
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}
|
|
45
|
+
interface CreateLocationInput {
|
|
46
|
+
name: string;
|
|
47
|
+
storeId: string;
|
|
48
|
+
street: string;
|
|
49
|
+
city: string;
|
|
50
|
+
stateIso: string;
|
|
51
|
+
postalCode: string;
|
|
52
|
+
countryIso: string;
|
|
53
|
+
phone: string;
|
|
54
|
+
subCategoryId: number;
|
|
55
|
+
description?: string;
|
|
56
|
+
ownerEmail?: string;
|
|
57
|
+
ownerName?: string;
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
}
|
|
60
|
+
interface UpdateLocationInput {
|
|
61
|
+
id: string | number;
|
|
62
|
+
name?: string;
|
|
63
|
+
storeId?: string;
|
|
64
|
+
street?: string;
|
|
65
|
+
city?: string;
|
|
66
|
+
stateIso?: string;
|
|
67
|
+
postalCode?: string;
|
|
68
|
+
countryIso?: string;
|
|
69
|
+
phone?: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
ownerEmail?: string;
|
|
72
|
+
ownerName?: string;
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface LocationPaginatedResponse {
|
|
77
|
+
success: boolean;
|
|
78
|
+
locations: Location[];
|
|
79
|
+
pageInfo: PageInfo;
|
|
80
|
+
raw: any;
|
|
81
|
+
}
|
|
82
|
+
declare function createLocationMethods(http: HttpCore): {
|
|
83
|
+
/**
|
|
84
|
+
* Get locations for the account, with optional pagination or fetch-all.
|
|
85
|
+
*
|
|
86
|
+
* When fetchAll is true, returns a flat array of all locations.
|
|
87
|
+
* Otherwise returns a paginated response with locations, pageInfo, and raw data.
|
|
88
|
+
*/
|
|
89
|
+
fetchAllLocations(options?: PaginationOptions): Promise<LocationPaginatedResponse | Location[]>;
|
|
90
|
+
/**
|
|
91
|
+
* Get locations by a list of IDs. Accepts numeric or base64-encoded IDs.
|
|
92
|
+
*/
|
|
93
|
+
fetchLocationsByIds(locationIds: (string | number)[]): Promise<Location[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Get locations that match the given store codes.
|
|
96
|
+
*/
|
|
97
|
+
fetchLocationsByStoreCodes(storeCodes: string[]): Promise<Location[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Search locations by keyword (name, address, or store ID).
|
|
100
|
+
*/
|
|
101
|
+
searchLocations(query: string, options?: PaginationOptions & {
|
|
102
|
+
fields?: string[];
|
|
103
|
+
}): Promise<LocationPaginatedResponse | Location[]>;
|
|
104
|
+
/**
|
|
105
|
+
* Get all locations in a folder (including subfolders). Use folderId or folderName.
|
|
106
|
+
*/
|
|
107
|
+
fetchLocationsByFolder(options: {
|
|
108
|
+
folderId?: string;
|
|
109
|
+
folderName?: string;
|
|
110
|
+
}): Promise<Location[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Get locations that have any of the given tags.
|
|
113
|
+
*/
|
|
114
|
+
fetchLocationsByTags(tags: string[], options?: PaginationOptions & {
|
|
115
|
+
archived?: boolean;
|
|
116
|
+
}): Promise<LocationPaginatedResponse | Location[]>;
|
|
117
|
+
/**
|
|
118
|
+
* Create a new location.
|
|
119
|
+
*/
|
|
120
|
+
createLocation(input: CreateLocationInput): Promise<any>;
|
|
121
|
+
/**
|
|
122
|
+
* Update a location. Pass id plus any fields to change.
|
|
123
|
+
*/
|
|
124
|
+
updateLocation(input: UpdateLocationInput): Promise<any>;
|
|
125
|
+
/**
|
|
126
|
+
* Archive one or more locations.
|
|
127
|
+
*/
|
|
128
|
+
archiveLocations(locationIds: (string | number)[]): Promise<any>;
|
|
129
|
+
/**
|
|
130
|
+
* Reactivate previously archived locations.
|
|
131
|
+
*/
|
|
132
|
+
activateLocations(locationIds: (string | number)[]): Promise<any>;
|
|
133
|
+
/**
|
|
134
|
+
* Cancel scheduled archival for the given locations.
|
|
135
|
+
*/
|
|
136
|
+
cancelArchiveLocations(locationIds: (string | number)[], selectionType: string, changedBy: string): Promise<any>;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
interface Listing {
|
|
140
|
+
id?: string;
|
|
141
|
+
site?: string;
|
|
142
|
+
syncStatus?: string;
|
|
143
|
+
displayStatus?: string;
|
|
144
|
+
listingUrl?: string;
|
|
145
|
+
[key: string]: any;
|
|
146
|
+
}
|
|
147
|
+
interface VoiceListing {
|
|
148
|
+
name?: string;
|
|
149
|
+
voiceIdentifier?: string;
|
|
150
|
+
syncStatus?: string;
|
|
151
|
+
[key: string]: any;
|
|
152
|
+
}
|
|
153
|
+
interface DuplicateListing {
|
|
154
|
+
id?: string;
|
|
155
|
+
site?: string;
|
|
156
|
+
listingUrl?: string;
|
|
157
|
+
[key: string]: any;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare function createListingMethods(http: HttpCore): {
|
|
161
|
+
/**
|
|
162
|
+
* Get premium (directory) listings for a location (Google, Yelp, etc.).
|
|
163
|
+
*/
|
|
164
|
+
fetchPremiumListings(locationId: string | number): Promise<Listing[]>;
|
|
165
|
+
/**
|
|
166
|
+
* Get voice assistant listings for a location (Google, Alexa, Siri, etc.).
|
|
167
|
+
*/
|
|
168
|
+
fetchVoiceListings(locationId: string | number): Promise<VoiceListing[]>;
|
|
169
|
+
/**
|
|
170
|
+
* Get additional (non-premium) listings for a location.
|
|
171
|
+
*/
|
|
172
|
+
fetchAdditionalListings(locationId: string | number): Promise<Listing[]>;
|
|
173
|
+
/**
|
|
174
|
+
* Get duplicate listings detected for a location.
|
|
175
|
+
*/
|
|
176
|
+
fetchDuplicateListings(locationId: string | number): Promise<DuplicateListing[]>;
|
|
177
|
+
/**
|
|
178
|
+
* Get a rollup of duplicate listings across all locations,
|
|
179
|
+
* with optional tag filter and pagination.
|
|
180
|
+
*/
|
|
181
|
+
fetchAllDuplicateListings(options?: {
|
|
182
|
+
tag?: string;
|
|
183
|
+
page?: number;
|
|
184
|
+
}): Promise<any>;
|
|
185
|
+
/**
|
|
186
|
+
* Get AI-generated listing suggestions for a location.
|
|
187
|
+
*/
|
|
188
|
+
fetchAiListings(locationId: string | number): Promise<any>;
|
|
189
|
+
/**
|
|
190
|
+
* Mark one or more listing items as duplicate for a location.
|
|
191
|
+
*/
|
|
192
|
+
markListingsAsDuplicate(locationId: string | number, listingItemIds: string[]): Promise<any>;
|
|
193
|
+
/**
|
|
194
|
+
* Clear duplicate status for listing items.
|
|
195
|
+
*/
|
|
196
|
+
markListingsAsNotDuplicate(locationId: string | number, listingItemIds: string[]): Promise<any>;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
interface InteractionFilters {
|
|
200
|
+
siteUrls?: string[];
|
|
201
|
+
startDate?: string;
|
|
202
|
+
endDate?: string;
|
|
203
|
+
category?: string;
|
|
204
|
+
ratingFilters?: number[];
|
|
205
|
+
}
|
|
206
|
+
interface Interaction {
|
|
207
|
+
id: string;
|
|
208
|
+
content?: string;
|
|
209
|
+
rating?: number;
|
|
210
|
+
siteName?: string;
|
|
211
|
+
siteUrl?: string;
|
|
212
|
+
reviewerName?: string;
|
|
213
|
+
publishedAt?: string;
|
|
214
|
+
category?: string;
|
|
215
|
+
responses?: any[];
|
|
216
|
+
[key: string]: any;
|
|
217
|
+
}
|
|
218
|
+
interface InteractionEdge {
|
|
219
|
+
node: Interaction;
|
|
220
|
+
cursor: string;
|
|
221
|
+
}
|
|
222
|
+
interface InteractionPageInfo {
|
|
223
|
+
hasNextPage: boolean;
|
|
224
|
+
hasPreviousPage: boolean;
|
|
225
|
+
}
|
|
226
|
+
interface InteractionsData {
|
|
227
|
+
edges: InteractionEdge[];
|
|
228
|
+
pageInfo: InteractionPageInfo;
|
|
229
|
+
totalCount?: number;
|
|
230
|
+
}
|
|
231
|
+
interface InteractionResponse {
|
|
232
|
+
success: boolean;
|
|
233
|
+
interactions: Interaction[];
|
|
234
|
+
pageInfo: {
|
|
235
|
+
hasNextPage: boolean;
|
|
236
|
+
hasPreviousPage: boolean;
|
|
237
|
+
startCursor: string | null;
|
|
238
|
+
endCursor: string | null;
|
|
239
|
+
};
|
|
240
|
+
totalCount?: number;
|
|
241
|
+
raw: any;
|
|
242
|
+
[key: string]: any;
|
|
243
|
+
}
|
|
244
|
+
interface ReviewSettings {
|
|
245
|
+
[key: string]: any;
|
|
246
|
+
}
|
|
247
|
+
interface ReviewAnalytics {
|
|
248
|
+
[key: string]: any;
|
|
249
|
+
}
|
|
250
|
+
interface ReviewSiteConfig {
|
|
251
|
+
[key: string]: any;
|
|
252
|
+
}
|
|
253
|
+
interface ReviewDetails {
|
|
254
|
+
[key: string]: any;
|
|
255
|
+
}
|
|
256
|
+
interface ReviewPhrase {
|
|
257
|
+
phrase?: string;
|
|
258
|
+
count?: number;
|
|
259
|
+
sentiment?: string;
|
|
260
|
+
[key: string]: any;
|
|
261
|
+
}
|
|
262
|
+
interface ReviewSiteUrl {
|
|
263
|
+
name: string;
|
|
264
|
+
url: string;
|
|
265
|
+
[key: string]: any;
|
|
266
|
+
}
|
|
267
|
+
interface RespondToReviewInput {
|
|
268
|
+
interactionId: string;
|
|
269
|
+
responseContent: string;
|
|
270
|
+
}
|
|
271
|
+
interface EditReviewResponseInput {
|
|
272
|
+
reviewId: string;
|
|
273
|
+
responseId: string;
|
|
274
|
+
responseContent: string;
|
|
275
|
+
}
|
|
276
|
+
interface ReviewPhrasesOptions {
|
|
277
|
+
locationIds: string[];
|
|
278
|
+
siteUrls?: string[];
|
|
279
|
+
startDate?: string;
|
|
280
|
+
endDate?: string;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
declare function createReviewMethods(http: HttpCore): {
|
|
284
|
+
/**
|
|
285
|
+
* Get reviews/interactions for a location with pagination and filters.
|
|
286
|
+
* When fetchAll is true, returns a flat array of all interactions.
|
|
287
|
+
* Otherwise returns a paginated response object.
|
|
288
|
+
*/
|
|
289
|
+
fetchInteractions(locationId: string | number, options?: PaginationOptions & InteractionFilters): Promise<InteractionResponse | Interaction[]>;
|
|
290
|
+
/**
|
|
291
|
+
* Get review source settings for a location.
|
|
292
|
+
*/
|
|
293
|
+
fetchReviewSettings(locationId: string | number): Promise<ReviewSettings>;
|
|
294
|
+
/**
|
|
295
|
+
* Get overall review analytics for a location.
|
|
296
|
+
*/
|
|
297
|
+
fetchReviewAnalyticsOverview(locationId: string | number, options?: {
|
|
298
|
+
startDate?: string;
|
|
299
|
+
endDate?: string;
|
|
300
|
+
}): Promise<ReviewAnalytics>;
|
|
301
|
+
/**
|
|
302
|
+
* Get review analytics over time for a location.
|
|
303
|
+
*/
|
|
304
|
+
fetchReviewAnalyticsTimeline(locationId: string | number, options?: {
|
|
305
|
+
startDate?: string;
|
|
306
|
+
endDate?: string;
|
|
307
|
+
}): Promise<ReviewAnalytics>;
|
|
308
|
+
/**
|
|
309
|
+
* Get review analytics broken down by site for a location.
|
|
310
|
+
*/
|
|
311
|
+
fetchReviewAnalyticsSitesStats(locationId: string | number, options?: {
|
|
312
|
+
startDate?: string;
|
|
313
|
+
endDate?: string;
|
|
314
|
+
}): Promise<ReviewAnalytics>;
|
|
315
|
+
/**
|
|
316
|
+
* Get eligible review sources and site config for the account.
|
|
317
|
+
*/
|
|
318
|
+
fetchReviewSiteConfig(): Promise<ReviewSiteConfig[]>;
|
|
319
|
+
/**
|
|
320
|
+
* Get detailed information for specific reviews by interaction IDs.
|
|
321
|
+
*/
|
|
322
|
+
fetchReviewDetails(interactionIds: string[]): Promise<ReviewDetails>;
|
|
323
|
+
/**
|
|
324
|
+
* Get review phrase analysis for given locations.
|
|
325
|
+
*/
|
|
326
|
+
fetchReviewPhrases(options: ReviewPhrasesOptions): Promise<ReviewPhrase[]>;
|
|
327
|
+
/**
|
|
328
|
+
* Post a reply to a review/interaction.
|
|
329
|
+
*/
|
|
330
|
+
respondToReview(interactionId: string, responseContent: string): Promise<Record<string, any>>;
|
|
331
|
+
/**
|
|
332
|
+
* Edit an existing reply to a review.
|
|
333
|
+
*/
|
|
334
|
+
editReviewResponse(reviewId: string, responseId: string, responseContent: string): Promise<Record<string, any>>;
|
|
335
|
+
/**
|
|
336
|
+
* Archive (hide) a reply to a review.
|
|
337
|
+
*/
|
|
338
|
+
archiveReviewResponse(responseId: string): Promise<Record<string, any>>;
|
|
339
|
+
/**
|
|
340
|
+
* Set or update review source URLs for a location.
|
|
341
|
+
*/
|
|
342
|
+
editReviewSettings(locationId: string | number, siteUrls: ReviewSiteUrl[]): Promise<Record<string, any>>;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
interface Keyword {
|
|
346
|
+
id: string;
|
|
347
|
+
name?: string;
|
|
348
|
+
[key: string]: any;
|
|
349
|
+
}
|
|
350
|
+
interface KeywordPerformance {
|
|
351
|
+
id?: string;
|
|
352
|
+
name?: string;
|
|
353
|
+
[key: string]: any;
|
|
354
|
+
}
|
|
355
|
+
interface KeywordPerformanceOptions {
|
|
356
|
+
fromDate?: string;
|
|
357
|
+
toDate?: string;
|
|
358
|
+
}
|
|
359
|
+
interface AddKeywordsInput {
|
|
360
|
+
locationId: string | number;
|
|
361
|
+
keywords: string[];
|
|
362
|
+
}
|
|
363
|
+
interface RankingAnalyticsTimelineInput {
|
|
364
|
+
locationIds: string[];
|
|
365
|
+
fromDate: string;
|
|
366
|
+
toDate: string;
|
|
367
|
+
source: string[];
|
|
368
|
+
}
|
|
369
|
+
interface RankingSitewiseHistogramInput {
|
|
370
|
+
locationIds: string[];
|
|
371
|
+
fromDate: string;
|
|
372
|
+
toDate: string;
|
|
373
|
+
source: string[];
|
|
374
|
+
}
|
|
375
|
+
interface RankingTimelineEntry {
|
|
376
|
+
[key: string]: any;
|
|
377
|
+
}
|
|
378
|
+
interface RankingHistogramEntry {
|
|
379
|
+
[key: string]: any;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
declare function createKeywordMethods(http: HttpCore): {
|
|
383
|
+
/**
|
|
384
|
+
* Get all keywords tracked for a location.
|
|
385
|
+
*/
|
|
386
|
+
fetchKeywords(locationId: string | number): Promise<Keyword[]>;
|
|
387
|
+
/**
|
|
388
|
+
* Get ranking performance for a location's keywords over an optional date range.
|
|
389
|
+
*/
|
|
390
|
+
fetchKeywordsPerformance(locationId: string | number, options?: KeywordPerformanceOptions): Promise<KeywordPerformance[]>;
|
|
391
|
+
/**
|
|
392
|
+
* Add keywords to a location for ranking tracking.
|
|
393
|
+
*/
|
|
394
|
+
addKeywords(locationId: string | number, keywords: string[]): Promise<Keyword[]>;
|
|
395
|
+
/**
|
|
396
|
+
* Archive a keyword so it is no longer tracked.
|
|
397
|
+
*/
|
|
398
|
+
archiveKeyword(keywordId: string): Promise<Record<string, any>>;
|
|
399
|
+
/**
|
|
400
|
+
* Get ranking analytics timeline (positions over time) for locations and a source.
|
|
401
|
+
*/
|
|
402
|
+
fetchRankingAnalyticsTimeline(input: RankingAnalyticsTimelineInput): Promise<RankingTimelineEntry[]>;
|
|
403
|
+
/**
|
|
404
|
+
* Get ranking histogram by keyword count for locations and a source.
|
|
405
|
+
*/
|
|
406
|
+
fetchRankingSitewiseHistogram(input: RankingSitewiseHistogramInput): Promise<RankingHistogramEntry[]>;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
interface ReviewCampaign {
|
|
410
|
+
id?: string;
|
|
411
|
+
name?: string;
|
|
412
|
+
locationId?: string;
|
|
413
|
+
[key: string]: any;
|
|
414
|
+
}
|
|
415
|
+
interface CustomerInput {
|
|
416
|
+
name: string;
|
|
417
|
+
email?: string;
|
|
418
|
+
phone?: string;
|
|
419
|
+
[key: string]: any;
|
|
420
|
+
}
|
|
421
|
+
interface CreateCampaignInput {
|
|
422
|
+
locationId: string | number;
|
|
423
|
+
name: string;
|
|
424
|
+
locationCustomers: CustomerInput[];
|
|
425
|
+
screening?: boolean;
|
|
426
|
+
landingPageTemplate?: Record<string, any>;
|
|
427
|
+
openingEmailTemplate?: Record<string, any>;
|
|
428
|
+
smsTemplate?: Record<string, any>;
|
|
429
|
+
emailDetails?: Record<string, any>;
|
|
430
|
+
smsDetails?: Record<string, any>;
|
|
431
|
+
}
|
|
432
|
+
interface AddCampaignCustomersInput {
|
|
433
|
+
reviewCampaignId: string;
|
|
434
|
+
locationCustomers: CustomerInput[];
|
|
435
|
+
}
|
|
436
|
+
interface ReviewCampaignCustomersResponse {
|
|
437
|
+
[key: string]: any;
|
|
438
|
+
}
|
|
439
|
+
interface CreateCampaignResponse {
|
|
440
|
+
reviewCampaign?: ReviewCampaign;
|
|
441
|
+
success?: boolean;
|
|
442
|
+
errors?: any[];
|
|
443
|
+
[key: string]: any;
|
|
444
|
+
}
|
|
445
|
+
interface AddCustomersResponse {
|
|
446
|
+
[key: string]: any;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
declare function createCampaignMethods(http: HttpCore): {
|
|
450
|
+
/**
|
|
451
|
+
* Get review campaigns for a location, optionally filtered by date range.
|
|
452
|
+
*/
|
|
453
|
+
fetchReviewCampaigns(locationId: string | number, options?: {
|
|
454
|
+
startDate?: string;
|
|
455
|
+
endDate?: string;
|
|
456
|
+
}): Promise<ReviewCampaign[]>;
|
|
457
|
+
/**
|
|
458
|
+
* Get customer details for a specific review campaign.
|
|
459
|
+
*/
|
|
460
|
+
fetchReviewCampaignCustomers(reviewCampaignId: string): Promise<ReviewCampaignCustomersResponse>;
|
|
461
|
+
/**
|
|
462
|
+
* Create a review campaign for a location with customers and optional templates.
|
|
463
|
+
*/
|
|
464
|
+
createReviewCampaign(input: CreateCampaignInput): Promise<CreateCampaignResponse>;
|
|
465
|
+
/**
|
|
466
|
+
* Add customers to an existing review campaign.
|
|
467
|
+
*/
|
|
468
|
+
addReviewCampaignCustomers(reviewCampaignId: string, locationCustomers: CustomerInput[]): Promise<AddCustomersResponse>;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
interface GoogleAnalytics {
|
|
472
|
+
[key: string]: any;
|
|
473
|
+
}
|
|
474
|
+
interface BingAnalytics {
|
|
475
|
+
[key: string]: any;
|
|
476
|
+
}
|
|
477
|
+
interface FacebookAnalytics {
|
|
478
|
+
[key: string]: any;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
declare function createAnalyticsMethods(http: HttpCore): {
|
|
482
|
+
/**
|
|
483
|
+
* Get Google (GMB) profile analytics for a location.
|
|
484
|
+
*/
|
|
485
|
+
fetchGoogleAnalytics(locationId: string | number, options?: {
|
|
486
|
+
fromDate?: string;
|
|
487
|
+
toDate?: string;
|
|
488
|
+
}): Promise<GoogleAnalytics>;
|
|
489
|
+
/**
|
|
490
|
+
* Get Bing profile analytics for a location.
|
|
491
|
+
*/
|
|
492
|
+
fetchBingAnalytics(locationId: string | number, options?: {
|
|
493
|
+
fromDate?: string;
|
|
494
|
+
toDate?: string;
|
|
495
|
+
}): Promise<BingAnalytics>;
|
|
496
|
+
/**
|
|
497
|
+
* Get Facebook page analytics for a location.
|
|
498
|
+
*/
|
|
499
|
+
fetchFacebookAnalytics(locationId: string | number, options?: {
|
|
500
|
+
fromDate?: string;
|
|
501
|
+
toDate?: string;
|
|
502
|
+
}): Promise<FacebookAnalytics>;
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
interface Photo {
|
|
506
|
+
[key: string]: any;
|
|
507
|
+
}
|
|
508
|
+
interface PhotoInput {
|
|
509
|
+
photo: string;
|
|
510
|
+
type: 'LOGO' | 'COVER' | 'ADDITIONAL';
|
|
511
|
+
partnerMediaId?: string;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
declare function createPhotoMethods(http: HttpCore): {
|
|
515
|
+
/**
|
|
516
|
+
* Get photos and media attached to a location.
|
|
517
|
+
*/
|
|
518
|
+
fetchLocationPhotos(locationId: string | number): Promise<Photo[]>;
|
|
519
|
+
/**
|
|
520
|
+
* Add one or more photos to a location.
|
|
521
|
+
*/
|
|
522
|
+
addLocationPhotos(locationId: string | number, photos: PhotoInput[]): Promise<Record<string, any>>;
|
|
523
|
+
/**
|
|
524
|
+
* Remove photos from a location by photo IDs.
|
|
525
|
+
*/
|
|
526
|
+
removeLocationPhotos(locationId: string | number, photoIds: string[]): Promise<Record<string, any>>;
|
|
527
|
+
/**
|
|
528
|
+
* Star or unstar location photos.
|
|
529
|
+
*/
|
|
530
|
+
starLocationPhotos(locationId: string | number, mediaIds: string[], starred: boolean): Promise<Record<string, any>>;
|
|
531
|
+
/**
|
|
532
|
+
* Get the processing status for a bulk photo upload request.
|
|
533
|
+
*/
|
|
534
|
+
fetchPhotoUploadStatus(requestId: string): Promise<Record<string, any>>;
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
interface Folder {
|
|
538
|
+
[key: string]: any;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
declare function createFolderMethods(http: HttpCore): {
|
|
542
|
+
/**
|
|
543
|
+
* Get all folders as a flat list.
|
|
544
|
+
*/
|
|
545
|
+
fetchFoldersFlat(): Promise<Folder[]>;
|
|
546
|
+
/**
|
|
547
|
+
* Get all folders as a nested tree structure.
|
|
548
|
+
*/
|
|
549
|
+
fetchFoldersTree(): Promise<Folder[]>;
|
|
550
|
+
/**
|
|
551
|
+
* Get details for a specific folder by ID or name.
|
|
552
|
+
*/
|
|
553
|
+
fetchFolderDetails(options: {
|
|
554
|
+
folderId?: string;
|
|
555
|
+
folderName?: string;
|
|
556
|
+
}): Promise<Folder>;
|
|
557
|
+
/**
|
|
558
|
+
* Create a folder to organize locations.
|
|
559
|
+
*/
|
|
560
|
+
createFolder(name: string, options?: {
|
|
561
|
+
parentFolder?: string;
|
|
562
|
+
parentFolderName?: string;
|
|
563
|
+
}): Promise<Record<string, any>>;
|
|
564
|
+
/**
|
|
565
|
+
* Rename an existing folder.
|
|
566
|
+
*/
|
|
567
|
+
renameFolder(oldName: string, newName: string): Promise<Record<string, any>>;
|
|
568
|
+
/**
|
|
569
|
+
* Delete a folder by name. Locations in the folder are not deleted.
|
|
570
|
+
*/
|
|
571
|
+
deleteFolder(name: string): Promise<Record<string, any>>;
|
|
572
|
+
/**
|
|
573
|
+
* Add locations to a folder. Folder is created if it does not exist.
|
|
574
|
+
*/
|
|
575
|
+
addLocationsToFolder(folderName: string, locationIds: (string | number)[]): Promise<Record<string, any>>;
|
|
576
|
+
/**
|
|
577
|
+
* Remove locations from their current folder.
|
|
578
|
+
*/
|
|
579
|
+
removeLocationsFromFolder(locationIds: (string | number)[]): Promise<Record<string, any>>;
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
interface Tag {
|
|
583
|
+
[key: string]: any;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
declare function createTagMethods(http: HttpCore): {
|
|
587
|
+
/**
|
|
588
|
+
* Get all tags defined in the account.
|
|
589
|
+
*/
|
|
590
|
+
fetchTags(): Promise<Tag[]>;
|
|
591
|
+
/**
|
|
592
|
+
* Add a tag to a location. Tag is created if it does not exist.
|
|
593
|
+
*/
|
|
594
|
+
addLocationTag(locationId: string | number, tag: string): Promise<Record<string, any>>;
|
|
595
|
+
/**
|
|
596
|
+
* Remove a tag from a location.
|
|
597
|
+
*/
|
|
598
|
+
removeLocationTag(locationId: string | number, tag: string): Promise<Record<string, any>>;
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
interface User {
|
|
602
|
+
[key: string]: any;
|
|
603
|
+
}
|
|
604
|
+
interface Role {
|
|
605
|
+
[key: string]: any;
|
|
606
|
+
}
|
|
607
|
+
interface CreateUserInput {
|
|
608
|
+
email: string;
|
|
609
|
+
roleId: string;
|
|
610
|
+
firstName: string;
|
|
611
|
+
lastName?: string;
|
|
612
|
+
directCustomer?: boolean;
|
|
613
|
+
[key: string]: any;
|
|
614
|
+
}
|
|
615
|
+
interface UpdateUserInput {
|
|
616
|
+
userId: string;
|
|
617
|
+
email?: string;
|
|
618
|
+
roleId?: string;
|
|
619
|
+
firstName?: string;
|
|
620
|
+
lastName?: string;
|
|
621
|
+
phone?: string;
|
|
622
|
+
archived?: boolean;
|
|
623
|
+
directCustomer?: boolean;
|
|
624
|
+
[key: string]: any;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
declare function createUserMethods(http: HttpCore): {
|
|
628
|
+
/**
|
|
629
|
+
* Get all users in the account.
|
|
630
|
+
*/
|
|
631
|
+
fetchUsers(): Promise<User[]>;
|
|
632
|
+
/**
|
|
633
|
+
* Get users by a list of user IDs.
|
|
634
|
+
*/
|
|
635
|
+
fetchUsersByIds(userIds: string[]): Promise<User[]>;
|
|
636
|
+
/**
|
|
637
|
+
* Get resources (locations, folders, etc.) assigned to a specific user.
|
|
638
|
+
*/
|
|
639
|
+
fetchUserResources(userId: string): Promise<any[]>;
|
|
640
|
+
/**
|
|
641
|
+
* Get all roles defined in the account.
|
|
642
|
+
*/
|
|
643
|
+
fetchRoles(): Promise<Role[]>;
|
|
644
|
+
/**
|
|
645
|
+
* Create a user in the account with the given role.
|
|
646
|
+
*/
|
|
647
|
+
createUser(input: CreateUserInput): Promise<Record<string, any>>;
|
|
648
|
+
/**
|
|
649
|
+
* Update a user. Pass userId and any fields to change.
|
|
650
|
+
*/
|
|
651
|
+
updateUser(input: UpdateUserInput): Promise<Record<string, any>>;
|
|
652
|
+
/**
|
|
653
|
+
* Assign locations to a user.
|
|
654
|
+
*/
|
|
655
|
+
addUserLocations(userId: string, locationIds: (string | number)[]): Promise<Record<string, any>>;
|
|
656
|
+
/**
|
|
657
|
+
* Remove location assignments from a user.
|
|
658
|
+
*/
|
|
659
|
+
removeUserLocations(userId: string, locationIds: (string | number)[]): Promise<Record<string, any>>;
|
|
660
|
+
/**
|
|
661
|
+
* Assign folders to a user.
|
|
662
|
+
*/
|
|
663
|
+
addUserFolders(userId: string, folderIds: string[]): Promise<Record<string, any>>;
|
|
664
|
+
/**
|
|
665
|
+
* Remove folder assignments from a user.
|
|
666
|
+
*/
|
|
667
|
+
removeUserFolders(userId: string, folderIds: string[]): Promise<Record<string, any>>;
|
|
668
|
+
/**
|
|
669
|
+
* Create a user and a folder, then assign the folder to the user in one call.
|
|
670
|
+
*/
|
|
671
|
+
addUserAndFolder(input: Record<string, any>): Promise<Record<string, any>>;
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
interface ConnectedAccount {
|
|
675
|
+
[key: string]: any;
|
|
676
|
+
}
|
|
677
|
+
interface OAuthConnectUrl {
|
|
678
|
+
[key: string]: any;
|
|
679
|
+
}
|
|
680
|
+
interface ConnectedAccountListing {
|
|
681
|
+
[key: string]: any;
|
|
682
|
+
}
|
|
683
|
+
interface ConnectedAccountFolder {
|
|
684
|
+
[key: string]: any;
|
|
685
|
+
}
|
|
686
|
+
interface ConnectionSuggestion {
|
|
687
|
+
[key: string]: any;
|
|
688
|
+
}
|
|
689
|
+
interface ConnectedAccountDetails {
|
|
690
|
+
[key: string]: any;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
declare function createConnectionMethods(http: HttpCore): {
|
|
694
|
+
/**
|
|
695
|
+
* Get a URL to connect a Google or Facebook profile to a location.
|
|
696
|
+
*/
|
|
697
|
+
getOauthConnectUrl(locationId: string | number, site: string, successUrl: string, errorUrl: string): Promise<OAuthConnectUrl>;
|
|
698
|
+
/**
|
|
699
|
+
* Disconnect a Google or Facebook profile from a location.
|
|
700
|
+
*/
|
|
701
|
+
oauthDisconnect(locationId: string | number, site: string): Promise<Record<string, any>>;
|
|
702
|
+
/**
|
|
703
|
+
* Get a URL to connect a Google account for bulk use across locations.
|
|
704
|
+
*/
|
|
705
|
+
connectGoogleAccount(successUrl: string, errorUrl: string): Promise<Record<string, any>>;
|
|
706
|
+
/**
|
|
707
|
+
* Get a URL to connect a Facebook account for bulk use across locations.
|
|
708
|
+
*/
|
|
709
|
+
connectFacebookAccount(successUrl: string, errorUrl: string): Promise<Record<string, any>>;
|
|
710
|
+
/**
|
|
711
|
+
* Disconnect a Google connected account (bulk).
|
|
712
|
+
*/
|
|
713
|
+
disconnectGoogleAccount(connectedAccountId: string): Promise<Record<string, any>>;
|
|
714
|
+
/**
|
|
715
|
+
* Disconnect a Facebook connected account (bulk).
|
|
716
|
+
*/
|
|
717
|
+
disconnectFacebookAccount(connectedAccountId: string): Promise<Record<string, any>>;
|
|
718
|
+
/**
|
|
719
|
+
* Get connected third-party accounts with optional filters.
|
|
720
|
+
*/
|
|
721
|
+
fetchConnectedAccounts(options?: {
|
|
722
|
+
publisher?: string;
|
|
723
|
+
status?: string;
|
|
724
|
+
page?: number;
|
|
725
|
+
perPage?: number;
|
|
726
|
+
}): Promise<Record<string, any>>;
|
|
727
|
+
/**
|
|
728
|
+
* Get detailed information about a specific connected account.
|
|
729
|
+
*/
|
|
730
|
+
fetchConnectedAccountDetails(connectedAccountId: string): Promise<ConnectedAccountDetails>;
|
|
731
|
+
/**
|
|
732
|
+
* Get folders (business groups) under a connected Google account.
|
|
733
|
+
*/
|
|
734
|
+
fetchConnectedAccountFolders(connectedAccountId: string, options?: {
|
|
735
|
+
folderName?: string;
|
|
736
|
+
}): Promise<ConnectedAccountFolder[]>;
|
|
737
|
+
/**
|
|
738
|
+
* Get listings the connected Google/Facebook account has access to.
|
|
739
|
+
*/
|
|
740
|
+
fetchConnectedAccountListings(connectedAccountId: string, options?: {
|
|
741
|
+
locationInfo?: string;
|
|
742
|
+
page?: number;
|
|
743
|
+
perPage?: number;
|
|
744
|
+
}): Promise<Record<string, any>>;
|
|
745
|
+
/**
|
|
746
|
+
* Get suggested matches between a connected account's listings and Synup locations.
|
|
747
|
+
*/
|
|
748
|
+
fetchConnectionSuggestions(connectedAccountId: string, options?: {
|
|
749
|
+
page?: number;
|
|
750
|
+
perPage?: number;
|
|
751
|
+
}): Promise<Record<string, any>>;
|
|
752
|
+
/**
|
|
753
|
+
* Trigger matching of Google/Facebook profile locations to Synup locations.
|
|
754
|
+
*/
|
|
755
|
+
triggerConnectedAccountMatches(connectedAccountIds: string[]): Promise<Record<string, any>>;
|
|
756
|
+
/**
|
|
757
|
+
* Confirm suggested matches between connected account listings and Synup locations.
|
|
758
|
+
*/
|
|
759
|
+
confirmConnectedAccountMatches(matchRecordIds: string[]): Promise<Record<string, any>>;
|
|
760
|
+
/**
|
|
761
|
+
* Link a Synup location to a listing from a connected Google/Facebook account.
|
|
762
|
+
*/
|
|
763
|
+
connectListing(locationId: string | number, connectedAccountListingId: string, connectedAccountId: string): Promise<Record<string, any>>;
|
|
764
|
+
/**
|
|
765
|
+
* Unlink a location from its Google or Facebook listing.
|
|
766
|
+
*/
|
|
767
|
+
disconnectListing(locationId: string | number, site: string): Promise<Record<string, any>>;
|
|
768
|
+
/**
|
|
769
|
+
* Create a Google Business Profile listing for an existing Synup location.
|
|
770
|
+
*/
|
|
771
|
+
createGmbListing(locationId: string | number, connectedAccountId: string, options?: {
|
|
772
|
+
folderId?: string;
|
|
773
|
+
}): Promise<Record<string, any>>;
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
interface GridReport {
|
|
777
|
+
[key: string]: any;
|
|
778
|
+
}
|
|
779
|
+
interface CreateGridReportInput {
|
|
780
|
+
locationId: string | number;
|
|
781
|
+
keywords: string[];
|
|
782
|
+
businessName: string;
|
|
783
|
+
businessStreet: string;
|
|
784
|
+
businessCity: string;
|
|
785
|
+
businessState: string;
|
|
786
|
+
businessCountry: string;
|
|
787
|
+
latitude: number;
|
|
788
|
+
longitude: number;
|
|
789
|
+
distance: number;
|
|
790
|
+
distanceUnit: string;
|
|
791
|
+
gridSize: number;
|
|
792
|
+
[key: string]: any;
|
|
793
|
+
}
|
|
794
|
+
interface GridReportFilterOptions {
|
|
795
|
+
searchString?: string;
|
|
796
|
+
gridSize?: number;
|
|
797
|
+
fromDate?: string;
|
|
798
|
+
toDate?: string;
|
|
799
|
+
sortField?: string;
|
|
800
|
+
sortOrder?: string;
|
|
801
|
+
pageSize?: number;
|
|
802
|
+
page?: number;
|
|
803
|
+
[key: string]: any;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
declare function createGridRankMethods(http: HttpCore): {
|
|
807
|
+
/**
|
|
808
|
+
* Create a Local Rank Grid report.
|
|
809
|
+
*/
|
|
810
|
+
createGridReport(input: CreateGridReportInput): Promise<Record<string, any>>;
|
|
811
|
+
/**
|
|
812
|
+
* Get a Local Rank Grid report by its ID.
|
|
813
|
+
*/
|
|
814
|
+
fetchGridReport(reportId: string): Promise<GridReport>;
|
|
815
|
+
/**
|
|
816
|
+
* Get all Local Rank Grid reports for a location with optional filters.
|
|
817
|
+
*/
|
|
818
|
+
fetchLocationGridReports(locationId: string | number, options?: GridReportFilterOptions): Promise<{
|
|
819
|
+
reports: GridReport[];
|
|
820
|
+
total: number | undefined;
|
|
821
|
+
}>;
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
interface PlanSite {
|
|
825
|
+
[key: string]: any;
|
|
826
|
+
}
|
|
827
|
+
interface Country {
|
|
828
|
+
[key: string]: any;
|
|
829
|
+
}
|
|
830
|
+
interface Subscription {
|
|
831
|
+
[key: string]: any;
|
|
832
|
+
}
|
|
833
|
+
interface TemporaryCloseInput {
|
|
834
|
+
name: string;
|
|
835
|
+
startDate: string;
|
|
836
|
+
startTime: string;
|
|
837
|
+
endDate: string;
|
|
838
|
+
locationId: string | number;
|
|
839
|
+
[key: string]: any;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
declare function createAccountMethods(http: HttpCore): {
|
|
843
|
+
/**
|
|
844
|
+
* Get supported directories and site details for your plan.
|
|
845
|
+
*/
|
|
846
|
+
fetchPlanSites(): Promise<PlanSite[]>;
|
|
847
|
+
/**
|
|
848
|
+
* Get supported countries and states.
|
|
849
|
+
*/
|
|
850
|
+
fetchCountries(): Promise<Country[]>;
|
|
851
|
+
/**
|
|
852
|
+
* Get active subscriptions for the account.
|
|
853
|
+
*/
|
|
854
|
+
fetchSubscriptions(): Promise<Subscription[]>;
|
|
855
|
+
/**
|
|
856
|
+
* Get OAuth connection status for a location.
|
|
857
|
+
*/
|
|
858
|
+
fetchConnectionInfo(locationId: string | number): Promise<Record<string, any>>;
|
|
859
|
+
/**
|
|
860
|
+
* Create an automation that temporarily closes a location and reopens on a set date.
|
|
861
|
+
*/
|
|
862
|
+
createTemporaryCloseAutomation(input: TemporaryCloseInput): Promise<Record<string, any>>;
|
|
863
|
+
};
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Encode a numeric location ID to base64 format, or return as-is if already encoded.
|
|
867
|
+
*/
|
|
868
|
+
declare function encodeLocationId(idValue: string | number): string;
|
|
869
|
+
interface SynupClientOptions {
|
|
870
|
+
apiKey: string;
|
|
871
|
+
baseUrl?: string;
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Client for the Synup v4 API.
|
|
875
|
+
*
|
|
876
|
+
* @example
|
|
877
|
+
* ```ts
|
|
878
|
+
* const client = new SynupClient({ apiKey: 'YOUR_API_KEY' });
|
|
879
|
+
* const locations = await client.fetchAllLocations({ first: 10 });
|
|
880
|
+
* ```
|
|
881
|
+
*/
|
|
882
|
+
declare class SynupClient {
|
|
883
|
+
private baseUrl;
|
|
884
|
+
private headers;
|
|
885
|
+
constructor(options: SynupClientOptions);
|
|
886
|
+
/**
|
|
887
|
+
* GET request to an account-level API endpoint.
|
|
888
|
+
*/
|
|
889
|
+
apiGet<T = any>(path: string, params?: Record<string, any>): Promise<T>;
|
|
890
|
+
/**
|
|
891
|
+
* POST request to an account-level API endpoint.
|
|
892
|
+
*/
|
|
893
|
+
apiPost<T = any>(path: string, body: Record<string, any>): Promise<T>;
|
|
894
|
+
/**
|
|
895
|
+
* GET request to a location-scoped API endpoint.
|
|
896
|
+
*/
|
|
897
|
+
listingsGet<T = any>(locationId: string | number, path: string, params?: Record<string, any>): Promise<T>;
|
|
898
|
+
}
|
|
899
|
+
interface SynupClient extends ReturnType<typeof createLocationMethods>, ReturnType<typeof createListingMethods>, ReturnType<typeof createReviewMethods>, ReturnType<typeof createKeywordMethods>, ReturnType<typeof createCampaignMethods>, ReturnType<typeof createAnalyticsMethods>, ReturnType<typeof createPhotoMethods>, ReturnType<typeof createFolderMethods>, ReturnType<typeof createTagMethods>, ReturnType<typeof createUserMethods>, ReturnType<typeof createConnectionMethods>, ReturnType<typeof createGridRankMethods>, ReturnType<typeof createAccountMethods> {
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Error thrown when the Synup API returns a non-2xx response.
|
|
904
|
+
*/
|
|
905
|
+
declare class SynupAPIError extends Error {
|
|
906
|
+
statusCode: number | null;
|
|
907
|
+
responseBody: string | null;
|
|
908
|
+
constructor(message: string, statusCode?: number, responseBody?: string);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
export { type AddCampaignCustomersInput, type AddCustomersResponse, type AddKeywordsInput, type BingAnalytics, type ConnectedAccount, type ConnectedAccountDetails, type ConnectedAccountFolder, type ConnectedAccountListing, type ConnectionSuggestion, type Country, type CreateCampaignInput, type CreateCampaignResponse, type CreateGridReportInput, type CreateLocationInput, type CreateUserInput, type CustomerInput, type DuplicateListing, type EditReviewResponseInput, type FacebookAnalytics, type Folder, type GoogleAnalytics, type GridReport, type GridReportFilterOptions, type HttpCore, type Interaction, type InteractionEdge, type InteractionFilters, type InteractionPageInfo, type InteractionResponse, type InteractionsData, type Keyword, type KeywordPerformance, type KeywordPerformanceOptions, type Listing, type Location, type OAuthConnectUrl, type PageInfo, type PaginatedResponse, type PaginationOptions, type Photo, type PhotoInput, type PlanSite, type RankingAnalyticsTimelineInput, type RankingHistogramEntry, type RankingSitewiseHistogramInput, type RankingTimelineEntry, type RespondToReviewInput, type ReviewAnalytics, type ReviewCampaign, type ReviewCampaignCustomersResponse, type ReviewDetails, type ReviewPhrase, type ReviewPhrasesOptions, type ReviewSettings, type ReviewSiteConfig, type ReviewSiteUrl, type Role, type Subscription, SynupAPIError, SynupClient, type SynupClientOptions, type Tag, type TemporaryCloseInput, type UpdateLocationInput, type UpdateUserInput, type User, type VoiceListing, encodeLocationId };
|