@smartlyqofficial/node 0.1.4 → 0.1.5

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
@@ -121,6 +121,13 @@ All methods below are available on the client. Full request/response documentati
121
121
  | `sq.analytics.contentDecay(query?)` | `GET /analytics/content-decay` | Content decay |
122
122
  | `sq.analytics.postingFrequency(query?)` | `GET /analytics/posting-frequency` | Posting frequency vs engagement |
123
123
  | `sq.analytics.postTimeline(postId)` | `GET /analytics/posts/{post_id}/timeline` | Post metric timeline |
124
+ | `sq.analytics.inboxVolume(query?)` | `GET /analytics/inbox/volume` | Inbox volume |
125
+ | `sq.analytics.inboxHeatmap(query?)` | `GET /analytics/inbox/heatmap` | Inbox heatmap |
126
+ | `sq.analytics.inboxSourceBreakdown(query?)` | `GET /analytics/inbox/source-breakdown` | Inbox source breakdown |
127
+ | `sq.analytics.inboxResponseTime(query?)` | `GET /analytics/inbox/response-time` | Inbox response time |
128
+ | `sq.analytics.inboxTopAccounts(query?)` | `GET /analytics/inbox/top-accounts` | Inbox top accounts |
129
+ | `sq.analytics.inboxConversations(query?)` | `GET /analytics/inbox/conversations` | Inbox conversation stats |
130
+ | `sq.analytics.inboxConversationDetail(conversationId)` | `GET /analytics/inbox/conversations/{conversation_id}` | Conversation analytics |
124
131
 
125
132
  ### Articles
126
133
 
@@ -139,6 +146,18 @@ All methods below are available on the client. Full request/response documentati
139
146
  | `sq.audio.speechToText(body)` | `POST /audio/speech-to-text` | Speech to text |
140
147
  | `sq.audio.get(audioId)` | `GET /audio/{audio_id}` | Get audio |
141
148
 
149
+ ### Automations
150
+
151
+ | Method | Endpoint | Description |
152
+ | --- | --- | --- |
153
+ | `sq.automations.list(query?)` | `GET /automations` | List automations |
154
+ | `sq.automations.get(automationId)` | `GET /automations/{automation_id}` | Get automation |
155
+ | `sq.automations.activate(automationId)` | `POST /automations/{automation_id}/activate` | Activate automation |
156
+ | `sq.automations.deactivate(automationId)` | `POST /automations/{automation_id}/deactivate` | Pause automation |
157
+ | `sq.automations.trigger(automationId, body?)` | `POST /automations/{automation_id}/trigger` | Trigger automation |
158
+ | `sq.automations.listRuns(automationId, query?)` | `GET /automations/{automation_id}/runs` | List runs |
159
+ | `sq.automations.getRun(automationId, runId)` | `GET /automations/{automation_id}/runs/{run_id}` | Get run |
160
+
142
161
  ### Chatbot
143
162
 
144
163
  | Method | Endpoint | Description |
@@ -170,6 +189,13 @@ All methods below are available on the client. Full request/response documentati
170
189
  | `sq.content.rewrite(body)` | `POST /content/rewrite` | Rewrite content |
171
190
  | `sq.content.generateCaption(body?)` | `POST /content/caption` | Generate a social caption |
172
191
 
192
+ ### CRM
193
+
194
+ | Method | Endpoint | Description |
195
+ | --- | --- | --- |
196
+ | `sq.crm.deleteContact(id)` | `DELETE /contacts/{id}` | Delete contact |
197
+ | `sq.crm.bulkImportContacts(body)` | `POST /contacts/bulk` | Bulk import contacts |
198
+
173
199
  ### CRM Contacts
174
200
 
175
201
  | Method | Endpoint | Description |
@@ -265,6 +291,14 @@ All methods below are available on the client. Full request/response documentati
265
291
  | `sq.profiles.createConnectUrl(id, platform, body?)` | `POST /profiles/{id}/connect/{platform}` | Get a raw connect URL for one platform |
