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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduling domain — Inbox DTOs
|
|
3
|
+
*
|
|
4
|
+
* Covers direct-message conversations and post comments received through
|
|
5
|
+
* the connected social accounts.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* A DM conversation (thread) entry.
|
|
9
|
+
* Returned by GET /social/inbox/messages.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SchedulingInboxConversationDTO {
|
|
12
|
+
id: string;
|
|
13
|
+
platform: string;
|
|
14
|
+
accountId: string;
|
|
15
|
+
senderId: string;
|
|
16
|
+
senderName: string;
|
|
17
|
+
senderAvatarUrl?: string;
|
|
18
|
+
snippet: string;
|
|
19
|
+
receivedAt: string;
|
|
20
|
+
isUnread: boolean;
|
|
21
|
+
constructor(data: SchedulingInboxConversationDTO);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A published post that has comments attached.
|
|
25
|
+
* Returned by GET /social/inbox/comments.
|
|
26
|
+
*/
|
|
27
|
+
export declare class SchedulingInboxPostWithCommentsDTO {
|
|
28
|
+
postId: string;
|
|
29
|
+
platform: string;
|
|
30
|
+
accountId: string;
|
|
31
|
+
contentSnippet: string;
|
|
32
|
+
publishedAt: string;
|
|
33
|
+
commentCount: number;
|
|
34
|
+
thumbnailUrl?: string;
|
|
35
|
+
constructor(data: SchedulingInboxPostWithCommentsDTO);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A single comment (or nested reply) on a post.
|
|
39
|
+
* Returned by GET /social/inbox/comments/:postId/thread.
|
|
40
|
+
*/
|
|
41
|
+
export declare class SchedulingInboxCommentDTO {
|
|
42
|
+
id: string;
|
|
43
|
+
authorName: string;
|
|
44
|
+
authorAvatarUrl?: string;
|
|
45
|
+
text: string;
|
|
46
|
+
createdAt: string;
|
|
47
|
+
replies?: SchedulingInboxCommentDTO[];
|
|
48
|
+
constructor(data: SchedulingInboxCommentDTO);
|
|
49
|
+
}
|
|
50
|
+
/** Input DTO for sending a DM reply. */
|
|
51
|
+
export declare class SchedulingSendMessageDTO {
|
|
52
|
+
accountId: string;
|
|
53
|
+
conversationId: string;
|
|
54
|
+
text: string;
|
|
55
|
+
constructor(data: SchedulingSendMessageDTO);
|
|
56
|
+
}
|
|
57
|
+
/** Input DTO for replying to a comment. */
|
|
58
|
+
export declare class SchedulingReplyToCommentDTO {
|
|
59
|
+
postId: string;
|
|
60
|
+
accountId: string;
|
|
61
|
+
text: string;
|
|
62
|
+
commentId?: string;
|
|
63
|
+
constructor(data: SchedulingReplyToCommentDTO);
|
|
64
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Scheduling domain — Inbox DTOs
|
|
4
|
+
*
|
|
5
|
+
* Covers direct-message conversations and post comments received through
|
|
6
|
+
* the connected social accounts.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SchedulingReplyToCommentDTO = exports.SchedulingSendMessageDTO = exports.SchedulingInboxCommentDTO = exports.SchedulingInboxPostWithCommentsDTO = exports.SchedulingInboxConversationDTO = void 0;
|
|
10
|
+
// ── SchedulingInboxConversationDTO ────────────────────────────────────────────
|
|
11
|
+
/**
|
|
12
|
+
* A DM conversation (thread) entry.
|
|
13
|
+
* Returned by GET /social/inbox/messages.
|
|
14
|
+
*/
|
|
15
|
+
class SchedulingInboxConversationDTO {
|
|
16
|
+
constructor(data) {
|
|
17
|
+
this.id = data.id;
|
|
18
|
+
this.platform = data.platform;
|
|
19
|
+
this.accountId = data.accountId;
|
|
20
|
+
this.senderId = data.senderId;
|
|
21
|
+
this.senderName = data.senderName;
|
|
22
|
+
this.senderAvatarUrl = data.senderAvatarUrl;
|
|
23
|
+
this.snippet = data.snippet;
|
|
24
|
+
this.receivedAt = data.receivedAt;
|
|
25
|
+
this.isUnread = data.isUnread;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.SchedulingInboxConversationDTO = SchedulingInboxConversationDTO;
|
|
29
|
+
// ── SchedulingInboxPostWithCommentsDTO ────────────────────────────────────────
|
|
30
|
+
/**
|
|
31
|
+
* A published post that has comments attached.
|
|
32
|
+
* Returned by GET /social/inbox/comments.
|
|
33
|
+
*/
|
|
34
|
+
class SchedulingInboxPostWithCommentsDTO {
|
|
35
|
+
constructor(data) {
|
|
36
|
+
this.postId = data.postId;
|
|
37
|
+
this.platform = data.platform;
|
|
38
|
+
this.accountId = data.accountId;
|
|
39
|
+
this.contentSnippet = data.contentSnippet;
|
|
40
|
+
this.publishedAt = data.publishedAt;
|
|
41
|
+
this.commentCount = data.commentCount;
|
|
42
|
+
this.thumbnailUrl = data.thumbnailUrl;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.SchedulingInboxPostWithCommentsDTO = SchedulingInboxPostWithCommentsDTO;
|
|
46
|
+
// ── SchedulingInboxCommentDTO ─────────────────────────────────────────────────
|
|
47
|
+
/**
|
|
48
|
+
* A single comment (or nested reply) on a post.
|
|
49
|
+
* Returned by GET /social/inbox/comments/:postId/thread.
|
|
50
|
+
*/
|
|
51
|
+
class SchedulingInboxCommentDTO {
|
|
52
|
+
constructor(data) {
|
|
53
|
+
this.id = data.id;
|
|
54
|
+
this.authorName = data.authorName;
|
|
55
|
+
this.authorAvatarUrl = data.authorAvatarUrl;
|
|
56
|
+
this.text = data.text;
|
|
57
|
+
this.createdAt = data.createdAt;
|
|
58
|
+
this.replies = data.replies;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.SchedulingInboxCommentDTO = SchedulingInboxCommentDTO;
|
|
62
|
+
// ── SchedulingSendMessageDTO ──────────────────────────────────────────────────
|
|
63
|
+
/** Input DTO for sending a DM reply. */
|
|
64
|
+
class SchedulingSendMessageDTO {
|
|
65
|
+
constructor(data) {
|
|
66
|
+
this.accountId = data.accountId;
|
|
67
|
+
this.conversationId = data.conversationId;
|
|
68
|
+
this.text = data.text;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.SchedulingSendMessageDTO = SchedulingSendMessageDTO;
|
|
72
|
+
// ── SchedulingReplyToCommentDTO ───────────────────────────────────────────────
|
|
73
|
+
/** Input DTO for replying to a comment. */
|
|
74
|
+
class SchedulingReplyToCommentDTO {
|
|
75
|
+
constructor(data) {
|
|
76
|
+
this.postId = data.postId;
|
|
77
|
+
this.accountId = data.accountId;
|
|
78
|
+
this.text = data.text;
|
|
79
|
+
this.commentId = data.commentId;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.SchedulingReplyToCommentDTO = SchedulingReplyToCommentDTO;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduling domain — Post / Content DTOs
|
|
3
|
+
*
|
|
4
|
+
* Covers content creation, scheduling metadata, per-platform status,
|
|
5
|
+
* and the media items attached to a post.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum SchedulingPostStatus {
|
|
8
|
+
DRAFT = "draft",
|
|
9
|
+
SCHEDULED = "scheduled",
|
|
10
|
+
PUBLISHED = "published",
|
|
11
|
+
FAILED = "failed",
|
|
12
|
+
PARTIAL = "partial"
|
|
13
|
+
}
|
|
14
|
+
export type SchedulingPlatformStatusMap = Record<string, 'scheduled' | 'published' | 'failed'>;
|
|
15
|
+
export declare class SchedulingPlatformTargetDTO {
|
|
16
|
+
platform: string;
|
|
17
|
+
accountId: string;
|
|
18
|
+
constructor(data?: Partial<SchedulingPlatformTargetDTO>);
|
|
19
|
+
}
|
|
20
|
+
export declare class SchedulingMediaItemDTO {
|
|
21
|
+
type: 'image' | 'video';
|
|
22
|
+
url: string;
|
|
23
|
+
constructor(data?: Partial<SchedulingMediaItemDTO>);
|
|
24
|
+
}
|
|
25
|
+
/** Input DTO for creating a new scheduled or immediate post. */
|
|
26
|
+
export declare class SchedulingCreatePostDTO {
|
|
27
|
+
content: string;
|
|
28
|
+
platforms: SchedulingPlatformTargetDTO[];
|
|
29
|
+
scheduledAt?: string;
|
|
30
|
+
publishNow?: boolean;
|
|
31
|
+
mediaItems?: SchedulingMediaItemDTO[];
|
|
32
|
+
platformSpecificData?: Record<string, Record<string, unknown>>;
|
|
33
|
+
tiktokSettings?: Record<string, unknown>;
|
|
34
|
+
constructor(data?: Partial<SchedulingCreatePostDTO>);
|
|
35
|
+
}
|
|
36
|
+
/** Input DTO for updating an existing post's content or scheduled time. */
|
|
37
|
+
export declare class SchedulingUpdatePostDTO {
|
|
38
|
+
content?: string;
|
|
39
|
+
scheduledAt?: string;
|
|
40
|
+
constructor(data?: Partial<SchedulingUpdatePostDTO>);
|
|
41
|
+
}
|
|
42
|
+
/** Response DTO representing a single post returned from the API. */
|
|
43
|
+
export declare class SchedulingPostDTO {
|
|
44
|
+
id: string;
|
|
45
|
+
latePostId?: string;
|
|
46
|
+
platforms: string[];
|
|
47
|
+
platformStatuses: SchedulingPlatformStatusMap;
|
|
48
|
+
/** Per-platform URLs to the published post (e.g. { instagram: 'https://...' }). */
|
|
49
|
+
postUrls?: Record<string, string>;
|
|
50
|
+
/** Per-platform error messages for platforms that failed to publish. */
|
|
51
|
+
platformErrors?: Record<string, string>;
|
|
52
|
+
scheduledAt?: string;
|
|
53
|
+
publishedAt?: string;
|
|
54
|
+
status: SchedulingPostStatus;
|
|
55
|
+
contentSnippet?: string;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
updatedAt: string;
|
|
58
|
+
constructor(data: SchedulingPostDTO);
|
|
59
|
+
}
|
|
60
|
+
/** Query parameters for listing posts with optional filters. */
|
|
61
|
+
export declare class SchedulingPostListParamsDTO {
|
|
62
|
+
fromDate?: string;
|
|
63
|
+
toDate?: string;
|
|
64
|
+
status?: string;
|
|
65
|
+
limit?: number;
|
|
66
|
+
offset?: number;
|
|
67
|
+
constructor(data: SchedulingPostListParamsDTO);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Response DTO for the content calendar view.
|
|
71
|
+
* Groups posts by ISO date string for visual rendering.
|
|
72
|
+
*/
|
|
73
|
+
export declare class SchedulingContentCalendarDTO {
|
|
74
|
+
/** ISO date → posts scheduled on that date */
|
|
75
|
+
postsByDate: Record<string, SchedulingPostDTO[]>;
|
|
76
|
+
/** ISO range covered by the calendar view */
|
|
77
|
+
fromDate: string;
|
|
78
|
+
toDate: string;
|
|
79
|
+
constructor(data: SchedulingContentCalendarDTO);
|
|
80
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Scheduling domain — Post / Content DTOs
|
|
4
|
+
*
|
|
5
|
+
* Covers content creation, scheduling metadata, per-platform status,
|
|
6
|
+
* and the media items attached to a post.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SchedulingContentCalendarDTO = exports.SchedulingPostListParamsDTO = exports.SchedulingPostDTO = exports.SchedulingUpdatePostDTO = exports.SchedulingCreatePostDTO = exports.SchedulingMediaItemDTO = exports.SchedulingPlatformTargetDTO = exports.SchedulingPostStatus = void 0;
|
|
10
|
+
// ── Enums ─────────────────────────────────────────────────────────────────────
|
|
11
|
+
var SchedulingPostStatus;
|
|
12
|
+
(function (SchedulingPostStatus) {
|
|
13
|
+
SchedulingPostStatus["DRAFT"] = "draft";
|
|
14
|
+
SchedulingPostStatus["SCHEDULED"] = "scheduled";
|
|
15
|
+
SchedulingPostStatus["PUBLISHED"] = "published";
|
|
16
|
+
SchedulingPostStatus["FAILED"] = "failed";
|
|
17
|
+
SchedulingPostStatus["PARTIAL"] = "partial";
|
|
18
|
+
})(SchedulingPostStatus || (exports.SchedulingPostStatus = SchedulingPostStatus = {}));
|
|
19
|
+
// ── SchedulingPlatformTargetDTO ───────────────────────────────────────────────
|
|
20
|
+
class SchedulingPlatformTargetDTO {
|
|
21
|
+
constructor(data) {
|
|
22
|
+
if (!data)
|
|
23
|
+
return;
|
|
24
|
+
this.platform = data.platform;
|
|
25
|
+
this.accountId = data.accountId;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.SchedulingPlatformTargetDTO = SchedulingPlatformTargetDTO;
|
|
29
|
+
// ── SchedulingMediaItemDTO ────────────────────────────────────────────────────
|
|
30
|
+
class SchedulingMediaItemDTO {
|
|
31
|
+
constructor(data) {
|
|
32
|
+
if (!data)
|
|
33
|
+
return;
|
|
34
|
+
this.type = data.type;
|
|
35
|
+
this.url = data.url;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.SchedulingMediaItemDTO = SchedulingMediaItemDTO;
|
|
39
|
+
// ── SchedulingCreatePostDTO ───────────────────────────────────────────────────
|
|
40
|
+
/** Input DTO for creating a new scheduled or immediate post. */
|
|
41
|
+
class SchedulingCreatePostDTO {
|
|
42
|
+
constructor(data) {
|
|
43
|
+
if (!data)
|
|
44
|
+
return;
|
|
45
|
+
this.content = data.content;
|
|
46
|
+
this.platforms = data.platforms;
|
|
47
|
+
this.scheduledAt = data.scheduledAt;
|
|
48
|
+
this.publishNow = data.publishNow;
|
|
49
|
+
this.mediaItems = data.mediaItems;
|
|
50
|
+
this.platformSpecificData = data.platformSpecificData;
|
|
51
|
+
this.tiktokSettings = data.tiktokSettings;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.SchedulingCreatePostDTO = SchedulingCreatePostDTO;
|
|
55
|
+
// ── SchedulingUpdatePostDTO ───────────────────────────────────────────────────
|
|
56
|
+
/** Input DTO for updating an existing post's content or scheduled time. */
|
|
57
|
+
class SchedulingUpdatePostDTO {
|
|
58
|
+
constructor(data) {
|
|
59
|
+
if (!data)
|
|
60
|
+
return;
|
|
61
|
+
this.content = data.content;
|
|
62
|
+
this.scheduledAt = data.scheduledAt;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.SchedulingUpdatePostDTO = SchedulingUpdatePostDTO;
|
|
66
|
+
// ── SchedulingPostDTO ─────────────────────────────────────────────────────────
|
|
67
|
+
/** Response DTO representing a single post returned from the API. */
|
|
68
|
+
class SchedulingPostDTO {
|
|
69
|
+
constructor(data) {
|
|
70
|
+
this.id = data.id;
|
|
71
|
+
this.latePostId = data.latePostId;
|
|
72
|
+
this.platforms = data.platforms;
|
|
73
|
+
this.platformStatuses = data.platformStatuses;
|
|
74
|
+
this.postUrls = data.postUrls;
|
|
75
|
+
this.platformErrors = data.platformErrors;
|
|
76
|
+
this.scheduledAt = data.scheduledAt;
|
|
77
|
+
this.publishedAt = data.publishedAt;
|
|
78
|
+
this.status = data.status;
|
|
79
|
+
this.contentSnippet = data.contentSnippet;
|
|
80
|
+
this.createdAt = data.createdAt;
|
|
81
|
+
this.updatedAt = data.updatedAt;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.SchedulingPostDTO = SchedulingPostDTO;
|
|
85
|
+
// ── SchedulingPostListParamsDTO ───────────────────────────────────────────────
|
|
86
|
+
/** Query parameters for listing posts with optional filters. */
|
|
87
|
+
class SchedulingPostListParamsDTO {
|
|
88
|
+
constructor(data) {
|
|
89
|
+
this.fromDate = data.fromDate;
|
|
90
|
+
this.toDate = data.toDate;
|
|
91
|
+
this.status = data.status;
|
|
92
|
+
this.limit = data.limit;
|
|
93
|
+
this.offset = data.offset;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.SchedulingPostListParamsDTO = SchedulingPostListParamsDTO;
|
|
97
|
+
// ── SchedulingContentCalendarDTO ─────────────────────────────────────────────
|
|
98
|
+
/**
|
|
99
|
+
* Response DTO for the content calendar view.
|
|
100
|
+
* Groups posts by ISO date string for visual rendering.
|
|
101
|
+
*/
|
|
102
|
+
class SchedulingContentCalendarDTO {
|
|
103
|
+
constructor(data) {
|
|
104
|
+
this.postsByDate = data.postsByDate;
|
|
105
|
+
this.fromDate = data.fromDate;
|
|
106
|
+
this.toDate = data.toDate;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.SchedulingContentCalendarDTO = SchedulingContentCalendarDTO;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduling domain — Pro Upgrade / Subscription DTOs
|
|
3
|
+
*
|
|
4
|
+
* Covers subscription tier state, Stripe checkout flows,
|
|
5
|
+
* and the customer portal redirect.
|
|
6
|
+
*/
|
|
7
|
+
export type SchedulingSubscriptionTier = 'free' | 'pro';
|
|
8
|
+
export type SchedulingSubscriptionStatus = 'active' | 'canceled' | 'expired';
|
|
9
|
+
/**
|
|
10
|
+
* Current subscription state for the authenticated user.
|
|
11
|
+
* Returned by GET /social/subscription.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SchedulingSubscriptionInfoDTO {
|
|
14
|
+
tier: SchedulingSubscriptionTier;
|
|
15
|
+
status: SchedulingSubscriptionStatus;
|
|
16
|
+
expiresAt: string | null;
|
|
17
|
+
constructor(data: SchedulingSubscriptionInfoDTO);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Response DTO for POST /social/subscription/checkout.
|
|
21
|
+
* The client should redirect to the returned URL to complete payment.
|
|
22
|
+
*/
|
|
23
|
+
export declare class SchedulingCheckoutSessionResultDTO {
|
|
24
|
+
url: string;
|
|
25
|
+
constructor(data: SchedulingCheckoutSessionResultDTO);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Response DTO for POST /social/subscription/portal.
|
|
29
|
+
* The client should redirect to the returned URL to manage billing.
|
|
30
|
+
*/
|
|
31
|
+
export declare class SchedulingPortalSessionResultDTO {
|
|
32
|
+
url: string;
|
|
33
|
+
constructor(data: SchedulingPortalSessionResultDTO);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Aggregated Pro-upgrade context DTO.
|
|
37
|
+
* Combines subscription info with action URLs for UI display.
|
|
38
|
+
*/
|
|
39
|
+
export declare class SchedulingProUpgradeDTO {
|
|
40
|
+
subscriptionInfo: SchedulingSubscriptionInfoDTO;
|
|
41
|
+
checkoutUrl?: string;
|
|
42
|
+
portalUrl?: string;
|
|
43
|
+
constructor(data: SchedulingProUpgradeDTO);
|
|
44
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Scheduling domain — Pro Upgrade / Subscription DTOs
|
|
4
|
+
*
|
|
5
|
+
* Covers subscription tier state, Stripe checkout flows,
|
|
6
|
+
* and the customer portal redirect.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SchedulingProUpgradeDTO = exports.SchedulingPortalSessionResultDTO = exports.SchedulingCheckoutSessionResultDTO = exports.SchedulingSubscriptionInfoDTO = void 0;
|
|
10
|
+
// ── SchedulingSubscriptionInfoDTO ────────────────────────────────────────────
|
|
11
|
+
/**
|
|
12
|
+
* Current subscription state for the authenticated user.
|
|
13
|
+
* Returned by GET /social/subscription.
|
|
14
|
+
*/
|
|
15
|
+
class SchedulingSubscriptionInfoDTO {
|
|
16
|
+
constructor(data) {
|
|
17
|
+
this.tier = data.tier;
|
|
18
|
+
this.status = data.status;
|
|
19
|
+
this.expiresAt = data.expiresAt;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.SchedulingSubscriptionInfoDTO = SchedulingSubscriptionInfoDTO;
|
|
23
|
+
// ── SchedulingCheckoutSessionResultDTO ───────────────────────────────────────
|
|
24
|
+
/**
|
|
25
|
+
* Response DTO for POST /social/subscription/checkout.
|
|
26
|
+
* The client should redirect to the returned URL to complete payment.
|
|
27
|
+
*/
|
|
28
|
+
class SchedulingCheckoutSessionResultDTO {
|
|
29
|
+
constructor(data) {
|
|
30
|
+
this.url = data.url;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.SchedulingCheckoutSessionResultDTO = SchedulingCheckoutSessionResultDTO;
|
|
34
|
+
// ── SchedulingPortalSessionResultDTO ─────────────────────────────────────────
|
|
35
|
+
/**
|
|
36
|
+
* Response DTO for POST /social/subscription/portal.
|
|
37
|
+
* The client should redirect to the returned URL to manage billing.
|
|
38
|
+
*/
|
|
39
|
+
class SchedulingPortalSessionResultDTO {
|
|
40
|
+
constructor(data) {
|
|
41
|
+
this.url = data.url;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.SchedulingPortalSessionResultDTO = SchedulingPortalSessionResultDTO;
|
|
45
|
+
// ── SchedulingProUpgradeDTO ───────────────────────────────────────────────────
|
|
46
|
+
/**
|
|
47
|
+
* Aggregated Pro-upgrade context DTO.
|
|
48
|
+
* Combines subscription info with action URLs for UI display.
|
|
49
|
+
*/
|
|
50
|
+
class SchedulingProUpgradeDTO {
|
|
51
|
+
constructor(data) {
|
|
52
|
+
this.subscriptionInfo = data.subscriptionInfo;
|
|
53
|
+
this.checkoutUrl = data.checkoutUrl;
|
|
54
|
+
this.portalUrl = data.portalUrl;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.SchedulingProUpgradeDTO = SchedulingProUpgradeDTO;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduling domain — barrel export
|
|
3
|
+
*
|
|
4
|
+
* All scheduling DTOs are available from 'ad2app-lib/types' via:
|
|
5
|
+
* import { SchedulingPostDTO, SchedulingAnalyticsKpiDTO, ... } from 'ad2app-lib/types';
|
|
6
|
+
*/
|
|
7
|
+
export * from './I_SchedulingPost';
|
|
8
|
+
export * from './I_SchedulingAnalytics';
|
|
9
|
+
export * from './I_SchedulingConnectedAccount';
|
|
10
|
+
export * from './I_SchedulingInbox';
|
|
11
|
+
export * from './I_SchedulingProUpgrade';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Scheduling domain — barrel export
|
|
4
|
+
*
|
|
5
|
+
* All scheduling DTOs are available from 'ad2app-lib/types' via:
|
|
6
|
+
* import { SchedulingPostDTO, SchedulingAnalyticsKpiDTO, ... } from 'ad2app-lib/types';
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./I_SchedulingPost"), exports);
|
|
24
|
+
__exportStar(require("./I_SchedulingAnalytics"), exports);
|
|
25
|
+
__exportStar(require("./I_SchedulingConnectedAccount"), exports);
|
|
26
|
+
__exportStar(require("./I_SchedulingInbox"), exports);
|
|
27
|
+
__exportStar(require("./I_SchedulingProUpgrade"), exports);
|
package/package.json
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -33,3 +33,6 @@ export * from "./I_Media";
|
|
|
33
33
|
export * from "./I_SocialAccount";
|
|
34
34
|
export * from "./I_Collaboration";
|
|
35
35
|
export * from "./I_Publish";
|
|
36
|
+
export * from "./I_SM_Platform";
|
|
37
|
+
// ── Scheduling domain ─────────────────────────────────────────────────────────
|
|
38
|
+
export * from "./scheduling";
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
// ── SchedulingAnalyticsKpiDTO ─────────────────────────────────────────────────
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Aggregated KPI figures for the selected date range.
|
|
12
|
+
* Returned by GET /social/analytics.
|
|
13
|
+
*/
|
|
14
|
+
export class SchedulingAnalyticsKpiDTO {
|
|
15
|
+
impressions: number;
|
|
16
|
+
reach: number;
|
|
17
|
+
engagementRate: number;
|
|
18
|
+
followerGrowth: number;
|
|
19
|
+
|
|
20
|
+
constructor(data: SchedulingAnalyticsKpiDTO) {
|
|
21
|
+
this.impressions = data.impressions;
|
|
22
|
+
this.reach = data.reach;
|
|
23
|
+
this.engagementRate = data.engagementRate;
|
|
24
|
+
this.followerGrowth = data.followerGrowth;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ── SchedulingAnalyticsEntryDTO ───────────────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A single day/platform analytics row.
|
|
32
|
+
* Returned by GET /social/analytics/daily.
|
|
33
|
+
*/
|
|
34
|
+
export class SchedulingAnalyticsEntryDTO {
|
|
35
|
+
platform: string;
|
|
36
|
+
date: string;
|
|
37
|
+
impressions: number;
|
|
38
|
+
reach: number;
|
|
39
|
+
views: number;
|
|
40
|
+
likes: number;
|
|
41
|
+
comments: number;
|
|
42
|
+
shares: number;
|
|
43
|
+
saves: number;
|
|
44
|
+
clicks: number;
|
|
45
|
+
engagements: number;
|
|
46
|
+
|
|
47
|
+
constructor(data: SchedulingAnalyticsEntryDTO) {
|
|
48
|
+
this.platform = data.platform;
|
|
49
|
+
this.date = data.date;
|
|
50
|
+
this.impressions = data.impressions;
|
|
51
|
+
this.reach = data.reach;
|
|
52
|
+
this.views = data.views;
|
|
53
|
+
this.likes = data.likes;
|
|
54
|
+
this.comments = data.comments;
|
|
55
|
+
this.shares = data.shares;
|
|
56
|
+
this.saves = data.saves;
|
|
57
|
+
this.clicks = data.clicks;
|
|
58
|
+
this.engagements = data.engagements;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ── SchedulingAnalyticsParamsDTO ──────────────────────────────────────────────
|
|
63
|
+
|
|
64
|
+
/** Query parameters shared by all analytics endpoints. */
|
|
65
|
+
export class SchedulingAnalyticsParamsDTO {
|
|
66
|
+
fromDate?: string;
|
|
67
|
+
toDate?: string;
|
|
68
|
+
platform?: string;
|
|
69
|
+
|
|
70
|
+
constructor(data: SchedulingAnalyticsParamsDTO) {
|
|
71
|
+
this.fromDate = data.fromDate;
|
|
72
|
+
this.toDate = data.toDate;
|
|
73
|
+
this.platform = data.platform;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// ── SchedulingBestTimeSlotDTO ─────────────────────────────────────────────────
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* A single day+hour slot with average engagement data.
|
|
81
|
+
* Returned by GET /social/analytics/best-time.
|
|
82
|
+
*/
|
|
83
|
+
export class SchedulingBestTimeSlotDTO {
|
|
84
|
+
/** 0 = Sunday … 6 = Saturday */
|
|
85
|
+
day: number;
|
|
86
|
+
/** 0 – 23 */
|
|
87
|
+
hour: number;
|
|
88
|
+
avgEngagements: number;
|
|
89
|
+
avgImpressions: number;
|
|
90
|
+
|
|
91
|
+
constructor(data: SchedulingBestTimeSlotDTO) {
|
|
92
|
+
this.day = data.day;
|
|
93
|
+
this.hour = data.hour;
|
|
94
|
+
this.avgEngagements = data.avgEngagements;
|
|
95
|
+
this.avgImpressions = data.avgImpressions;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ── SchedulingPostTimelineEntryDTO ────────────────────────────────────────────
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* One snapshot in a per-post timeline series.
|
|
103
|
+
* Returned by GET /social/analytics/post-timeline.
|
|
104
|
+
*/
|
|
105
|
+
export class SchedulingPostTimelineEntryDTO {
|
|
106
|
+
date: string;
|
|
107
|
+
platform: string;
|
|
108
|
+
impressions: number;
|
|
109
|
+
likes: number;
|
|
110
|
+
comments: number;
|
|
111
|
+
shares: number;
|
|
112
|
+
saves: number;
|
|
113
|
+
clicks: number;
|
|
114
|
+
|
|
115
|
+
constructor(data: SchedulingPostTimelineEntryDTO) {
|
|
116
|
+
this.date = data.date;
|
|
117
|
+
this.platform = data.platform;
|
|
118
|
+
this.impressions = data.impressions;
|
|
119
|
+
this.likes = data.likes;
|
|
120
|
+
this.comments = data.comments;
|
|
121
|
+
this.shares = data.shares;
|
|
122
|
+
this.saves = data.saves;
|
|
123
|
+
this.clicks = data.clicks;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ── SchedulingContentDecayDTO ─────────────────────────────────────────────────
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Engagement decay percentage at a specific time window after publishing.
|
|
131
|
+
* Returned by GET /social/analytics/content-decay.
|
|
132
|
+
*/
|
|
133
|
+
export class SchedulingContentDecayDTO {
|
|
134
|
+
window: '1h' | '6h' | '24h' | '7d';
|
|
135
|
+
platform: string;
|
|
136
|
+
/** Percentage of peak engagement remaining at this window */
|
|
137
|
+
pct: number;
|
|
138
|
+
|
|
139
|
+
constructor(data: SchedulingContentDecayDTO) {
|
|
140
|
+
this.window = data.window;
|
|
141
|
+
this.platform = data.platform;
|
|
142
|
+
this.pct = data.pct;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// ── SchedulingFollowerStatDTO ─────────────────────────────────────────────────
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Follower count and growth for one platform on one date.
|
|
150
|
+
* Returned by GET /social/analytics/follower-stats.
|
|
151
|
+
*/
|
|
152
|
+
export class SchedulingFollowerStatDTO {
|
|
153
|
+
platform: string;
|
|
154
|
+
date: string;
|
|
155
|
+
followers: number;
|
|
156
|
+
followersGrowth: number;
|
|
157
|
+
|
|
158
|
+
constructor(data: SchedulingFollowerStatDTO) {
|
|
159
|
+
this.platform = data.platform;
|
|
160
|
+
this.date = data.date;
|
|
161
|
+
this.followers = data.followers;
|
|
162
|
+
this.followersGrowth = data.followersGrowth;
|
|
163
|
+
}
|
|
164
|
+
}
|