@getlatedev/node 0.1.58 → 0.2.4
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 +29 -26
- package/dist/index.d.mts +260 -17
- package/dist/index.d.ts +260 -17
- package/dist/index.js +40 -13
- package/dist/index.mjs +38 -13
- package/package.json +7 -7
- package/src/client.ts +26 -16
- package/src/errors.ts +11 -8
- package/src/generated/sdk.gen.ts +41 -1
- package/src/generated/types.gen.ts +251 -1
- package/src/index.ts +8 -7
|
@@ -533,6 +533,91 @@ export type HashtagInfo = {
|
|
|
533
533
|
|
|
534
534
|
export type status2 = 'safe' | 'banned' | 'restricted' | 'unknown';
|
|
535
535
|
|
|
536
|
+
export type InstagramAccountInsightsResponse = {
|
|
537
|
+
success?: boolean;
|
|
538
|
+
/**
|
|
539
|
+
* The Zernio SocialAccount ID
|
|
540
|
+
*/
|
|
541
|
+
accountId?: string;
|
|
542
|
+
platform?: string;
|
|
543
|
+
dateRange?: {
|
|
544
|
+
since?: string;
|
|
545
|
+
until?: string;
|
|
546
|
+
};
|
|
547
|
+
metricType?: 'time_series' | 'total_value';
|
|
548
|
+
/**
|
|
549
|
+
* Breakdown dimension used (only present when breakdown was requested)
|
|
550
|
+
*/
|
|
551
|
+
breakdown?: string;
|
|
552
|
+
/**
|
|
553
|
+
* Object keyed by metric name. For time_series: each metric has "total" (number) and "values" (array of {date, value}).
|
|
554
|
+
* For total_value: each metric has "total" (number) and optionally "breakdowns" (array of {dimension, value}).
|
|
555
|
+
*
|
|
556
|
+
*/
|
|
557
|
+
metrics?: {
|
|
558
|
+
[key: string]: {
|
|
559
|
+
/**
|
|
560
|
+
* Sum or aggregate value for the metric
|
|
561
|
+
*/
|
|
562
|
+
total?: number;
|
|
563
|
+
/**
|
|
564
|
+
* Daily values (only for time_series)
|
|
565
|
+
*/
|
|
566
|
+
values?: Array<{
|
|
567
|
+
date?: string;
|
|
568
|
+
value?: number;
|
|
569
|
+
}>;
|
|
570
|
+
/**
|
|
571
|
+
* Breakdown values (only for total_value with breakdown)
|
|
572
|
+
*/
|
|
573
|
+
breakdowns?: Array<{
|
|
574
|
+
dimension?: string;
|
|
575
|
+
value?: number;
|
|
576
|
+
}>;
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
dataDelay?: string;
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
export type metricType = 'time_series' | 'total_value';
|
|
583
|
+
|
|
584
|
+
export type InstagramDemographicsResponse = {
|
|
585
|
+
success?: boolean;
|
|
586
|
+
/**
|
|
587
|
+
* The Zernio SocialAccount ID
|
|
588
|
+
*/
|
|
589
|
+
accountId?: string;
|
|
590
|
+
platform?: string;
|
|
591
|
+
metric?: 'follower_demographics' | 'engaged_audience_demographics';
|
|
592
|
+
/**
|
|
593
|
+
* The timeframe used for demographic data
|
|
594
|
+
*/
|
|
595
|
+
timeframe?: 'this_week' | 'this_month';
|
|
596
|
+
/**
|
|
597
|
+
* Object keyed by breakdown dimension (age, city, country, gender)
|
|
598
|
+
*/
|
|
599
|
+
demographics?: {
|
|
600
|
+
[key: string]: Array<{
|
|
601
|
+
/**
|
|
602
|
+
* The dimension value (e.g., "25-34", "US", "M")
|
|
603
|
+
*/
|
|
604
|
+
dimension?: string;
|
|
605
|
+
/**
|
|
606
|
+
* Count of accounts in this dimension
|
|
607
|
+
*/
|
|
608
|
+
value?: number;
|
|
609
|
+
}>;
|
|
610
|
+
};
|
|
611
|
+
note?: string;
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
export type metric = 'follower_demographics' | 'engaged_audience_demographics';
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* The timeframe used for demographic data
|
|
618
|
+
*/
|
|
619
|
+
export type timeframe = 'this_week' | 'this_month';
|
|
620
|
+
|
|
536
621
|
/**
|
|
537
622
|
* Feed aspect ratio 0.8-1.91, carousels up to 10 items, stories require media (no captions). User tag coordinates 0.0-1.0 from top-left. Images over 8 MB and videos over platform limits are auto-compressed.
|
|
538
623
|
*/
|
|
@@ -1415,9 +1500,13 @@ export type TikTokPlatformData = {
|
|
|
1415
1500
|
*/
|
|
1416
1501
|
mediaType?: 'video' | 'photo';
|
|
1417
1502
|
/**
|
|
1418
|
-
* Optional for video posts. Timestamp in milliseconds to select which frame to use as thumbnail (defaults to 1000ms/1 second).
|
|
1503
|
+
* Optional for video posts. Timestamp in milliseconds to select which frame to use as thumbnail (defaults to 1000ms/1 second). Ignored when videoCoverImageUrl is provided.
|
|
1419
1504
|
*/
|
|
1420
1505
|
videoCoverTimestampMs?: number;
|
|
1506
|
+
/**
|
|
1507
|
+
* Optional for video posts. URL of a custom thumbnail image (JPG, PNG, or WebP, max 20MB). The image is stitched as a single frame at the start of the video and used as the cover. Overrides videoCoverTimestampMs when provided.
|
|
1508
|
+
*/
|
|
1509
|
+
videoCoverImageUrl?: string;
|
|
1421
1510
|
/**
|
|
1422
1511
|
* Optional for photo carousels. Index of image to use as cover, 0-based (defaults to 0/first image).
|
|
1423
1512
|
*/
|
|
@@ -2447,6 +2536,86 @@ export type GetYouTubeDailyViewsError = ({
|
|
|
2447
2536
|
error?: string;
|
|
2448
2537
|
});
|
|
2449
2538
|
|
|
2539
|
+
export type GetInstagramAccountInsightsData = {
|
|
2540
|
+
query: {
|
|
2541
|
+
/**
|
|
2542
|
+
* The Zernio SocialAccount ID for the Instagram account
|
|
2543
|
+
*/
|
|
2544
|
+
accountId: string;
|
|
2545
|
+
/**
|
|
2546
|
+
* Breakdown dimension (only valid with metricType=total_value).
|
|
2547
|
+
* Valid values depend on the metric: media_product_type, follow_type, follower_type, contact_button_type.
|
|
2548
|
+
*
|
|
2549
|
+
*/
|
|
2550
|
+
breakdown?: string;
|
|
2551
|
+
/**
|
|
2552
|
+
* Comma-separated list of metrics. Defaults to "reach,views,accounts_engaged,total_interactions".
|
|
2553
|
+
* Valid metrics: reach, views, accounts_engaged, total_interactions, comments, likes, saves, shares,
|
|
2554
|
+
* replies, reposts, follows_and_unfollows, profile_links_taps.
|
|
2555
|
+
* Note: only "reach" supports metricType=time_series. All other metrics are total_value only.
|
|
2556
|
+
*
|
|
2557
|
+
*/
|
|
2558
|
+
metrics?: string;
|
|
2559
|
+
/**
|
|
2560
|
+
* "total_value" (default) returns aggregated totals and supports breakdowns.
|
|
2561
|
+
* "time_series" returns daily values but only works with the "reach" metric.
|
|
2562
|
+
*
|
|
2563
|
+
*/
|
|
2564
|
+
metricType?: 'time_series' | 'total_value';
|
|
2565
|
+
/**
|
|
2566
|
+
* Start date (YYYY-MM-DD). Defaults to 30 days ago.
|
|
2567
|
+
*/
|
|
2568
|
+
since?: string;
|
|
2569
|
+
/**
|
|
2570
|
+
* End date (YYYY-MM-DD). Defaults to today.
|
|
2571
|
+
*/
|
|
2572
|
+
until?: string;
|
|
2573
|
+
};
|
|
2574
|
+
};
|
|
2575
|
+
|
|
2576
|
+
export type GetInstagramAccountInsightsResponse = (InstagramAccountInsightsResponse);
|
|
2577
|
+
|
|
2578
|
+
export type GetInstagramAccountInsightsError = ({
|
|
2579
|
+
error?: string;
|
|
2580
|
+
} | {
|
|
2581
|
+
error?: string;
|
|
2582
|
+
code?: string;
|
|
2583
|
+
});
|
|
2584
|
+
|
|
2585
|
+
export type GetInstagramDemographicsData = {
|
|
2586
|
+
query: {
|
|
2587
|
+
/**
|
|
2588
|
+
* The Zernio SocialAccount ID for the Instagram account
|
|
2589
|
+
*/
|
|
2590
|
+
accountId: string;
|
|
2591
|
+
/**
|
|
2592
|
+
* Comma-separated list of demographic dimensions: age, city, country, gender.
|
|
2593
|
+
* Defaults to all four if omitted.
|
|
2594
|
+
*
|
|
2595
|
+
*/
|
|
2596
|
+
breakdown?: string;
|
|
2597
|
+
/**
|
|
2598
|
+
* "follower_demographics" for follower audience data, or "engaged_audience_demographics" for engaged viewers.
|
|
2599
|
+
*
|
|
2600
|
+
*/
|
|
2601
|
+
metric?: 'follower_demographics' | 'engaged_audience_demographics';
|
|
2602
|
+
/**
|
|
2603
|
+
* Time period for demographic data. Defaults to "this_month".
|
|
2604
|
+
*
|
|
2605
|
+
*/
|
|
2606
|
+
timeframe?: 'this_week' | 'this_month';
|
|
2607
|
+
};
|
|
2608
|
+
};
|
|
2609
|
+
|
|
2610
|
+
export type GetInstagramDemographicsResponse = (InstagramDemographicsResponse);
|
|
2611
|
+
|
|
2612
|
+
export type GetInstagramDemographicsError = ({
|
|
2613
|
+
error?: string;
|
|
2614
|
+
} | {
|
|
2615
|
+
error?: string;
|
|
2616
|
+
code?: string;
|
|
2617
|
+
});
|
|
2618
|
+
|
|
2450
2619
|
export type GetDailyMetricsData = {
|
|
2451
2620
|
query?: {
|
|
2452
2621
|
/**
|
|
@@ -3478,6 +3647,79 @@ export type GetAccountHealthError = ({
|
|
|
3478
3647
|
error?: string;
|
|
3479
3648
|
});
|
|
3480
3649
|
|
|
3650
|
+
export type GetTikTokCreatorInfoData = {
|
|
3651
|
+
path: {
|
|
3652
|
+
/**
|
|
3653
|
+
* The TikTok account ID
|
|
3654
|
+
*/
|
|
3655
|
+
accountId: string;
|
|
3656
|
+
};
|
|
3657
|
+
query?: {
|
|
3658
|
+
/**
|
|
3659
|
+
* The media type to get creator info for (affects available interaction settings)
|
|
3660
|
+
*/
|
|
3661
|
+
mediaType?: 'video' | 'photo';
|
|
3662
|
+
};
|
|
3663
|
+
};
|
|
3664
|
+
|
|
3665
|
+
export type GetTikTokCreatorInfoResponse = ({
|
|
3666
|
+
creator?: {
|
|
3667
|
+
/**
|
|
3668
|
+
* Creator display name
|
|
3669
|
+
*/
|
|
3670
|
+
nickname?: string;
|
|
3671
|
+
/**
|
|
3672
|
+
* Creator avatar URL
|
|
3673
|
+
*/
|
|
3674
|
+
avatarUrl?: string;
|
|
3675
|
+
/**
|
|
3676
|
+
* Whether the creator is verified
|
|
3677
|
+
*/
|
|
3678
|
+
isVerified?: boolean;
|
|
3679
|
+
/**
|
|
3680
|
+
* Whether the creator can publish more posts right now
|
|
3681
|
+
*/
|
|
3682
|
+
canPostMore?: boolean;
|
|
3683
|
+
};
|
|
3684
|
+
/**
|
|
3685
|
+
* Available privacy level options for this creator
|
|
3686
|
+
*/
|
|
3687
|
+
privacyLevels?: Array<{
|
|
3688
|
+
/**
|
|
3689
|
+
* Privacy level value to use when creating posts (e.g. PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR, SELF_ONLY)
|
|
3690
|
+
*/
|
|
3691
|
+
value?: string;
|
|
3692
|
+
/**
|
|
3693
|
+
* Human-readable label
|
|
3694
|
+
*/
|
|
3695
|
+
label?: string;
|
|
3696
|
+
}>;
|
|
3697
|
+
postingLimits?: {
|
|
3698
|
+
/**
|
|
3699
|
+
* Maximum video duration in seconds
|
|
3700
|
+
*/
|
|
3701
|
+
maxVideoDurationSec?: number;
|
|
3702
|
+
/**
|
|
3703
|
+
* Available interaction toggles (comment, duet, stitch) and their defaults
|
|
3704
|
+
*/
|
|
3705
|
+
interactionSettings?: {
|
|
3706
|
+
[key: string]: unknown;
|
|
3707
|
+
};
|
|
3708
|
+
};
|
|
3709
|
+
/**
|
|
3710
|
+
* Available commercial content disclosure options
|
|
3711
|
+
*/
|
|
3712
|
+
commercialContentTypes?: Array<{
|
|
3713
|
+
value?: string;
|
|
3714
|
+
label?: string;
|
|
3715
|
+
requires?: Array<(string)>;
|
|
3716
|
+
}>;
|
|
3717
|
+
});
|
|
3718
|
+
|
|
3719
|
+
export type GetTikTokCreatorInfoError = ({
|
|
3720
|
+
error?: string;
|
|
3721
|
+
});
|
|
3722
|
+
|
|
3481
3723
|
export type ListApiKeysResponse = ({
|
|
3482
3724
|
apiKeys?: Array<ApiKey>;
|
|
3483
3725
|
});
|
|
@@ -6283,6 +6525,14 @@ export type SendInboxMessageData = {
|
|
|
6283
6525
|
* Message text
|
|
6284
6526
|
*/
|
|
6285
6527
|
message?: string;
|
|
6528
|
+
/**
|
|
6529
|
+
* URL of the attachment to send (image, video, audio, or file). The URL must be publicly accessible. For binary file uploads, use multipart/form-data instead.
|
|
6530
|
+
*/
|
|
6531
|
+
attachmentUrl?: string;
|
|
6532
|
+
/**
|
|
6533
|
+
* Type of attachment. Defaults to file if not specified.
|
|
6534
|
+
*/
|
|
6535
|
+
attachmentType?: 'image' | 'video' | 'audio' | 'file';
|
|
6286
6536
|
/**
|
|
6287
6537
|
* Quick reply buttons. Mutually exclusive with buttons. Max 13 items.
|
|
6288
6538
|
*/
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Zernio - Official Node.js library for the Zernio API
|
|
3
3
|
*
|
|
4
4
|
* @example
|
|
5
5
|
* ```typescript
|
|
6
|
-
* import
|
|
6
|
+
* import Zernio from '@zernio/node';
|
|
7
7
|
*
|
|
8
|
-
* const
|
|
8
|
+
* const zernio = new Zernio();
|
|
9
9
|
*
|
|
10
|
-
* const post = await
|
|
10
|
+
* const post = await zernio.posts.create({
|
|
11
11
|
* body: {
|
|
12
12
|
* content: 'Hello world!',
|
|
13
13
|
* platforms: [{ platform: 'twitter', accountId: 'acc_123' }],
|
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
// Main client export
|
|
23
|
-
export {
|
|
22
|
+
// Main client export (Zernio is primary, Late is kept for backwards compatibility)
|
|
23
|
+
export { Zernio, Zernio as default, Late, type ClientOptions } from './client';
|
|
24
24
|
|
|
25
|
-
// Error exports
|
|
25
|
+
// Error exports (ZernioApiError is primary, LateApiError is kept for backwards compatibility)
|
|
26
26
|
export {
|
|
27
|
+
ZernioApiError,
|
|
27
28
|
LateApiError,
|
|
28
29
|
RateLimitError,
|
|
29
30
|
ValidationError,
|