ad2app-lib 1.10.0 → 1.14.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.
@@ -78,11 +78,68 @@ export class SchedulingCreatePostDTO {
78
78
  export class SchedulingUpdatePostDTO {
79
79
  content?: string;
80
80
  scheduledAt?: string;
81
+ /**
82
+ * Per-platform targets for the edit patch (C2, AD2-1026) — the backend's
83
+ * `UpdatePostDTO` intersects this on top locally today; promoted here so
84
+ * the type ships from the lib instead of a local clone.
85
+ */
86
+ platforms?: SchedulingPlatformTargetDTO[];
87
+ /** Full media array for the edit patch (C2, AD2-1026), same shape as create. */
88
+ mediaItems?: SchedulingMediaItemDTO[];
81
89
 
82
90
  constructor(data?: Partial<SchedulingUpdatePostDTO>) {
83
91
  if (!data) return;
84
92
  this.content = data.content;
85
93
  this.scheduledAt = data.scheduledAt;
94
+ this.platforms = data.platforms;
95
+ this.mediaItems = data.mediaItems;
96
+ }
97
+ }
98
+
99
+ // ── SchedulingPostMediaItemDTO ────────────────────────────────────────────────
100
+
101
+ /**
102
+ * One media item on the edit-load response — verbatim from the live Zernio
103
+ * post's mediaItems (Post.mediaItems → MediaItem, OpenAPI v1.0.4:3223).
104
+ * Distinct from `SchedulingMediaItemDTO` (the create/update input shape):
105
+ * every field here is optional and `type` additionally allows `gif`/`document`
106
+ * to match what a fetched post can actually carry (T022b, AD2-1026).
107
+ */
108
+ export class SchedulingPostMediaItemDTO {
109
+ type?: 'image' | 'video' | 'gif' | 'document';
110
+ url?: string;
111
+ title?: string;
112
+
113
+ constructor(data?: Partial<SchedulingPostMediaItemDTO>) {
114
+ if (!data) return;
115
+ this.type = data.type;
116
+ this.url = data.url;
117
+ this.title = data.title;
118
+ }
119
+ }
120
+
121
+ // ── SchedulingPostTargetDTO ───────────────────────────────────────────────────
122
+
123
+ /**
124
+ * One per-platform target on the edit-load response — the request-shape
125
+ * subset of Zernio's PlatformTarget (OpenAPI v1.0.4:3275): `platform`,
126
+ * `accountId` (always normalized to the plain string id — Zernio expands it
127
+ * to an account object on fetched posts, yaml:3282), and
128
+ * `platformSpecificData` VERBATIM (yaml:3297, additionalProperties: true).
129
+ * Response-only fields (status, platformPostUrl, errors) are never exposed
130
+ * here — they already live on platformStatuses/postUrls/platformErrors
131
+ * (T022b, AD2-1026).
132
+ */
133
+ export class SchedulingPostTargetDTO {
134
+ platform: string;
135
+ accountId?: string;
136
+ platformSpecificData?: Record<string, unknown>;
137
+
138
+ constructor(data?: Partial<SchedulingPostTargetDTO>) {
139
+ if (!data) return;
140
+ this.platform = data.platform;
141
+ this.accountId = data.accountId;
142
+ this.platformSpecificData = data.platformSpecificData;
86
143
  }
87
144
  }
88
145
 
@@ -104,6 +161,25 @@ export class SchedulingPostDTO {
104
161
  contentSnippet?: string;
105
162
  createdAt: string;
106
163
  updatedAt: string;
164
+ /**
165
+ * Media-miniature pass-through fields (C1, AD2-1083) — present only when
166
+ * the cache row has a stored thumbnail/media URL, absent otherwise (never
167
+ * an empty string).
168
+ */
169
+ thumbnailUrl?: string;
170
+ mediaUrl?: string;
171
+ /**
172
+ * Edit-load fields for compose edit mode (C2, AD2-1026 + T022b):
173
+ * `content` is the COMPLETE caption (the cache only stores the 280-char
174
+ * `contentSnippet`); `mediaItems`/`platformTargets` are the full per-post
175
+ * media array and per-platform accountIds + compose settings. All three
176
+ * ride the live Zernio fetch: present when it succeeds (arrays may be
177
+ * possibly-empty = known-empty), ALL absent when it fails, which blocks
178
+ * edit frontend-side.
179
+ */
180
+ content?: string;
181
+ mediaItems?: SchedulingPostMediaItemDTO[];
182
+ platformTargets?: SchedulingPostTargetDTO[];
107
183
 
108
184
  constructor(data: SchedulingPostDTO) {
109
185
  this.id = data.id;
@@ -118,6 +194,11 @@ export class SchedulingPostDTO {
118
194
  this.contentSnippet = data.contentSnippet;
119
195
  this.createdAt = data.createdAt;
120
196
  this.updatedAt = data.updatedAt;
197
+ this.thumbnailUrl = data.thumbnailUrl;
198
+ this.mediaUrl = data.mediaUrl;
199
+ this.content = data.content;
200
+ this.mediaItems = data.mediaItems;
201
+ this.platformTargets = data.platformTargets;
121
202
  }
122
203
  }
123
204
 
package/CHANGELOG.md DELETED
@@ -1,43 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to `ad2app-lib` are documented here. The analytics taxonomy
4
- is the single source of truth across all surfaces; the matching spec lives in
5
- `ad2appus/docs/posthog-implementation.md` (§3).
6
-
7
- ## 1.9.0
8
-
9
- ### Added
10
-
11
- - Free Tier analytics (epic AD2-887):
12
- - `EVENTS.FREE_SKILLS_REQUESTED` (`free_skills_requested`), shape `{ source: string }` — email submitted for the free skills (AD2-889).
13
- - `EVENTS.ACCOUNT_CONNECT_BLOCKED` (`account_connect_blocked`), shape `{ platform?: string }` — free user hits the connect wall (AD2-892).
14
- - `EVENTS.MCP_POST_BLOCKED_FREE_TIER` (`mcp_post_blocked_free_tier`), shape `{ target_count?: number }` — free user tries to post in the MCP (AD2-898).
15
- - `'free_skills'` added to the `LANDING_CTA_CLICKED` location union.
16
- - Email lifecycle events (Resend webhook -> PostHog, AD2-894):
17
- `EVENTS.EMAIL_DELIVERED` / `EMAIL_OPENED` / `EMAIL_CLICKED` / `EMAIL_BOUNCED` /
18
- `EMAIL_COMPLAINED`, all sharing `EmailEventProperties` (`{ email_id?, subject?, link? }`).
19
-
20
- ## 1.8.0
21
-
22
- ### Added
23
-
24
- - `EVENTS.CONNECT_ARTIFACT_COPIED` (`connect_artifact_copied`) with property
25
- shape `{ target: 'app' | 'ask' | 'terminal' | 'editor' }` — fired when the
26
- `/connect` install snippet is copied.
27
- - `'ai_connector'` added to the `LANDING_CTA_CLICKED` location union
28
- (`hero | pricing | final_cta | nav | ai_connector`).
29
-
30
- ### Removed
31
-
32
- - `EVENTS.TRIAL_STARTED` (`trial_started`) and its `EventProperties` shape.
33
- - `PERSON_PROPS.TRIAL_ENDS_AT` (`trial_ends_at`).
34
- - `'trial'` removed from the documented `PLAN` person-property values, which now
35
- match the canonical `SchedulingSubscriptionTier` (`free | starter | pro`).
36
-
37
- ad2app is a paid-only product with no trial, so these events never fired.
38
- Verified that no consumer (frontend, backend, landing, mcp) referenced them.
39
-
40
- > **Semver note:** removing exported symbols is technically breaking. It is
41
- > released as a minor because no consumer referenced the removed tokens and all
42
- > consumers pin `^1.7.x`, so they upgrade frictionlessly. If you prefer strict
43
- > semver, retag as `2.0.0` and bump the consumer ranges deliberately.