266
292
  | `sq.profiles.getAccountBilling()` | `GET /me/account-billing` | Account billing summary |
267
293
 
294
+ ### Reviews
295
+
296
+ | Method | Endpoint | Description |
297
+ | --- | --- | --- |
298
+ | `sq.reviews.list(query?)` | `GET /reviews` | List reviews |
299
+ | `sq.reviews.replyTo(reviewId, body)` | `POST /reviews/{review_id}/reply` | Reply to review |
300
+ | `sq.reviews.sync(body?)` | `POST /reviews/sync` | Sync reviews |
301
+
268
302
  ### SEO
269
303
 
270
304
  | Method | Endpoint | Description |
@@ -307,6 +341,7 @@ All methods below are available on the client. Full request/response documentati
307
341
  | `sq.social.updatePost(postId, body)` | `PATCH /social/posts/{post_id}` | Update social post |
308
342
  | `sq.social.deletePost(postId)` | `DELETE /social/posts/{post_id}` | Delete social post |
309
343
  | `sq.social.updateAccount(accountId, body)` | `PATCH /social/accounts/{account_id}` | Rename account |
344
+ | `sq.social.disconnectAccount(accountId)` | `DELETE /social/accounts/{account_id}` | Disconnect a social account |
310
345
  | `sq.social.getAccountHealth(accountId)` | `GET /social/accounts/{account_id}/health` | Account health |
311
346
  | `sq.social.getAccountReconnectUrl(accountId)` | `GET /social/accounts/{account_id}/reconnect-url` | Account reconnect URL |
312
347
  | `sq.social.pauseAccount(accountId)` | `POST /social/accounts/{account_id}/pause` | Pause posting to an account |
@@ -336,6 +371,20 @@ All methods below are available on the client. Full request/response documentati
336
371
  | `sq.social.getAccountGroup(groupId)` | `GET /social/account-groups/{group_id}` | Get account group |
337
372
  | `sq.social.updateAccountGroup(groupId, body)` | `PUT /social/account-groups/{group_id}` | Update account group |
338
373
  | `sq.social.deleteAccountGroup(groupId)` | `DELETE /social/account-groups/{group_id}` | Delete account group |
374
+ | `sq.social.getConversation(conversationId)` | `GET /social/conversations/{conversation_id}` | Get conversation |
375
+ | `sq.social.updateConversation(conversationId, body)` | `PATCH /social/conversations/{conversation_id}` | Archive / reopen conversation |
376
+ | `sq.social.searchConversations(query?)` | `GET /social/conversations/search` | Search conversations |
377
+ | `sq.social.pinterestBoards(accountId)` | `GET /social/accounts/{account_id}/pinterest/boards` | Pinterest boards |
378
+ | `sq.social.youtubePlaylists(accountId)` | `GET /social/accounts/{account_id}/youtube/playlists` | YouTube playlists |
379
+ | `sq.social.instagramPublishingLimit(accountId)` | `GET /social/accounts/{account_id}/instagram/publishing-limit` | Instagram publishing limit |
380
+ | `sq.social.gmbPerformance(accountId, query?)` | `GET /social/accounts/{account_id}/gmb/performance` | Google Business performance |
381
+ | `sq.social.gmbSearchKeywords(accountId, query?)` | `GET /social/accounts/{account_id}/gmb/search-keywords` | Google Business search keywords |
382
+ | `sq.social.redditSearch(accountId, query?)` | `GET /social/accounts/{account_id}/reddit/search` | Reddit search |
383
+ | `sq.social.redditFeed(accountId, query?)` | `GET /social/accounts/{account_id}/reddit/feed` | Reddit feed |
384
+ | `sq.social.redditSubreddits(accountId)` | `GET /social/accounts/{account_id}/reddit/subreddits` | Subscribed subreddits |
385
+ | `sq.social.redditSubredditRules(accountId, subreddit)` | `GET /social/accounts/{account_id}/reddit/subreddits/{subreddit}/rules` | Subreddit rules |
386
+ | `sq.social.instagramStories(accountId)` | `GET /social/accounts/{account_id}/instagram/stories` | Instagram stories |
387
+ | `sq.social.facebookPostReactions(accountId, query?)` | `GET /social/accounts/{account_id}/facebook/post-reactions` | Facebook post reactions |
339
388
 
