ad2app-lib 1.31.0 → 1.32.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.
|
@@ -74,6 +74,18 @@ export declare class SchedulingUpdatePostDTO {
|
|
|
74
74
|
platforms?: SchedulingPlatformTargetDTO[];
|
|
75
75
|
/** Full media array for the edit patch (C2, AD2-1026), same shape as create. */
|
|
76
76
|
mediaItems?: SchedulingMediaItemDTO[];
|
|
77
|
+
/**
|
|
78
|
+
* Per-platform settings on the edit patch, same shape as create (AD2-1328).
|
|
79
|
+
* When PRESENT the patch is the full per-platform state: a platform it does
|
|
80
|
+
* not mention is cleared at the vendor. When ABSENT the stored per-target
|
|
81
|
+
* settings are carried over unchanged. The compose editor always sends it
|
|
82
|
+
* (`{}` when nothing is set) so a cleared field actually clears.
|
|
83
|
+
*/
|
|
84
|
+
platformSpecificData?: Record<string, Record<string, unknown>>;
|
|
85
|
+
/** TikTok settings on the edit patch, same shape as create (AD2-1328). */
|
|
86
|
+
tiktokSettings?: Record<string, unknown>;
|
|
87
|
+
/** Compose disclosure on the edit patch, same shape as create (AD2-1328). */
|
|
88
|
+
disclosure?: SchedulingPostDisclosureDTO;
|
|
77
89
|
constructor(data?: Partial<SchedulingUpdatePostDTO>);
|
|
78
90
|
}
|
|
79
91
|
/**
|
|
@@ -87,6 +87,9 @@ class SchedulingUpdatePostDTO {
|
|
|
87
87
|
this.scheduledAt = data.scheduledAt;
|
|
88
88
|
this.platforms = data.platforms;
|
|
89
89
|
this.mediaItems = data.mediaItems;
|
|
90
|
+
this.platformSpecificData = data.platformSpecificData;
|
|
91
|
+
this.tiktokSettings = data.tiktokSettings;
|
|
92
|
+
this.disclosure = data.disclosure;
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
exports.SchedulingUpdatePostDTO = SchedulingUpdatePostDTO;
|
package/package.json
CHANGED
|
@@ -91,6 +91,28 @@ test('SchedulingUpdatePostDTO platforms/mediaItems are absent by default (backwa
|
|
|
91
91
|
assert.equal(patch.mediaItems, undefined);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
+
// AD2-1328 — the compose editor has sent the per-platform trio on save since
|
|
95
|
+
// AD2-1026; the backend typed it locally as an intersection because the lib
|
|
96
|
+
// had no home for it. Pinned here so the local clone can retire at ship time.
|
|
97
|
+
test('SchedulingUpdatePostDTO carries platformSpecificData/tiktokSettings/disclosure for the edit patch (AD2-1328)', () => {
|
|
98
|
+
const patch = new SchedulingUpdatePostDTO({
|
|
99
|
+
platforms: [new SchedulingPlatformTargetDTO({ platform: 'youtube', accountId: 'acc-yt' })],
|
|
100
|
+
platformSpecificData: { youtube: { title: 'Launch day' } },
|
|
101
|
+
tiktokSettings: { privacy_level: 'SELF_ONLY' },
|
|
102
|
+
disclosure: { aiGenerated: true },
|
|
103
|
+
});
|
|
104
|
+
assert.deepEqual(patch.platformSpecificData, { youtube: { title: 'Launch day' } });
|
|
105
|
+
assert.deepEqual(patch.tiktokSettings, { privacy_level: 'SELF_ONLY' });
|
|
106
|
+
assert.equal(patch.disclosure?.aiGenerated, true);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
test('SchedulingUpdatePostDTO per-platform trio is absent by default, so absence still means "keep what is stored"', () => {
|
|
110
|
+
const patch = new SchedulingUpdatePostDTO({ content: 'x' });
|
|
111
|
+
assert.equal(patch.platformSpecificData, undefined);
|
|
112
|
+
assert.equal(patch.tiktokSettings, undefined);
|
|
113
|
+
assert.equal(patch.disclosure, undefined);
|
|
114
|
+
});
|
|
115
|
+
|
|
94
116
|
// AD2-1153 — the backend's local SocialPostStatus enum already has a
|
|
95
117
|
// PUBLISHING member (Zernio accepted the post but its outcome couldn't be
|
|
96
118
|
// confirmed inline); this pins the lib side so the backend's
|
|
@@ -134,6 +134,18 @@ export class SchedulingUpdatePostDTO {
|
|
|
134
134
|
platforms?: SchedulingPlatformTargetDTO[];
|
|
135
135
|
/** Full media array for the edit patch (C2, AD2-1026), same shape as create. */
|
|
136
136
|
mediaItems?: SchedulingMediaItemDTO[];
|
|
137
|
+
/**
|
|
138
|
+
* Per-platform settings on the edit patch, same shape as create (AD2-1328).
|
|
139
|
+
* When PRESENT the patch is the full per-platform state: a platform it does
|
|
140
|
+
* not mention is cleared at the vendor. When ABSENT the stored per-target
|
|
141
|
+
* settings are carried over unchanged. The compose editor always sends it
|
|
142
|
+
* (`{}` when nothing is set) so a cleared field actually clears.
|
|
143
|
+
*/
|
|
144
|
+
platformSpecificData?: Record<string, Record<string, unknown>>;
|
|
145
|
+
/** TikTok settings on the edit patch, same shape as create (AD2-1328). */
|
|
146
|
+
tiktokSettings?: Record<string, unknown>;
|
|
147
|
+
/** Compose disclosure on the edit patch, same shape as create (AD2-1328). */
|
|
148
|
+
disclosure?: SchedulingPostDisclosureDTO;
|
|
137
149
|
|
|
138
150
|
constructor(data?: Partial<SchedulingUpdatePostDTO>) {
|
|
139
151
|
if (!data) return;
|
|
@@ -141,6 +153,9 @@ export class SchedulingUpdatePostDTO {
|
|
|
141
153
|
this.scheduledAt = data.scheduledAt;
|
|
142
154
|
this.platforms = data.platforms;
|
|
143
155
|
this.mediaItems = data.mediaItems;
|
|
156
|
+
this.platformSpecificData = data.platformSpecificData;
|
|
157
|
+
this.tiktokSettings = data.tiktokSettings;
|
|
158
|
+
this.disclosure = data.disclosure;
|
|
144
159
|
}
|
|
145
160
|
}
|
|
146
161
|
|