@jiggai/kitchen-plugin-marketing 0.3.2 → 0.3.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.
@@ -263,24 +263,26 @@ async function postizPublish(config, integrationId, content, options) {
263
263
  const defaultSettings = DEFAULT_PLATFORM_SETTINGS[platformId] || { __type: platformId };
264
264
  const settings = { ...defaultSettings, ...options?.settings || {} };
265
265
  const image = (options?.mediaUrls || []).map((url, i) => ({ id: `img${i}`, path: url }));
266
+ const postDate = options?.scheduledAt || (/* @__PURE__ */ new Date()).toISOString();
266
267
  const payload = {
267
268
  type: options?.scheduledAt ? "schedule" : "now",
269
+ date: postDate,
268
270
  shortLink: false,
269
271
  tags: [],
270
272
  posts: [
271
273
  {
272
274
  integration: { id: integrationId },
273
- value: {
274
- content,
275
- image,
276
- settings
277
- }
275
+ value: [
276
+ {
277
+ content,
278
+ image,
279
+ settings
280
+ }
281
+ ],
282
+ settings
278
283
  }
279
284
  ]
280
285
  };
281
- if (options?.scheduledAt) {
282
- payload.date = options.scheduledAt;
283
- }
284
286
  const res = await postizFetch(config, "/posts", {
285
287
  method: "POST",
286
288
  body: JSON.stringify(payload)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiggai/kitchen-plugin-marketing",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Marketing Suite plugin for ClawKitchen",
5
5
  "main": "dist/index.js",
6
6
  "files": [