340
389
  ### URLs
341
390
 
package/dist/index.cjs CHANGED
@@ -24,12 +24,14 @@ __export(index_exports, {
24
24
  AnalyticsResource: () => AnalyticsResource,
25
25
  ArticlesResource: () => ArticlesResource,
26
26
  AudioResource: () => AudioResource,
27
+ AutomationsResource: () => AutomationsResource,
27
28
  CaptainResource: () => CaptainResource,
28
29
  ChatbotsResource: () => ChatbotsResource,
29
30
  CommentsResource: () => CommentsResource,
30
31
  ContactsResource: () => ContactsResource,
31
32
  ContentResource: () => ContentResource,
32
33
  CoreClient: () => CoreClient,
34
+ CrmResource: () => CrmResource,
33
35
  CustomFieldsResource: () => CustomFieldsResource,
34
36
  ImagesResource: () => ImagesResource,
35
37
  JobsResource: () => JobsResource,
@@ -38,6 +40,7 @@ __export(index_exports, {
38
40
  OpportunitiesResource: () => OpportunitiesResource,
39
41
  PresentationsResource: () => PresentationsResource,
40
42
  ProfilesResource: () => ProfilesResource,
43
+ ReviewsResource: () => ReviewsResource,
41
44
  SeoResource: () => SeoResource,
42
45
  ShortsResource: () => ShortsResource,
43
46
  SmartlyQ: () => SmartlyQ,
@@ -239,6 +242,34 @@ var AnalyticsResource = class {
239
242
  postTimeline(postId, options) {
240
243
  return this._client.request("GET", `/analytics/posts/${encodeURIComponent(postId)}/timeline`, { options });
241
244
  }
245
+ /** Inbox volume `GET /analytics/inbox/volume` */
246
+ inboxVolume(query, options) {
247
+ return this._client.request("GET", "/analytics/inbox/volume", { query, options });
248
+ }
249
+ /** Inbox heatmap `GET /analytics/inbox/heatmap` */
250
+ inboxHeatmap(query, options) {
251
+ return this._client.request("GET", "/analytics/inbox/heatmap", { query, options });
252
+ }
253
+ /** Inbox source breakdown `GET /analytics/inbox/source-breakdown` */
254
+ inboxSourceBreakdown(query, options) {
255
+ return this._client.request("GET", "/analytics/inbox/source-breakdown", { query, options });
256
+ }
257
+ /** Inbox response time `GET /analytics/inbox/response-time` */
258
+ inboxResponseTime(query, options) {
259
+ return this._client.request("GET", "/analytics/inbox/response-time", { query, options });
260
+ }
261
+ /** Inbox top accounts `GET /analytics/inbox/top-accounts` */
262
+ inboxTopAccounts(query, options) {
263
+ return this._client.request("GET", "/analytics/inbox/top-accounts", { query, options });
264
+ }
265
+ /** Inbox conversation stats `GET /analytics/inbox/conversations` */
266
+ inboxConversations(query, options) {
267
+ return this._client.request("GET", "/analytics/inbox/conversations", { query, options });
268
+ }
269
+ /** Conversation analytics `GET /analytics/inbox/conversations/{conversation_id}` */
270
+ inboxConversationDetail(conversationId, options) {
271
+ return this._client.request("GET", `/analytics/inbox/conversations/${encodeURIComponent(conversationId)}`, { options });
272
+ }
242
273
  };
243
274
  var ArticlesResource = class {
244
275
  constructor(_client) {
@@ -278,6 +309,39 @@ var AudioResource = class {
278
309
  return this._client.request("GET", `/audio/${encodeURIComponent(audioId)}`, { options });
279
310
  }
280
311
  };
312
+ var AutomationsResource = class {
313
+ constructor(_client) {
314
+ this._client = _client;
315
+ }
316
+ /** List automations `GET /automations` */
317
+ list(query, options) {
318
+ return this._client.request("GET", "/automations", { query, options });
319
+ }
320
+ /** Get automation `GET /automations/{automation_id}` */
321
+ get(automationId, options) {
322
+ return this._client.request("GET", `/automations/${encodeURIComponent(automationId)}`, { options });
323
+ }
324
+ /** Activate automation `POST /automations/{automation_id}/activate` */
325
+ activate(automationId, options) {
326
+ return this._client.request("POST", `/automations/${encodeURIComponent(automationId)}/activate`, { options });
327
+ }
328
+ /** Pause automation `POST /automations/{automation_id}/deactivate` */
329
+ deactivate(automationId, options) {
330
+ return this._client.request("POST", `/automations/${encodeURIComponent(automationId)}/deactivate`, { options });
331
+ }
332
+ /** Trigger automation `POST /automations/{automation_id}/trigger` */
333
+ trigger(automationId, body, options) {
334
+ return this._client.request("POST", `/automations/${encodeURIComponent(automationId)}/trigger`, { body, options });
335
+ }
336
+ /** List runs `GET /automations/{automation_id}/runs` */
337
+ listRuns(automationId, query, options) {
338
+ return this._client.request("GET", `/automations/${encodeURIComponent(automationId)}/runs`, { query, options });
339
+ }
340
+ /** Get run `GET /automations/{automation_id}/runs/{run_id}` */
341
+ getRun(automationId, runId, options) {
342
+ return this._client.request("GET", `/automations/${encodeURIComponent(automationId)}/runs/${encodeURIComponent(runId)}`, { options });
343
+ }
344
+ };
281
345
  var ChatbotsResource = class {
282
346
  constructor(_client) {
283
347
  this._client = _client;
@@ -357,6 +421,19 @@ var ContentResource = class {
357
421
  return this._client.request("POST", "/content/caption", { body, options });
358
422
  }
359
423
  };
424
+ var CrmResource = class {
425
+ constructor(_client) {
426
+ this._client = _client;
427
+ }
428
+ /** Delete contact `DELETE /contacts/{id}` */
429
+ deleteContact(id, options) {
430
+ return this._client.request("DELETE", `/contacts/${encodeURIComponent(id)}`, { options });
431
+ }
432
+ /** Bulk import contacts `POST /contacts/bulk` */
433
+ bulkImportContacts(body, options) {
434
+ return this._client.request("POST", "/contacts/bulk", { body, options });
435
+ }
436
+ };
360
437
  var ContactsResource = class {
361
438
  constructor(_client) {
362
439
  this._client = _client;
@@ -602,6 +679,23 @@ var ProfilesResource = class {
602
679
  return this._client.request("GET", "/me/account-billing", { options });
603
680
  }
604
681
  };
682
+ var ReviewsResource = class {
683
+ constructor(_client) {
684
+ this._client = _client;
685
+ }
686
+ /** List reviews `GET /reviews` */
687
+ list(query, options) {
688
+ return this._client.request("GET", "/reviews", { query, options });
689
+ }
690
+ /** Reply to review `POST /reviews/{review_id}/reply` */
691
+ replyTo(reviewId, body, options) {
692
+ return this._client.request("POST", `/reviews/${encodeURIComponent(reviewId)}/reply`, { body, options });
693
+ }
694
+ /** Sync reviews `POST /reviews/sync` */
695
+ sync(body, options) {
696
+ return this._client.request("POST", "/reviews/sync", { body, options });
697
+ }
698
+ };
605
699
  var SeoResource = class {
606
700
  constructor(_client) {
607
701
  this._client = _client;
@@ -728,6 +822,10 @@ var SocialResource = class {
728
822
  updateAccount(accountId, body, options) {
729
823
  return this._client.request("PATCH", `/social/accounts/${encodeURIComponent(accountId)}`, { body, options });
730
824
  }
825
+ /** Disconnect a social account `DELETE /social/accounts/{account_id}` */
826
+ disconnectAccount(accountId, options) {
827
+ return this._client.request("DELETE", `/social/accounts/${encodeURIComponent(accountId)}`, { options });
828
+ }
731
829
  /** Account health `GET /social/accounts/{account_id}/health` */
732
830
  getAccountHealth(accountId, options) {
733
831
  return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/health`, { options });
@@ -844,6 +942,62 @@ var SocialResource = class {
844
942
  deleteAccountGroup(groupId, options) {
845
943
  return this._client.request("DELETE", `/social/account-groups/${encodeURIComponent(groupId)}`, { options });
846
944
  }
945
+ /** Get conversation `GET /social/conversations/{conversation_id}` */
946
+ getConversation(conversationId, options) {
947
+ return this._client.request("GET", `/social/conversations/${encodeURIComponent(conversationId)}`, { options });
948
+ }
949
+ /** Archive / reopen conversation `PATCH /social/conversations/{conversation_id}` */
950
+ updateConversation(conversationId, body, options) {
951
+ return this._client.request("PATCH", `/social/conversations/${encodeURIComponent(conversationId)}`, { body, options });
952
+ }
953
+ /** Search conversations `GET /social/conversations/search` */
954
+ searchConversations(query, options) {
955
+ return this._client.request("GET", "/social/conversations/search", { query, options });
956
+ }
957
+ /** Pinterest boards `GET /social/accounts/{account_id}/pinterest/boards` */
958
+ pinterestBoards(accountId, options) {
959
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/pinterest/boards`, { options });
960
+ }
961
+ /** YouTube playlists `GET /social/accounts/{account_id}/youtube/playlists` */
962
+ youtubePlaylists(accountId, options) {
963
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/youtube/playlists`, { options });
964
+ }
965
+ /** Instagram publishing limit `GET /social/accounts/{account_id}/instagram/publishing-limit` */
966
+ instagramPublishingLimit(accountId, options) {
967
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/instagram/publishing-limit`, { options });
968
+ }
969
+ /** Google Business performance `GET /social/accounts/{account_id}/gmb/performance` */
970
+ gmbPerformance(accountId, query, options) {
971
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/gmb/performance`, { query, options });
972
+ }
973
+ /** Google Business search keywords `GET /social/accounts/{account_id}/gmb/search-keywords` */
974
+ gmbSearchKeywords(accountId, query, options) {
975
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/gmb/search-keywords`, { query, options });
976
+ }
977
+ /** Reddit search `GET /social/accounts/{account_id}/reddit/search` */
978
+ redditSearch(accountId, query, options) {
979
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/reddit/search`, { query, options });
980
+ }
981
+ /** Reddit feed `GET /social/accounts/{account_id}/reddit/feed` */
982
+ redditFeed(accountId, query, options) {
983
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/reddit/feed`, { query, options });
984
+ }
985
+ /** Subscribed subreddits `GET /social/accounts/{account_id}/reddit/subreddits` */
986
+ redditSubreddits(accountId, options) {
987
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/reddit/subreddits`, { options });
988
+ }
989
+ /** Subreddit rules `GET /social/accounts/{account_id}/reddit/subreddits/{subreddit}/rules` */
990
+ redditSubredditRules(accountId, subreddit, options) {
991
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/reddit/subreddits/${encodeURIComponent(subreddit)}/rules`, { options });
992
+ }
993
+ /** Instagram stories `GET /social/accounts/{account_id}/instagram/stories` */
994
+ instagramStories(accountId, options) {
995
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/instagram/stories`, { options });
996
+ }
997
+ /** Facebook post reactions `GET /social/accounts/{account_id}/facebook/post-reactions` */
998
+ facebookPostReactions(accountId, query, options) {
999
+ return this._client.request("GET", `/social/accounts/${encodeURIComponent(accountId)}/facebook/post-reactions`, { query, options });
1000
+ }
847
1001
  };
848
1002
  var UrlsResource = class {
849
1003
  constructor(_client) {
@@ -1000,9 +1154,11 @@ function createResources(client) {
1000
1154
  analytics: new AnalyticsResource(client),
1001
1155
  articles: new ArticlesResource(client),
1002
1156
  audio: new AudioResource(client),
1157
+ automations: new AutomationsResource(client),
1003
1158
  chatbots: new ChatbotsResource(client),
1004
1159
  comments: new CommentsResource(client),
1005
1160
  content: new ContentResource(client),
1161
+ crm: new CrmResource(client),
1006
1162
  contacts: new ContactsResource(client),
1007
1163
  customFields: new CustomFieldsResource(client),
1008
1164
  opportunities: new OpportunitiesResource(client),
@@ -1012,6 +1168,7 @@ function createResources(client) {
1012
1168
  media: new MediaResource(client),
1013
1169
  presentations: new PresentationsResource(client),
1014
1170
  profiles: new ProfilesResource(client),
1171
+ reviews: new ReviewsResource(client),
1015
1172
  seo: new SeoResource(client),
1016
1173
  shorts: new ShortsResource(client),
1017
1174
  social: new SocialResource(client),
@@ -1027,31 +1184,7 @@ var SmartlyQ = class {
1027
1184
  constructor(options = {}) {
1028
1185
  const resolved = typeof options === "string" ? { apiKey: options } : options;
1029
1186
  this.core = new CoreClient(resolved);
1030
- const resources = createResources(this.core);
1031
- this.account = resources.account;
1032
- this.analytics = resources.analytics;
1033
- this.articles = resources.articles;
1034
- this.audio = resources.audio;
1035
- this.captain = resources.captain;
1036
- this.chatbots = resources.chatbots;
1037
- this.comments = resources.comments;
1038
- this.contacts = resources.contacts;
1039
- this.content = resources.content;
1040
- this.customFields = resources.customFields;
1041
- this.images = resources.images;
1042
- this.jobs = resources.jobs;
1043
- this.media = resources.media;
1044
- this.messages = resources.messages;
1045
- this.opportunities = resources.opportunities;
1046
- this.presentations = resources.presentations;
1047
- this.profiles = resources.profiles;
1048
- this.seo = resources.seo;
1049
- this.shorts = resources.shorts;
1050
- this.social = resources.social;
1051
- this.urls = resources.urls;
1052
- this.videos = resources.videos;
1053
- this.webhooks = resources.webhooks;
1054
- this.workspaces = resources.workspaces;
1187
+ Object.assign(this, createResources(this.core));
1055
1188
  }
1056
1189
  };
1057
1190
  var index_default = SmartlyQ;
@@ -1061,12 +1194,14 @@ var index_default = SmartlyQ;
1061
1194
  AnalyticsResource,
1062
1195
  ArticlesResource,
1063
1196
  AudioResource,
1197
+ AutomationsResource,
1064
1198
  CaptainResource,
1065
1199
  ChatbotsResource,
1066
1200
  CommentsResource,
1067
1201
  ContactsResource,
1068
1202
  ContentResource,
1069
1203
  CoreClient,
1204
+ CrmResource,
1070
1205
  CustomFieldsResource,
1071
1206
  ImagesResource,
1072
1207
  JobsResource,
@@ -1075,6 +1210,7 @@ var index_default = SmartlyQ;
1075
1210
  OpportunitiesResource,
1076
1211
  PresentationsResource,
1077
1212
  ProfilesResource,
1213
+ ReviewsResource,
1078
1214
  SeoResource,
1079
1215
  ShortsResource,
1080
1216
  SmartlyQ,