@kanvas/openclaw-plugin 0.1.8 → 0.1.9

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.
@@ -369,12 +369,13 @@ export class CrmService {
369
369
  });
370
370
  }
371
371
  async addLeadMessageByLeadId(input) {
372
- const channelSlug = await this.getLeadPrimaryChannelSlug(String(input.leadId));
373
- if (!channelSlug) {
374
- throw new Error(`No lead channel found for lead ${input.leadId}`);
372
+ // The channel_slug for lead notes must be the lead's UUID
373
+ const leadUuid = await this.getLeadUuid(String(input.leadId));
374
+ if (!leadUuid) {
375
+ throw new Error(`Lead ${input.leadId} not found`);
375
376
  }
376
377
  const created = await this.addLeadMessage({
377
- channel_slug: channelSlug,
378
+ channel_slug: leadUuid,
378
379
  message: input.message,
379
380
  parent_id: input.parent_id,
380
381
  is_public: input.is_public,
@@ -442,6 +443,21 @@ export class CrmService {
442
443
  `;
443
444
  return this.client.query(query, { first, page, channelSlug });
444
445
  }
446
+ async getLeadUuid(leadId) {
447
+ const response = await this.client.query(`
448
+ query LeadUuid($first: Int!, $where: QueryLeadsWhereWhereConditions) {
449
+ leads(first: $first, where: $where) {
450
+ data {
451
+ uuid
452
+ }
453
+ }
454
+ }
455
+ `, {
456
+ first: 1,
457
+ where: { column: "ID", operator: "EQ", value: leadId },
458
+ });
459
+ return response.data?.leads?.data?.[0]?.uuid ?? null;
460
+ }
445
461
  async getLeadPrimaryChannelSlug(leadId) {
446
462
  const response = await this.client.query(`
447
463
  query LeadChannels($first: Int!, $where: QueryLeadsWhereWhereConditions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanvas/openclaw-plugin",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Connects agents to Kanvas — your company's nervous system for CRM, inventory, orders, and messaging.",
5
5
  "license": "MIT",
6
6
  "repository": {