@canonmsg/backend-contracts 5.2.0 → 5.3.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.
@@ -1901,6 +1901,11 @@
1901
1901
  "type": "string",
1902
1902
  "pattern": "^[A-Za-z0-9_.:-]{1,160}$"
1903
1903
  },
1904
+ "messageId": {
1905
+ "type": "string",
1906
+ "pattern": "^[A-Za-z0-9_.:-]{1,160}$",
1907
+ "description": "The triggering message this silence answers, so the record cannot be misread against a later message."
1908
+ },
1904
1909
  "reason": {
1905
1910
  "type": "string",
1906
1911
  "maxLength": 500,
@@ -1065,6 +1065,11 @@ const no_reply_input = {
1065
1065
  additionalProperties: false,
1066
1066
  properties: {
1067
1067
  conversationId: { type: 'string', pattern: verbContract_js_1.VERB_ID_PATTERNS.runtimeId },
1068
+ messageId: {
1069
+ type: 'string',
1070
+ pattern: verbContract_js_1.VERB_ID_PATTERNS.runtimeId,
1071
+ description: 'The triggering message this silence answers, so the record cannot be misread against a later message.',
1072
+ },
1068
1073
  reason: {
1069
1074
  type: 'string',
1070
1075
  maxLength: verbContract_js_1.VERB_LIMITS.noReplyReasonChars,
@@ -118,7 +118,7 @@ exports.VERB_WIRE_ENVELOPE_FIELDS = {
118
118
  list_contacts: { required: [], optional: [] },
119
119
  list_contact_requests: { required: [], optional: [] },
120
120
  list_conversations: { required: [], optional: ['limit'] },
121
- no_reply: { required: [], optional: ['conversationId'] },
121
+ no_reply: { required: [], optional: ['conversationId', 'messageId'] },
122
122
  };
123
123
  // ---------------------------------------------------------------------------
124
124
  // JSON Schema
@@ -478,7 +478,7 @@ function projectVerbIntentToWire(verb, intent, options) {
478
478
  break;
479
479
  }
480
480
  case 'no_reply': {
481
- envelope = compact({ conversationId: input.conversationId });
481
+ envelope = compact({ conversationId: input.conversationId, messageId: input.messageId });
482
482
  value = compact({ reason: input.reason });
483
483
  break;
484
484
  }
@@ -620,7 +620,7 @@ function mergeVerbWireToIntent(request) {
620
620
  case 'list_conversations':
621
621
  return compact({ limit: envelope.limit });
622
622
  case 'no_reply':
623
- return compact({ conversationId: envelope.conversationId, reason: value.reason });
623
+ return compact({ conversationId: envelope.conversationId, messageId: envelope.messageId, reason: value.reason });
624
624
  }
625
625
  }
626
626
  /**
@@ -1709,6 +1709,11 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
1709
1709
  readonly type: "string";
1710
1710
  readonly pattern: "^[A-Za-z0-9_.:-]{1,160}$";
1711
1711
  };
1712
+ readonly messageId: {
1713
+ readonly type: "string";
1714
+ readonly pattern: "^[A-Za-z0-9_.:-]{1,160}$";
1715
+ readonly description: "The triggering message this silence answers, so the record cannot be misread against a later message.";
1716
+ };
1712
1717
  readonly reason: {
1713
1718
  readonly type: "string";
1714
1719
  readonly maxLength: 500;
@@ -1060,6 +1060,11 @@ const no_reply_input = {
1060
1060
  additionalProperties: false,
1061
1061
  properties: {
1062
1062
  conversationId: { type: 'string', pattern: VERB_ID_PATTERNS.runtimeId },
1063
+ messageId: {
1064
+ type: 'string',
1065
+ pattern: VERB_ID_PATTERNS.runtimeId,
1066
+ description: 'The triggering message this silence answers, so the record cannot be misread against a later message.',
1067
+ },
1063
1068
  reason: {
1064
1069
  type: 'string',
1065
1070
  maxLength: VERB_LIMITS.noReplyReasonChars,
package/dist/verbWire.js CHANGED
@@ -112,7 +112,7 @@ export const VERB_WIRE_ENVELOPE_FIELDS = {
112
112
  list_contacts: { required: [], optional: [] },
113
113
  list_contact_requests: { required: [], optional: [] },
114
114
  list_conversations: { required: [], optional: ['limit'] },
115
- no_reply: { required: [], optional: ['conversationId'] },
115
+ no_reply: { required: [], optional: ['conversationId', 'messageId'] },
116
116
  };
117
117
  // ---------------------------------------------------------------------------
118
118
  // JSON Schema
@@ -472,7 +472,7 @@ export function projectVerbIntentToWire(verb, intent, options) {
472
472
  break;
473
473
  }
474
474
  case 'no_reply': {
475
- envelope = compact({ conversationId: input.conversationId });
475
+ envelope = compact({ conversationId: input.conversationId, messageId: input.messageId });
476
476
  value = compact({ reason: input.reason });
477
477
  break;
478
478
  }
@@ -614,7 +614,7 @@ export function mergeVerbWireToIntent(request) {
614
614
  case 'list_conversations':
615
615
  return compact({ limit: envelope.limit });
616
616
  case 'no_reply':
617
- return compact({ conversationId: envelope.conversationId, reason: value.reason });
617
+ return compact({ conversationId: envelope.conversationId, messageId: envelope.messageId, reason: value.reason });
618
618
  }
619
619
  }
620
620
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/backend-contracts",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "description": "Canon backend contract helpers shared by Functions and stream-service",
5
5
  "type": "module",
6
6
  "main": "dist/cjs/index.js",