@jiggai/kitchen-plugin-marketing 0.2.10 → 0.2.12

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.
@@ -289,7 +289,11 @@ var BaseDriver = class {
289
289
  try {
290
290
  const integrations = await getPostizIntegrations(this.config.postiz);
291
291
  const match = integrations.find(
292
- (i) => i.providerIdentifier === this.postizProvider && !i.disabled
292
+ (i) => {
293
+ const id = (i.identifier || i.providerIdentifier || "").toLowerCase();
294
+ const target = this.postizProvider.toLowerCase();
295
+ return !i.disabled && (id === target || id.startsWith(target + "-") || id.startsWith(target + "_"));
296
+ }
293
297
  );
294
298
  if (match) {
295
299
  this._postizIntegrationId = this.config.postiz.integrationId || match.id;
@@ -297,7 +301,7 @@ var BaseDriver = class {
297
301
  connected: true,
298
302
  backend: "postiz",
299
303
  displayName: match.name || `${this.label} (Postiz)`,
300
- username: match.username,
304
+ username: match.profile || match.username,
301
305
  avatar: match.picture,
302
306
  integrationId: match.id
303
307
  };
@@ -127,10 +127,19 @@
127
127
  headers["x-postiz-base-url"] = url;
128
128
  }
129
129
  const res = await fetch(`${apiBase}/drivers?team=${encodeURIComponent(teamId)}`, { headers });
130
+ if (!res.ok) {
131
+ const errText = await res.text().catch(() => `HTTP ${res.status}`);
132
+ setError(`Driver API error: ${res.status} \u2014 ${errText.slice(0, 200)}`);
133
+ return;
134
+ }
130
135
  const json = await res.json();
131
- setDrivers(Array.isArray(json.drivers) ? json.drivers : []);
136
+ const list = Array.isArray(json.drivers) ? json.drivers : json.data?.drivers || [];
137
+ setDrivers(list);
138
+ if (list.length === 0) {
139
+ setError("No platform drivers returned. The plugin handler may not be loaded \u2014 try restarting Kitchen.");
140
+ }
132
141
  } catch (e) {
133
- setError(e?.message || "Failed to load drivers");
142
+ setError(`Failed to load drivers: ${e?.message || "unknown"}. Check browser console for details.`);
134
143
  }
135
144
  };
136
145
  const loadManual = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiggai/kitchen-plugin-marketing",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "Marketing Suite plugin for ClawKitchen",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -58,15 +58,11 @@
58
58
  "test": "echo \"No tests yet\" && exit 0"
59
59
  },
60
60
  "dependencies": {
61
- "better-sqlite3": "^9.4.5",
62
- "drizzle-orm": "^0.38.0",
63
- "express": "^4.18.2",
64
- "multer": "^1.4.4"
61
+ "better-sqlite3": "^11.0.0",
62
+ "drizzle-orm": "^0.38.0"
65
63
  },
66
64
  "devDependencies": {
67
65
  "@types/better-sqlite3": "^7.6.10",
68
- "@types/express": "^4.17.21",
69
- "@types/multer": "^1.4.11",
70
66
  "@types/node": "^20.0.0",
71
67
  "drizzle-kit": "^0.20.0",
72
68
  "esbuild": "^0.24.0",