ad2app-lib 1.0.11 → 1.2.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 +67 -15
- package/dist/types/I_PlatformStatistics.d.ts +65 -0
- package/dist/types/I_PlatformStatistics.js +85 -0
- package/dist/types/I_User.d.ts +0 -3
- package/dist/types/I_User.js +0 -8
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +3 -0
- package/dist/types/scheduling/I_SchedulingAnalytics.d.ts +92 -0
- package/dist/types/scheduling/I_SchedulingAnalytics.js +113 -0
- package/dist/types/scheduling/I_SchedulingConnectedAccount.d.ts +48 -0
- package/dist/types/scheduling/I_SchedulingConnectedAccount.js +61 -0
- package/dist/types/scheduling/I_SchedulingInbox.d.ts +64 -0
- package/dist/types/scheduling/I_SchedulingInbox.js +82 -0
- package/dist/types/scheduling/I_SchedulingPost.d.ts +80 -0
- package/dist/types/scheduling/I_SchedulingPost.js +109 -0
- package/dist/types/scheduling/I_SchedulingProUpgrade.d.ts +44 -0
- package/dist/types/scheduling/I_SchedulingProUpgrade.js +57 -0
- package/dist/types/scheduling/index.d.ts +11 -0
- package/dist/types/scheduling/index.js +27 -0
- package/package.json +1 -1
- package/src/types/index.ts +3 -0
- package/src/types/scheduling/I_SchedulingAnalytics.ts +164 -0
- package/src/types/scheduling/I_SchedulingConnectedAccount.ts +80 -0
- package/src/types/scheduling/I_SchedulingInbox.ts +118 -0
- package/src/types/scheduling/I_SchedulingPost.ts +161 -0
- package/src/types/scheduling/I_SchedulingProUpgrade.ts +78 -0
- package/src/types/scheduling/index.ts +12 -0
package/README.md
CHANGED
|
@@ -1,37 +1,89 @@
|
|
|
1
|
-
# ad2app
|
|
1
|
+
# ad2app-lib
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
In here, you will find types and utils. Updating was never that easy.
|
|
3
|
+
Shared TypeScript package used across all ad2app projects. Provides types, utilities, and API driver configuration.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
---
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Overview](#overview)
|
|
10
|
+
- [Tech Stack](#tech-stack)
|
|
11
|
+
- [Project Structure](#project-structure)
|
|
12
|
+
- [Getting Started](#getting-started)
|
|
13
|
+
- [Usage](#usage)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
`ad2app-lib` is a local npm package linked via `npm link`. It is not published to the npm registry. Changes propagate instantly to all linked projects after `npm run build`.
|
|
20
|
+
|
|
21
|
+
| Export | Description |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `ad2app-lib/types` | Shared TypeScript interfaces and enums (User, Campaign, Offer, etc.) |
|
|
24
|
+
| `ad2app-lib/utils` | Shared utility functions |
|
|
25
|
+
| `ad2app-lib/api` | `configureApiDriver` — sets up the shared HTTP client |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Tech Stack
|
|
30
|
+
|
|
31
|
+
| Layer | Technology |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Language | TypeScript 5.8 |
|
|
34
|
+
| Build | `tsc` (CommonJS output + `.d.ts` declarations) |
|
|
35
|
+
| Validation | class-validator 0.14 |
|
|
36
|
+
| Date handling | date-fns 3.5 + date-fns-tz |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Project Structure
|
|
9
41
|
|
|
10
42
|
```
|
|
11
|
-
|
|
12
|
-
|
|
43
|
+
src/
|
|
44
|
+
├── types/ # Shared interfaces and enums (User, Campaign, Offer, I_Item, etc.)
|
|
45
|
+
├── utils/ # Shared utility functions
|
|
46
|
+
└── api/ # configureApiDriver — HTTP client setup
|
|
47
|
+
dist/ # Compiled output (generated by npm run build)
|
|
13
48
|
```
|
|
14
49
|
|
|
15
|
-
|
|
50
|
+
---
|
|
16
51
|
|
|
17
|
-
|
|
52
|
+
## Getting Started
|
|
18
53
|
|
|
19
|
-
|
|
54
|
+
### Build and link
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm install
|
|
58
|
+
npm run build
|
|
20
59
|
npm link
|
|
21
60
|
```
|
|
22
61
|
|
|
23
|
-
|
|
62
|
+
### Link to a consumer project
|
|
24
63
|
|
|
25
|
-
```
|
|
64
|
+
```bash
|
|
65
|
+
# In any ad2app project (backend, frontend, mobile-v2, etc.)
|
|
26
66
|
npm link ad2app-lib
|
|
27
67
|
```
|
|
28
68
|
|
|
29
|
-
|
|
69
|
+
> **Note:** The backend runs `npm link ad2app-lib` automatically via `postinstall`. Other projects must run it manually.
|
|
70
|
+
|
|
71
|
+
---
|
|
30
72
|
|
|
31
|
-
|
|
73
|
+
## Usage
|
|
32
74
|
|
|
75
|
+
```typescript
|
|
76
|
+
import { UserRoles, I_Item } from 'ad2app-lib/types';
|
|
77
|
+
import { configureApiDriver } from 'ad2app-lib/api';
|
|
78
|
+
import { someUtil } from 'ad2app-lib/utils';
|
|
33
79
|
```
|
|
80
|
+
|
|
81
|
+
### Propagating changes
|
|
82
|
+
|
|
83
|
+
After editing source files, rebuild:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
34
86
|
npm run build
|
|
35
87
|
```
|
|
36
88
|
|
|
37
|
-
|
|
89
|
+
All linked projects pick up the changes immediately — no re-linking needed.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { SocialProvider } from "./I_SocialAccount";
|
|
2
|
+
export declare class I_TikTokUserStatisticsDTO {
|
|
3
|
+
follower_count: number;
|
|
4
|
+
following_count: number;
|
|
5
|
+
likes_count: number;
|
|
6
|
+
video_count: number;
|
|
7
|
+
is_verified: boolean;
|
|
8
|
+
constructor(data?: Partial<I_TikTokUserStatisticsDTO>);
|
|
9
|
+
}
|
|
10
|
+
export declare class I_TikTokVideoStatisticsDTO {
|
|
11
|
+
video_id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
share_url: string;
|
|
14
|
+
view_count: number;
|
|
15
|
+
like_count: number;
|
|
16
|
+
comment_count: number;
|
|
17
|
+
share_count: number;
|
|
18
|
+
create_time: number;
|
|
19
|
+
constructor(data?: Partial<I_TikTokVideoStatisticsDTO>);
|
|
20
|
+
}
|
|
21
|
+
export declare class I_TikTokStatisticsResponseDTO {
|
|
22
|
+
user: I_TikTokUserStatisticsDTO;
|
|
23
|
+
videos: I_TikTokVideoStatisticsDTO[];
|
|
24
|
+
fetched_at: Date;
|
|
25
|
+
constructor(data?: Partial<I_TikTokStatisticsResponseDTO>);
|
|
26
|
+
}
|
|
27
|
+
export declare class I_YouTubeChannelStatisticsDTO {
|
|
28
|
+
subscriber_count: number;
|
|
29
|
+
total_view_count: number;
|
|
30
|
+
video_count: number;
|
|
31
|
+
channel_title: string;
|
|
32
|
+
channel_url: string;
|
|
33
|
+
constructor(data?: Partial<I_YouTubeChannelStatisticsDTO>);
|
|
34
|
+
}
|
|
35
|
+
export declare class I_YouTubeStatisticsResponseDTO {
|
|
36
|
+
channel: I_YouTubeChannelStatisticsDTO;
|
|
37
|
+
fetched_at: Date;
|
|
38
|
+
constructor(data?: Partial<I_YouTubeStatisticsResponseDTO>);
|
|
39
|
+
}
|
|
40
|
+
export declare class I_InstagramUserStatisticsDTO {
|
|
41
|
+
username: string;
|
|
42
|
+
media_count: number;
|
|
43
|
+
account_type: string;
|
|
44
|
+
constructor(data?: Partial<I_InstagramUserStatisticsDTO>);
|
|
45
|
+
}
|
|
46
|
+
export declare class I_InstagramMediaStatisticsDTO {
|
|
47
|
+
media_id: string;
|
|
48
|
+
caption: string;
|
|
49
|
+
media_type: string;
|
|
50
|
+
permalink: string;
|
|
51
|
+
like_count: number;
|
|
52
|
+
comments_count: number;
|
|
53
|
+
timestamp: string;
|
|
54
|
+
constructor(data?: Partial<I_InstagramMediaStatisticsDTO>);
|
|
55
|
+
}
|
|
56
|
+
export declare class I_InstagramStatisticsResponseDTO {
|
|
57
|
+
user: I_InstagramUserStatisticsDTO;
|
|
58
|
+
media: I_InstagramMediaStatisticsDTO[];
|
|
59
|
+
fetched_at: Date;
|
|
60
|
+
constructor(data?: Partial<I_InstagramStatisticsResponseDTO>);
|
|
61
|
+
}
|
|
62
|
+
export declare class I_ConnectedPlatformsDTO {
|
|
63
|
+
platforms: SocialProvider[];
|
|
64
|
+
constructor(data?: Partial<I_ConnectedPlatformsDTO>);
|
|
65
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.I_ConnectedPlatformsDTO = exports.I_InstagramStatisticsResponseDTO = exports.I_InstagramMediaStatisticsDTO = exports.I_InstagramUserStatisticsDTO = exports.I_YouTubeStatisticsResponseDTO = exports.I_YouTubeChannelStatisticsDTO = exports.I_TikTokStatisticsResponseDTO = exports.I_TikTokVideoStatisticsDTO = exports.I_TikTokUserStatisticsDTO = void 0;
|
|
4
|
+
class I_TikTokUserStatisticsDTO {
|
|
5
|
+
constructor(data) {
|
|
6
|
+
this.follower_count = data?.follower_count ?? 0;
|
|
7
|
+
this.following_count = data?.following_count ?? 0;
|
|
8
|
+
this.likes_count = data?.likes_count ?? 0;
|
|
9
|
+
this.video_count = data?.video_count ?? 0;
|
|
10
|
+
this.is_verified = data?.is_verified ?? false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.I_TikTokUserStatisticsDTO = I_TikTokUserStatisticsDTO;
|
|
14
|
+
class I_TikTokVideoStatisticsDTO {
|
|
15
|
+
constructor(data) {
|
|
16
|
+
this.video_id = data?.video_id ?? "";
|
|
17
|
+
this.title = data?.title ?? "";
|
|
18
|
+
this.share_url = data?.share_url ?? "";
|
|
19
|
+
this.view_count = data?.view_count ?? 0;
|
|
20
|
+
this.like_count = data?.like_count ?? 0;
|
|
21
|
+
this.comment_count = data?.comment_count ?? 0;
|
|
22
|
+
this.share_count = data?.share_count ?? 0;
|
|
23
|
+
this.create_time = data?.create_time ?? 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.I_TikTokVideoStatisticsDTO = I_TikTokVideoStatisticsDTO;
|
|
27
|
+
class I_TikTokStatisticsResponseDTO {
|
|
28
|
+
constructor(data) {
|
|
29
|
+
this.user = data?.user ?? new I_TikTokUserStatisticsDTO();
|
|
30
|
+
this.videos = data?.videos ?? [];
|
|
31
|
+
this.fetched_at = data?.fetched_at ?? new Date();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.I_TikTokStatisticsResponseDTO = I_TikTokStatisticsResponseDTO;
|
|
35
|
+
class I_YouTubeChannelStatisticsDTO {
|
|
36
|
+
constructor(data) {
|
|
37
|
+
this.subscriber_count = data?.subscriber_count ?? 0;
|
|
38
|
+
this.total_view_count = data?.total_view_count ?? 0;
|
|
39
|
+
this.video_count = data?.video_count ?? 0;
|
|
40
|
+
this.channel_title = data?.channel_title ?? "";
|
|
41
|
+
this.channel_url = data?.channel_url ?? "";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.I_YouTubeChannelStatisticsDTO = I_YouTubeChannelStatisticsDTO;
|
|
45
|
+
class I_YouTubeStatisticsResponseDTO {
|
|
46
|
+
constructor(data) {
|
|
47
|
+
this.channel = data?.channel ?? new I_YouTubeChannelStatisticsDTO();
|
|
48
|
+
this.fetched_at = data?.fetched_at ?? new Date();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.I_YouTubeStatisticsResponseDTO = I_YouTubeStatisticsResponseDTO;
|
|
52
|
+
class I_InstagramUserStatisticsDTO {
|
|
53
|
+
constructor(data) {
|
|
54
|
+
this.username = data?.username ?? "";
|
|
55
|
+
this.media_count = data?.media_count ?? 0;
|
|
56
|
+
this.account_type = data?.account_type ?? "";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.I_InstagramUserStatisticsDTO = I_InstagramUserStatisticsDTO;
|
|
60
|
+
class I_InstagramMediaStatisticsDTO {
|
|
61
|
+
constructor(data) {
|
|
62
|
+
this.media_id = data?.media_id ?? "";
|
|
63
|
+
this.caption = data?.caption ?? "";
|
|
64
|
+
this.media_type = data?.media_type ?? "";
|
|
65
|
+
this.permalink = data?.permalink ?? "";
|
|
66
|
+
this.like_count = data?.like_count ?? 0;
|
|
67
|
+
this.comments_count = data?.comments_count ?? 0;
|
|
68
|
+
this.timestamp = data?.timestamp ?? "";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.I_InstagramMediaStatisticsDTO = I_InstagramMediaStatisticsDTO;
|
|
72
|
+
class I_InstagramStatisticsResponseDTO {
|
|
73
|
+
constructor(data) {
|
|
74
|
+
this.user = data?.user ?? new I_InstagramUserStatisticsDTO();
|
|
75
|
+
this.media = data?.media ?? [];
|
|
76
|
+
this.fetched_at = data?.fetched_at ?? new Date();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.I_InstagramStatisticsResponseDTO = I_InstagramStatisticsResponseDTO;
|
|
80
|
+
class I_ConnectedPlatformsDTO {
|
|
81
|
+
constructor(data) {
|
|
82
|
+
this.platforms = data?.platforms ?? [];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.I_ConnectedPlatformsDTO = I_ConnectedPlatformsDTO;
|
package/dist/types/I_User.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export declare class I_User {
|
|
|
3
3
|
id: string;
|
|
4
4
|
email?: string;
|
|
5
5
|
password?: string;
|
|
6
|
-
contact_email?: string;
|
|
7
6
|
first_name?: string;
|
|
8
7
|
last_name?: string;
|
|
9
8
|
display_name?: string;
|
|
@@ -22,7 +21,6 @@ export declare enum UserRoles {
|
|
|
22
21
|
export declare class I_UserCreateDTO {
|
|
23
22
|
password: string;
|
|
24
23
|
email: string;
|
|
25
|
-
contact_email: string;
|
|
26
24
|
first_name: string;
|
|
27
25
|
last_name: string;
|
|
28
26
|
display_name: string;
|
|
@@ -34,7 +32,6 @@ export declare class I_UserSignInDTO {
|
|
|
34
32
|
export declare class I_UserSignUpDTO {
|
|
35
33
|
email: string;
|
|
36
34
|
password: string;
|
|
37
|
-
contact_email: string;
|
|
38
35
|
first_name: string;
|
|
39
36
|
last_name: string;
|
|
40
37
|
display_name: string;
|
package/dist/types/I_User.js
CHANGED
|
@@ -34,10 +34,6 @@ __decorate([
|
|
|
34
34
|
(0, class_validator_1.IsNotEmpty)(),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
36
|
], I_UserCreateDTO.prototype, "email", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], I_UserCreateDTO.prototype, "contact_email", void 0);
|
|
41
37
|
__decorate([
|
|
42
38
|
(0, class_validator_1.IsNotEmpty)(),
|
|
43
39
|
__metadata("design:type", String)
|
|
@@ -72,10 +68,6 @@ __decorate([
|
|
|
72
68
|
(0, class_validator_1.IsNotEmpty)(),
|
|
73
69
|
__metadata("design:type", String)
|
|
74
70
|
], I_UserSignUpDTO.prototype, "password", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
77
|
-
__metadata("design:type", String)
|
|
78
|
-
], I_UserSignUpDTO.prototype, "contact_email", void 0);
|
|
79
71
|
__decorate([
|
|
80
72
|
(0, class_validator_1.IsNotEmpty)(),
|
|
81
73
|
__metadata("design:type", String)
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -49,3 +49,6 @@ __exportStar(require("./I_Media"), exports);
|
|
|
49
49
|
__exportStar(require("./I_SocialAccount"), exports);
|
|
50
50
|
__exportStar(require("./I_Collaboration"), exports);
|
|
51
51
|
__exportStar(require("./I_Publish"), exports);
|
|
52
|
+
__exportStar(require("./I_SM_Platform"), exports);
|
|
53
|
+
// ── Scheduling domain ─────────────────────────────────────────────────────────
|
|
54
|
+
__exportStar(require("./scheduling"), exports);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduling domain — Analytics DTOs
|
|
3
|
+
*
|
|
4
|
+
* Covers KPI summaries, daily engagement entries, best-time-to-post slots,
|
|
5
|
+
* per-post timeline snapshots, content decay windows, and follower stats.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Aggregated KPI figures for the selected date range.
|
|
9
|
+
* Returned by GET /social/analytics.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SchedulingAnalyticsKpiDTO {
|
|
12
|
+
impressions: number;
|
|
13
|
+
reach: number;
|
|
14
|
+
engagementRate: number;
|
|
15
|
+
followerGrowth: number;
|
|
16
|
+
constructor(data: SchedulingAnalyticsKpiDTO);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A single day/platform analytics row.
|
|
20
|
+
* Returned by GET /social/analytics/daily.
|
|
21
|
+
*/
|
|
22
|
+
export declare class SchedulingAnalyticsEntryDTO {
|
|
23
|
+
platform: string;
|
|
24
|
+
date: string;
|
|
25
|
+
impressions: number;
|
|
26
|
+
reach: number;
|
|
27
|
+
views: number;
|
|
28
|
+
likes: number;
|
|
29
|
+
comments: number;
|
|
30
|
+
shares: number;
|
|
31
|
+
saves: number;
|
|
32
|
+
clicks: number;
|
|
33
|
+
engagements: number;
|
|
34
|
+
constructor(data: SchedulingAnalyticsEntryDTO);
|
|
35
|
+
}
|
|
36
|
+
/** Query parameters shared by all analytics endpoints. */
|
|
37
|
+
export declare class SchedulingAnalyticsParamsDTO {
|
|
38
|
+
fromDate?: string;
|
|
39
|
+
toDate?: string;
|
|
40
|
+
platform?: string;
|
|
41
|
+
constructor(data: SchedulingAnalyticsParamsDTO);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A single day+hour slot with average engagement data.
|
|
45
|
+
* Returned by GET /social/analytics/best-time.
|
|
46
|
+
*/
|
|
47
|
+
export declare class SchedulingBestTimeSlotDTO {
|
|
48
|
+
/** 0 = Sunday … 6 = Saturday */
|
|
49
|
+
day: number;
|
|
50
|
+
/** 0 – 23 */
|
|
51
|
+
hour: number;
|
|
52
|
+
avgEngagements: number;
|
|
53
|
+
avgImpressions: number;
|
|
54
|
+
constructor(data: SchedulingBestTimeSlotDTO);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* One snapshot in a per-post timeline series.
|
|
58
|
+
* Returned by GET /social/analytics/post-timeline.
|
|
59
|
+
*/
|
|
60
|
+
export declare class SchedulingPostTimelineEntryDTO {
|
|
61
|
+
date: string;
|
|
62
|
+
platform: string;
|
|
63
|
+
impressions: number;
|
|
64
|
+
likes: number;
|
|
65
|
+
comments: number;
|
|
66
|
+
shares: number;
|
|
67
|
+
saves: number;
|
|
68
|
+
clicks: number;
|
|
69
|
+
constructor(data: SchedulingPostTimelineEntryDTO);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Engagement decay percentage at a specific time window after publishing.
|
|
73
|
+
* Returned by GET /social/analytics/content-decay.
|
|
74
|
+
*/
|
|
75
|
+
export declare class SchedulingContentDecayDTO {
|
|
76
|
+
window: '1h' | '6h' | '24h' | '7d';
|
|
77
|
+
platform: string;
|
|
78
|
+
/** Percentage of peak engagement remaining at this window */
|
|
79
|
+
pct: number;
|
|
80
|
+
constructor(data: SchedulingContentDecayDTO);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Follower count and growth for one platform on one date.
|
|
84
|
+
* Returned by GET /social/analytics/follower-stats.
|
|
85
|
+
*/
|
|
86
|
+
export declare class SchedulingFollowerStatDTO {
|
|
87
|
+
platform: string;
|
|
88
|
+
date: string;
|
|
89
|
+
followers: number;
|
|
90
|
+
followersGrowth: number;
|
|
91
|
+
constructor(data: SchedulingFollowerStatDTO);
|
|
92
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Scheduling domain — Analytics DTOs
|
|
4
|
+
*
|
|
5
|
+
* Covers KPI summaries, daily engagement entries, best-time-to-post slots,
|
|
6
|
+
* per-post timeline snapshots, content decay windows, and follower stats.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SchedulingFollowerStatDTO = exports.SchedulingContentDecayDTO = exports.SchedulingPostTimelineEntryDTO = exports.SchedulingBestTimeSlotDTO = exports.SchedulingAnalyticsParamsDTO = exports.SchedulingAnalyticsEntryDTO = exports.SchedulingAnalyticsKpiDTO = void 0;
|
|
10
|
+
// ── SchedulingAnalyticsKpiDTO ─────────────────────────────────────────────────
|
|
11
|
+
/**
|
|
12
|
+
* Aggregated KPI figures for the selected date range.
|
|
13
|
+
* Returned by GET /social/analytics.
|
|
14
|
+
*/
|
|
15
|
+
class SchedulingAnalyticsKpiDTO {
|
|
16
|
+
constructor(data) {
|
|
17
|
+
this.impressions = data.impressions;
|
|
18
|
+
this.reach = data.reach;
|
|
19
|
+
this.engagementRate = data.engagementRate;
|
|
20
|
+
this.followerGrowth = data.followerGrowth;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.SchedulingAnalyticsKpiDTO = SchedulingAnalyticsKpiDTO;
|
|
24
|
+
// ── SchedulingAnalyticsEntryDTO ───────────────────────────────────────────────
|
|
25
|
+
/**
|
|
26
|
+
* A single day/platform analytics row.
|
|
27
|
+
* Returned by GET /social/analytics/daily.
|
|
28
|
+
*/
|
|
29
|
+
class SchedulingAnalyticsEntryDTO {
|
|
30
|
+
constructor(data) {
|
|
31
|
+
this.platform = data.platform;
|
|
32
|
+
this.date = data.date;
|
|
33
|
+
this.impressions = data.impressions;
|
|
34
|
+
this.reach = data.reach;
|
|
35
|
+
this.views = data.views;
|
|
36
|
+
this.likes = data.likes;
|
|
37
|
+
this.comments = data.comments;
|
|
38
|
+
this.shares = data.shares;
|
|
39
|
+
this.saves = data.saves;
|
|
40
|
+
this.clicks = data.clicks;
|
|
41
|
+
this.engagements = data.engagements;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.SchedulingAnalyticsEntryDTO = SchedulingAnalyticsEntryDTO;
|
|
45
|
+
// ── SchedulingAnalyticsParamsDTO ──────────────────────────────────────────────
|
|
46
|
+
/** Query parameters shared by all analytics endpoints. */
|
|
47
|
+
class SchedulingAnalyticsParamsDTO {
|
|
48
|
+
constructor(data) {
|
|
49
|
+
this.fromDate = data.fromDate;
|
|
50
|
+
this.toDate = data.toDate;
|
|
51
|
+
this.platform = data.platform;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.SchedulingAnalyticsParamsDTO = SchedulingAnalyticsParamsDTO;
|
|
55
|
+
// ── SchedulingBestTimeSlotDTO ─────────────────────────────────────────────────
|
|
56
|
+
/**
|
|
57
|
+
* A single day+hour slot with average engagement data.
|
|
58
|
+
* Returned by GET /social/analytics/best-time.
|
|
59
|
+
*/
|
|
60
|
+
class SchedulingBestTimeSlotDTO {
|
|
61
|
+
constructor(data) {
|
|
62
|
+
this.day = data.day;
|
|
63
|
+
this.hour = data.hour;
|
|
64
|
+
this.avgEngagements = data.avgEngagements;
|
|
65
|
+
this.avgImpressions = data.avgImpressions;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.SchedulingBestTimeSlotDTO = SchedulingBestTimeSlotDTO;
|
|
69
|
+
// ── SchedulingPostTimelineEntryDTO ────────────────────────────────────────────
|
|
70
|
+
/**
|
|
71
|
+
* One snapshot in a per-post timeline series.
|
|
72
|
+
* Returned by GET /social/analytics/post-timeline.
|
|
73
|
+
*/
|
|
74
|
+
class SchedulingPostTimelineEntryDTO {
|
|
75
|
+
constructor(data) {
|
|
76
|
+
this.date = data.date;
|
|
77
|
+
this.platform = data.platform;
|
|
78
|
+
this.impressions = data.impressions;
|
|
79
|
+
this.likes = data.likes;
|
|
80
|
+
this.comments = data.comments;
|
|
81
|
+
this.shares = data.shares;
|
|
82
|
+
this.saves = data.saves;
|
|
83
|
+
this.clicks = data.clicks;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.SchedulingPostTimelineEntryDTO = SchedulingPostTimelineEntryDTO;
|
|
87
|
+
// ── SchedulingContentDecayDTO ─────────────────────────────────────────────────
|
|
88
|
+
/**
|
|
89
|
+
* Engagement decay percentage at a specific time window after publishing.
|
|
90
|
+
* Returned by GET /social/analytics/content-decay.
|
|
91
|
+
*/
|
|
92
|
+
class SchedulingContentDecayDTO {
|
|
93
|
+
constructor(data) {
|
|
94
|
+
this.window = data.window;
|
|
95
|
+
this.platform = data.platform;
|
|
96
|
+
this.pct = data.pct;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.SchedulingContentDecayDTO = SchedulingContentDecayDTO;
|
|
100
|
+
// ── SchedulingFollowerStatDTO ─────────────────────────────────────────────────
|
|
101
|
+
/**
|
|
102
|
+
* Follower count and growth for one platform on one date.
|
|
103
|
+
* Returned by GET /social/analytics/follower-stats.
|
|
104
|
+
*/
|
|
105
|
+
class SchedulingFollowerStatDTO {
|
|
106
|
+
constructor(data) {
|
|
107
|
+
this.platform = data.platform;
|
|
108
|
+
this.date = data.date;
|
|
109
|
+
this.followers = data.followers;
|
|
110
|
+
this.followersGrowth = data.followersGrowth;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.SchedulingFollowerStatDTO = SchedulingFollowerStatDTO;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduling domain — Connected Account DTOs
|
|
3
|
+
*
|
|
4
|
+
* Represents a social-media account that a user has connected via OAuth
|
|
5
|
+
* through the Late API integration layer.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Response DTO for a single connected social account.
|
|
9
|
+
* Returned in list form by GET /social/accounts.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SchedulingConnectedAccountDTO {
|
|
12
|
+
/** Internal (Late) account identifier */
|
|
13
|
+
id: string;
|
|
14
|
+
platform: string;
|
|
15
|
+
username: string;
|
|
16
|
+
display_name?: string;
|
|
17
|
+
avatar_url?: string;
|
|
18
|
+
constructor(data: SchedulingConnectedAccountDTO);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Response DTO returned after initiating an OAuth account connection.
|
|
22
|
+
* The client should redirect the user to the returned URL.
|
|
23
|
+
*/
|
|
24
|
+
export declare class SchedulingConnectAccountResultDTO {
|
|
25
|
+
/** OAuth redirect URL the client must navigate to */
|
|
26
|
+
url: string;
|
|
27
|
+
platform: string;
|
|
28
|
+
constructor(data: SchedulingConnectAccountResultDTO);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A Pinterest board that the connected account has access to.
|
|
32
|
+
* Returned by GET /social/accounts/pinterest-boards.
|
|
33
|
+
*/
|
|
34
|
+
export declare class SchedulingPinterestBoardDTO {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
constructor(data: SchedulingPinterestBoardDTO);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Latest follower count for a single platform.
|
|
41
|
+
* Returned by GET /social/accounts/follower-stats.
|
|
42
|
+
*/
|
|
43
|
+
export declare class SchedulingAccountFollowerStatDTO {
|
|
44
|
+
platform: string;
|
|
45
|
+
followers: number;
|
|
46
|
+
date: string;
|
|
47
|
+
constructor(data: SchedulingAccountFollowerStatDTO);
|
|
48
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Scheduling domain — Connected Account DTOs
|
|
4
|
+
*
|
|
5
|
+
* Represents a social-media account that a user has connected via OAuth
|
|
6
|
+
* through the Late API integration layer.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SchedulingAccountFollowerStatDTO = exports.SchedulingPinterestBoardDTO = exports.SchedulingConnectAccountResultDTO = exports.SchedulingConnectedAccountDTO = void 0;
|
|
10
|
+
// ── SchedulingConnectedAccountDTO ────────────────────────────────────────────
|
|
11
|
+
/**
|
|
12
|
+
* Response DTO for a single connected social account.
|
|
13
|
+
* Returned in list form by GET /social/accounts.
|
|
14
|
+
*/
|
|
15
|
+
class SchedulingConnectedAccountDTO {
|
|
16
|
+
constructor(data) {
|
|
17
|
+
this.id = data.id;
|
|
18
|
+
this.platform = data.platform;
|
|
19
|
+
this.username = data.username;
|
|
20
|
+
this.display_name = data.display_name;
|
|
21
|
+
this.avatar_url = data.avatar_url;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.SchedulingConnectedAccountDTO = SchedulingConnectedAccountDTO;
|
|
25
|
+
// ── SchedulingConnectAccountResultDTO ────────────────────────────────────────
|
|
26
|
+
/**
|
|
27
|
+
* Response DTO returned after initiating an OAuth account connection.
|
|
28
|
+
* The client should redirect the user to the returned URL.
|
|
29
|
+
*/
|
|
30
|
+
class SchedulingConnectAccountResultDTO {
|
|
31
|
+
constructor(data) {
|
|
32
|
+
this.url = data.url;
|
|
33
|
+
this.platform = data.platform;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.SchedulingConnectAccountResultDTO = SchedulingConnectAccountResultDTO;
|
|
37
|
+
// ── SchedulingPinterestBoardDTO ───────────────────────────────────────────────
|
|
38
|
+
/**
|
|
39
|
+
* A Pinterest board that the connected account has access to.
|
|
40
|
+
* Returned by GET /social/accounts/pinterest-boards.
|
|
41
|
+
*/
|
|
42
|
+
class SchedulingPinterestBoardDTO {
|
|
43
|
+
constructor(data) {
|
|
44
|
+
this.id = data.id;
|
|
45
|
+
this.name = data.name;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.SchedulingPinterestBoardDTO = SchedulingPinterestBoardDTO;
|
|
49
|
+
// ── SchedulingAccountFollowerStatDTO ─────────────────────────────────────────
|
|
50
|
+
/**
|
|
51
|
+
* Latest follower count for a single platform.
|
|
52
|
+
* Returned by GET /social/accounts/follower-stats.
|
|
53
|
+
*/
|
|
54
|
+
class SchedulingAccountFollowerStatDTO {
|
|
55
|
+
constructor(data) {
|
|
56
|
+
this.platform = data.platform;
|
|
57
|
+
this.followers = data.followers;
|
|
58
|
+
this.date = data.date;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.SchedulingAccountFollowerStatDTO = SchedulingAccountFollowerStatDTO;
|