@dracoonghost/trndup-sdk 1.3.20 → 1.3.22
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/dist/index.d.mts +219 -14
- package/dist/index.d.ts +219 -14
- package/dist/index.js +94 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -486,24 +486,107 @@ var InstagramModule = class {
|
|
|
486
486
|
constructor(client) {
|
|
487
487
|
this.client = client;
|
|
488
488
|
}
|
|
489
|
+
// ===== UNIFIED SYNC STATUS =====
|
|
490
|
+
/**
|
|
491
|
+
* Get unified sync status for all Instagram data types
|
|
492
|
+
* GET /v1/platforms/instagram/sync/status
|
|
493
|
+
*
|
|
494
|
+
* Shows when each type was last synced and when next sync is due.
|
|
495
|
+
*/
|
|
496
|
+
async getSyncStatus() {
|
|
497
|
+
return this.client.get("/v1/platforms/instagram/sync/status");
|
|
498
|
+
}
|
|
489
499
|
// ===== INITIALIZATION =====
|
|
500
|
+
/**
|
|
501
|
+
* Initialize Instagram data sync
|
|
502
|
+
* POST /v1/platforms/instagram/init
|
|
503
|
+
*/
|
|
504
|
+
async initialize() {
|
|
505
|
+
return this.client.post("/v1/platforms/instagram/init");
|
|
506
|
+
}
|
|
490
507
|
/**
|
|
491
508
|
* Get Instagram initialization status
|
|
492
|
-
* GET /v1/platforms/instagram/status
|
|
509
|
+
* GET /v1/platforms/instagram/init/status
|
|
493
510
|
*/
|
|
494
511
|
async getInitStatus() {
|
|
495
|
-
return this.client.get("/v1/platforms/instagram/status
|
|
512
|
+
return this.client.get("/v1/platforms/instagram/init/status");
|
|
496
513
|
}
|
|
514
|
+
// ===== POSTS SYNC =====
|
|
497
515
|
/**
|
|
498
|
-
*
|
|
499
|
-
*
|
|
516
|
+
* Sync all posts from Instagram to database
|
|
517
|
+
* POST /v1/platforms/instagram/posts/sync
|
|
500
518
|
*/
|
|
501
|
-
async
|
|
502
|
-
return this.client.
|
|
519
|
+
async syncPosts() {
|
|
520
|
+
return this.client.post("/v1/platforms/instagram/posts/sync");
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Check posts sync status without triggering a sync
|
|
524
|
+
* GET /v1/platforms/instagram/posts/sync/status
|
|
525
|
+
*/
|
|
526
|
+
async getPostsSyncStatus() {
|
|
527
|
+
return this.client.get("/v1/platforms/instagram/posts/sync/status");
|
|
503
528
|
}
|
|
504
|
-
// ===== ACCOUNT
|
|
529
|
+
// ===== ACCOUNT ANALYTICS SYNC =====
|
|
505
530
|
/**
|
|
506
|
-
*
|
|
531
|
+
* Sync account-level analytics (reach, impressions, engagement)
|
|
532
|
+
* POST /v1/platforms/instagram/analytics/account/sync
|
|
533
|
+
* @param range Time range: '7d', '14d', '30d' (default '30d')
|
|
534
|
+
*/
|
|
535
|
+
async syncAccountAnalytics(params) {
|
|
536
|
+
const queryParams = params?.range ? `?range=${params.range}` : "";
|
|
537
|
+
return this.client.post(
|
|
538
|
+
`/v1/platforms/instagram/analytics/account/sync${queryParams}`
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Get account analytics sync status
|
|
543
|
+
* GET /v1/platforms/instagram/analytics/account/sync/status
|
|
544
|
+
*/
|
|
545
|
+
async getAccountAnalyticsSyncStatus() {
|
|
546
|
+
return this.client.get(
|
|
547
|
+
"/v1/platforms/instagram/analytics/account/sync/status"
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
// ===== POST INSIGHTS SYNC =====
|
|
551
|
+
/**
|
|
552
|
+
* Sync post-level insights for all posts
|
|
553
|
+
* POST /v1/platforms/instagram/analytics/posts/sync
|
|
554
|
+
*/
|
|
555
|
+
async syncPostInsights() {
|
|
556
|
+
return this.client.post(
|
|
557
|
+
"/v1/platforms/instagram/analytics/posts/sync"
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Get post insights sync status
|
|
562
|
+
* GET /v1/platforms/instagram/analytics/posts/sync/status
|
|
563
|
+
*/
|
|
564
|
+
async getPostInsightsSyncStatus() {
|
|
565
|
+
return this.client.get(
|
|
566
|
+
"/v1/platforms/instagram/analytics/posts/sync/status"
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
// ===== DATA RETRIEVAL =====
|
|
570
|
+
/**
|
|
571
|
+
* Get user profile info
|
|
572
|
+
* GET /v1/platforms/instagram/profile
|
|
573
|
+
*/
|
|
574
|
+
async getProfile() {
|
|
575
|
+
return this.client.get("/v1/platforms/instagram/profile");
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Get account overview for dashboard
|
|
579
|
+
* GET /v1/platforms/instagram/account/overview
|
|
580
|
+
* @param range Time range: '7d', '14d', '28d', '30d'
|
|
581
|
+
*/
|
|
582
|
+
async getAccountOverview(params) {
|
|
583
|
+
return this.client.get(
|
|
584
|
+
"/v1/platforms/instagram/account/overview",
|
|
585
|
+
params
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Get account-level insights (historical data)
|
|
507
590
|
* GET /v1/platforms/instagram/account/insights
|
|
508
591
|
* @param range Time range: '7d', '14d', '28d', '30d'
|
|
509
592
|
*/
|
|
@@ -513,7 +596,6 @@ var InstagramModule = class {
|
|
|
513
596
|
params
|
|
514
597
|
);
|
|
515
598
|
}
|
|
516
|
-
// ===== MEDIA / POSTS =====
|
|
517
599
|
/**
|
|
518
600
|
* Get Instagram posts
|
|
519
601
|
* GET /v1/platforms/instagram/posts
|
|
@@ -533,7 +615,6 @@ var InstagramModule = class {
|
|
|
533
615
|
`/v1/platforms/instagram/posts/${postId}/insights`
|
|
534
616
|
);
|
|
535
617
|
}
|
|
536
|
-
// ===== STORIES =====
|
|
537
618
|
/**
|
|
538
619
|
* Get active stories
|
|
539
620
|
* GET /v1/platforms/instagram/stories
|
|
@@ -541,27 +622,15 @@ var InstagramModule = class {
|
|
|
541
622
|
async getStories() {
|
|
542
623
|
return this.client.get("/v1/platforms/instagram/stories");
|
|
543
624
|
}
|
|
544
|
-
// ===== SYNC =====
|
|
625
|
+
// ===== LEGACY SYNC (backward compat) =====
|
|
545
626
|
/**
|
|
546
|
-
* Trigger manual data sync
|
|
627
|
+
* Trigger manual data sync (legacy - use specific sync methods)
|
|
547
628
|
* POST /v1/platforms/instagram/sync
|
|
629
|
+
* @deprecated Use syncPosts, syncAccountAnalytics, syncPostInsights instead
|
|
548
630
|
*/
|
|
549
631
|
async sync() {
|
|
550
632
|
return this.client.post("/v1/platforms/instagram/sync");
|
|
551
633
|
}
|
|
552
|
-
// ===== LEGACY (backward compat) =====
|
|
553
|
-
/**
|
|
554
|
-
* @deprecated Use getAccountInsights instead
|
|
555
|
-
*/
|
|
556
|
-
async getAccountMetrics() {
|
|
557
|
-
return this.getAccountInsights();
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* @deprecated Use sync instead
|
|
561
|
-
*/
|
|
562
|
-
async refresh() {
|
|
563
|
-
return this.sync();
|
|
564
|
-
}
|
|
565
634
|
};
|
|
566
635
|
|
|
567
636
|
// modules/social.ts
|