@kirimdev/sdk 3.6.0 → 3.7.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.
@@ -294,7 +294,7 @@ export interface paths {
294
294
  * Send a WhatsApp message or mark inbound as read
295
295
  * @description Meta-style messages endpoint. Two operations share the same path, distinguished by the request body:
296
296
  *
297
- * **Outbound send** — body has a `type` field (`text`, `image`, `document`, `video`, `audio`, `template`, `interactive`). Body shape mirrors the Meta WhatsApp Cloud API; media variants accept either `link` (hosted URL) or `id` (Meta uploaded media). The sender is the WhatsApp account identified by `phone_number_id` in the URL path; there is no `from` field in the body. Pass `Idempotency-Key` to safely retry on network failure.
297
+ * **Outbound send** — body has a `type` field (`text`, `image`, `document`, `video`, `audio`, `template`, `interactive`). Body shape mirrors the Meta WhatsApp Cloud API; media variants accept either `link` (hosted URL) or `id` (Meta uploaded media). Optional top-level `context: { message_id }` creates a contextual reply — pass the inbound wamid from your webhook (`messages[0].id`), not a Kirim `msg_*` id. The sender is the WhatsApp account identified by `phone_number_id` in the URL path; there is no `from` field in the body. Pass `Idempotency-Key` to safely retry on network failure.
298
298
  *
299
299
  * **Read receipt** — body has `status: "read"` + `message_id` (the inbound wamid from your webhook). Sends a read receipt back to the sender so the double-tick turns blue on their phone. Optional `typing_indicator: { type: "text" }` shows a typing bubble alongside the receipt; Meta auto-dismisses after ~25 seconds or on first outbound message.
300
300
  *
@@ -321,6 +321,14 @@ export interface paths {
321
321
  /** @enum {string} */
322
322
  recipient_type?: "individual";
323
323
  to: string;
324
+ /** Reply context */
325
+ context?: {
326
+ /**
327
+ * @description Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.
328
+ * @example wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA
329
+ */
330
+ message_id: string;
331
+ };
324
332
  /** @enum {string} */
325
333
  type: "text";
326
334
  text: {
@@ -333,6 +341,14 @@ export interface paths {
333
341
  /** @enum {string} */
334
342
  recipient_type?: "individual";
335
343
  to: string;
344
+ /** Reply context */
345
+ context?: {
346
+ /**
347
+ * @description Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.
348
+ * @example wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA
349
+ */
350
+ message_id: string;
351
+ };
336
352
  /** @enum {string} */
337
353
  type: "image";
338
354
  image: {
@@ -348,6 +364,14 @@ export interface paths {
348
364
  /** @enum {string} */
349
365
  recipient_type?: "individual";
350
366
  to: string;
367
+ /** Reply context */
368
+ context?: {
369
+ /**
370
+ * @description Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.
371
+ * @example wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA
372
+ */
373
+ message_id: string;
374
+ };
351
375
  /** @enum {string} */
352
376
  type: "document";
353
377
  document: {
@@ -363,6 +387,14 @@ export interface paths {
363
387
  /** @enum {string} */
364
388
  recipient_type?: "individual";
365
389
  to: string;
390
+ /** Reply context */
391
+ context?: {
392
+ /**
393
+ * @description Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.
394
+ * @example wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA
395
+ */
396
+ message_id: string;
397
+ };
366
398
  /** @enum {string} */
367
399
  type: "video";
368
400
  video: {
@@ -378,6 +410,14 @@ export interface paths {
378
410
  /** @enum {string} */
379
411
  recipient_type?: "individual";
380
412
  to: string;
413
+ /** Reply context */
414
+ context?: {
415
+ /**
416
+ * @description Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.
417
+ * @example wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA
418
+ */
419
+ message_id: string;
420
+ };
381
421
  /** @enum {string} */
382
422
  type: "audio";
383
423
  audio: {
@@ -394,6 +434,14 @@ export interface paths {
394
434
  /** @enum {string} */
395
435
  recipient_type?: "individual";
396
436
  to: string;
437
+ /** Reply context */
438
+ context?: {
439
+ /**
440
+ * @description Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.
441
+ * @example wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA
442
+ */
443
+ message_id: string;
444
+ };
397
445
  /** @enum {string} */
398
446
  type: "template";
399
447
  template: {
@@ -421,6 +469,14 @@ export interface paths {
421
469
  /** @enum {string} */
422
470
  recipient_type?: "individual";
423
471
  to: string;
472
+ /** Reply context */
473
+ context?: {
474
+ /**
475
+ * @description Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.
476
+ * @example wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA
477
+ */
478
+ message_id: string;
479
+ };
424
480
  /** @enum {string} */
425
481
  type: "interactive";
426
482
  interactive: {
@@ -947,6 +1003,15 @@ export interface paths {
947
1003
  "application/json": components["schemas"]["ApiErrorEnvelope"];
948
1004
  };
949
1005
  };
1006
+ /** @description Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) */
1007
+ 409: {
1008
+ headers: {
1009
+ [name: string]: unknown;
1010
+ };
1011
+ content: {
1012
+ "application/json": components["schemas"]["ApiErrorEnvelope"];
1013
+ };
1014
+ };
950
1015
  /** @description Semantic failure (e.g. idempotency key reuse) */
951
1016
  422: {
952
1017
  headers: {
@@ -1642,7 +1707,7 @@ export interface paths {
1642
1707
  "application/json": components["schemas"]["ApiErrorEnvelope"];
1643
1708
  };
1644
1709
  };
1645
- /** @description Conflict (e.g. webhook subscription disabled, setup link inactive) */
1710
+ /** @description Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) */
1646
1711
  409: {
1647
1712
  headers: {
1648
1713
  [name: string]: unknown;
@@ -2002,7 +2067,7 @@ export interface paths {
2002
2067
  "application/json": components["schemas"]["ApiErrorEnvelope"];
2003
2068
  };
2004
2069
  };
2005
- /** @description Conflict (e.g. webhook subscription disabled, setup link inactive) */
2070
+ /** @description Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) */
2006
2071
  409: {
2007
2072
  headers: {
2008
2073
  [name: string]: unknown;
@@ -2111,7 +2176,7 @@ export interface paths {
2111
2176
  "application/json": components["schemas"]["ApiErrorEnvelope"];
2112
2177
  };
2113
2178
  };
2114
- /** @description Conflict (e.g. webhook subscription disabled, setup link inactive) */
2179
+ /** @description Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) */
2115
2180
  409: {
2116
2181
  headers: {
2117
2182
  [name: string]: unknown;
@@ -4547,7 +4612,7 @@ export interface paths {
4547
4612
  "application/json": components["schemas"]["ApiErrorEnvelope"];
4548
4613
  };
4549
4614
  };
4550
- /** @description Conflict (e.g. webhook subscription disabled, setup link inactive) */
4615
+ /** @description Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) */
4551
4616
  409: {
4552
4617
  headers: {
4553
4618
  [name: string]: unknown;
@@ -4646,7 +4711,7 @@ export interface paths {
4646
4711
  "application/json": components["schemas"]["ApiErrorEnvelope"];
4647
4712
  };
4648
4713
  };
4649
- /** @description Conflict (e.g. webhook subscription disabled, setup link inactive) */
4714
+ /** @description Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) */
4650
4715
  409: {
4651
4716
  headers: {
4652
4717
  [name: string]: unknown;
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION: "3.6.0";
1
+ export declare const SDK_VERSION: "3.7.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -2,5 +2,5 @@
2
2
  // Regenerated on every prebuild / pretypecheck / pretest from
3
3
  // package.json so the User-Agent header stays in sync with the
4
4
  // published version.
5
- export const SDK_VERSION = "3.6.0";
5
+ export const SDK_VERSION = "3.7.0";
6
6
  //# sourceMappingURL=version.js.map
@@ -3,4 +3,4 @@
3
3
  // package.json so the User-Agent header stays in sync with the
4
4
  // published version.
5
5
 
6
- export const SDK_VERSION = "3.6.0" as const
6
+ export const SDK_VERSION = "3.7.0" as const
@@ -25,8 +25,8 @@ export declare class TemplatesResource {
25
25
  * Returns the created template with `status: "pending"`. Meta reviews
26
26
  * asynchronously, so poll {@link retrieve} (or {@link sync}) for the
27
27
  * eventual `approved` / `rejected` status. A `name`+`language` pair that
28
- * already exists for the account throws `InvalidRequestError`
29
- * (`invalid_field_value`, `param: "name"`).
28
+ * already exists for the account throws `ConflictError`
29
+ * (`template_already_exists`, HTTP 409, `param: "name"`).
30
30
  */
31
31
  create(params: CreateTemplateParams, options?: RequestOptions): Promise<Template>;
32
32
  /**
@@ -38,8 +38,8 @@ export class TemplatesResource {
38
38
  * Returns the created template with `status: "pending"`. Meta reviews
39
39
  * asynchronously, so poll {@link retrieve} (or {@link sync}) for the
40
40
  * eventual `approved` / `rejected` status. A `name`+`language` pair that
41
- * already exists for the account throws `InvalidRequestError`
42
- * (`invalid_field_value`, `param: "name"`).
41
+ * already exists for the account throws `ConflictError`
42
+ * (`template_already_exists`, HTTP 409, `param: "name"`).
43
43
  */
44
44
  create(params, options) {
45
45
  return this.http.requestData({
@@ -83,10 +83,34 @@ export type ContactUpdatedEvent = KirimEventEnvelope<'contact.updated', {
83
83
  export type KirimNativeWebhookEvent = ConversationAssignedEvent | ConversationClosedEvent | ContactCreatedEvent | ContactUpdatedEvent;
84
84
  /**
85
85
  * Meta passthrough body — `message.received` and `message.status`
86
- * deliveries forward Meta's WhatsApp Cloud webhook payload unchanged.
86
+ * deliveries forward Meta's WhatsApp Cloud webhook payload shape.
87
+ * `message.received` may also include an optional top-level `kirim`
88
+ * block with Kirimdev resource ids, conversation labels, and media URL.
87
89
  * Callers should branch on `X-Kirim-Event` to decide whether to parse
88
90
  * the body as `KirimNativeWebhookEvent` or `MetaPassthroughBody`.
89
91
  */
92
+ export type MessageReceivedMediaStatus = 'ready' | 'failed' | 'unavailable' | 'pending';
93
+ export interface MessageReceivedKirimContext {
94
+ conversation_id: string;
95
+ contact_id: string;
96
+ message_id: string;
97
+ phone_number_id: string;
98
+ labels: Array<{
99
+ id: string;
100
+ name: string;
101
+ color: string;
102
+ }>;
103
+ conversation: {
104
+ status: string;
105
+ assigned_to: string | null;
106
+ };
107
+ contact: {
108
+ name: string | null;
109
+ phone_number: string | null;
110
+ };
111
+ media_url: string | null;
112
+ media_status: MessageReceivedMediaStatus | null;
113
+ }
90
114
  export interface MetaPassthroughBody {
91
115
  object: 'whatsapp_business_account';
92
116
  entry: Array<{
@@ -96,6 +120,8 @@ export interface MetaPassthroughBody {
96
120
  field: 'messages' | string;
97
121
  }>;
98
122
  }>;
123
+ /** Present on `message.received` — Kirimdev routing context. Safe to ignore. */
124
+ kirim?: MessageReceivedKirimContext;
99
125
  }
100
126
  export type KirimWebhookEvent = KirimNativeWebhookEvent | MetaPassthroughBody;
101
127
  //# sourceMappingURL=webhooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,qBAAsB,SAAQ,iBAAiB;gBAC9C,OAAO,SAA8B;CAIlD;AAED,qBAAa,qBAAsB,SAAQ,iBAAiB;gBAC9C,OAAO,SAAyD;CAI7E;AAED,qBAAa,qBAAsB,SAAQ,iBAAiB;gBAC9C,OAAO,SAAsC;CAI1D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ClB,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC1D,YAAY,EAAE;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;KAC3B,CAAA;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;QACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAC5B,CAAA;IACD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,YAAY,EAAE,0BAA0B,GAAG,IAAI,CAAA;CAChD;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,2BAA2B,CAAA;IACnC,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,KAAK,CAAC;YAAE,KAAK,EAAE,OAAO,CAAC;YAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAA;SAAE,CAAC,CAAA;KAC/D,CAAC,CAAA;IACF,gFAAgF;IAChF,KAAK,CAAC,EAAE,2BAA2B,CAAA;CACpC;AAED,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,mBAAmB,CAAA"}
package/openapi.json CHANGED
@@ -2559,7 +2559,7 @@
2559
2559
  "Messages"
2560
2560
  ],
2561
2561
  "summary": "Send a WhatsApp message or mark inbound as read",
2562
- "description": "Meta-style messages endpoint. Two operations share the same path, distinguished by the request body:\n\n**Outbound send** — body has a `type` field (`text`, `image`, `document`, `video`, `audio`, `template`, `interactive`). Body shape mirrors the Meta WhatsApp Cloud API; media variants accept either `link` (hosted URL) or `id` (Meta uploaded media). The sender is the WhatsApp account identified by `phone_number_id` in the URL path; there is no `from` field in the body. Pass `Idempotency-Key` to safely retry on network failure.\n\n**Read receipt** — body has `status: \"read\"` + `message_id` (the inbound wamid from your webhook). Sends a read receipt back to the sender so the double-tick turns blue on their phone. Optional `typing_indicator: { type: \"text\" }` shows a typing bubble alongside the receipt; Meta auto-dismisses after ~25 seconds or on first outbound message.\n\n**Pre-send validation** — the API performs compliance checks before queuing the send. A 422 response with `error.code` set to `marketing_opted_out` indicates the recipient has stopped marketing messages from your business (the customer did this via the WhatsApp app menu — webhook `user_preferences` notifies you of the change). `account_restricted` indicates Meta has restricted your WhatsApp account; check the account status via the dashboard. `consent_required` indicates the recipient has not opted in. `customer_suspended` indicates the operator has suspended (or archived) the customer that owns this WhatsApp account; sends are blocked until the customer is unsuspended via the dashboard. `upstream_error` indicates the WhatsApp account is disconnected. None of these are retryable until the underlying condition changes.",
2562
+ "description": "Meta-style messages endpoint. Two operations share the same path, distinguished by the request body:\n\n**Outbound send** — body has a `type` field (`text`, `image`, `document`, `video`, `audio`, `template`, `interactive`). Body shape mirrors the Meta WhatsApp Cloud API; media variants accept either `link` (hosted URL) or `id` (Meta uploaded media). Optional top-level `context: { message_id }` creates a contextual reply — pass the inbound wamid from your webhook (`messages[0].id`), not a Kirim `msg_*` id. The sender is the WhatsApp account identified by `phone_number_id` in the URL path; there is no `from` field in the body. Pass `Idempotency-Key` to safely retry on network failure.\n\n**Read receipt** — body has `status: \"read\"` + `message_id` (the inbound wamid from your webhook). Sends a read receipt back to the sender so the double-tick turns blue on their phone. Optional `typing_indicator: { type: \"text\" }` shows a typing bubble alongside the receipt; Meta auto-dismisses after ~25 seconds or on first outbound message.\n\n**Pre-send validation** — the API performs compliance checks before queuing the send. A 422 response with `error.code` set to `marketing_opted_out` indicates the recipient has stopped marketing messages from your business (the customer did this via the WhatsApp app menu — webhook `user_preferences` notifies you of the change). `account_restricted` indicates Meta has restricted your WhatsApp account; check the account status via the dashboard. `consent_required` indicates the recipient has not opted in. `customer_suspended` indicates the operator has suspended (or archived) the customer that owns this WhatsApp account; sends are blocked until the customer is unsuspended via the dashboard. `upstream_error` indicates the WhatsApp account is disconnected. None of these are retryable until the underlying condition changes.",
2563
2563
  "security": [
2564
2564
  {
2565
2565
  "bearerAuth": []
@@ -2612,6 +2612,21 @@
2612
2612
  "to": {
2613
2613
  "type": "string"
2614
2614
  },
2615
+ "context": {
2616
+ "type": "object",
2617
+ "properties": {
2618
+ "message_id": {
2619
+ "type": "string",
2620
+ "minLength": 1,
2621
+ "description": "Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.",
2622
+ "example": "wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA"
2623
+ }
2624
+ },
2625
+ "required": [
2626
+ "message_id"
2627
+ ],
2628
+ "title": "Reply context"
2629
+ },
2615
2630
  "type": {
2616
2631
  "type": "string",
2617
2632
  "enum": [
@@ -2661,6 +2676,21 @@
2661
2676
  "to": {
2662
2677
  "type": "string"
2663
2678
  },
2679
+ "context": {
2680
+ "type": "object",
2681
+ "properties": {
2682
+ "message_id": {
2683
+ "type": "string",
2684
+ "minLength": 1,
2685
+ "description": "Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.",
2686
+ "example": "wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA"
2687
+ }
2688
+ },
2689
+ "required": [
2690
+ "message_id"
2691
+ ],
2692
+ "title": "Reply context"
2693
+ },
2664
2694
  "type": {
2665
2695
  "type": "string",
2666
2696
  "enum": [
@@ -2716,6 +2746,21 @@
2716
2746
  "to": {
2717
2747
  "type": "string"
2718
2748
  },
2749
+ "context": {
2750
+ "type": "object",
2751
+ "properties": {
2752
+ "message_id": {
2753
+ "type": "string",
2754
+ "minLength": 1,
2755
+ "description": "Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.",
2756
+ "example": "wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA"
2757
+ }
2758
+ },
2759
+ "required": [
2760
+ "message_id"
2761
+ ],
2762
+ "title": "Reply context"
2763
+ },
2719
2764
  "type": {
2720
2765
  "type": "string",
2721
2766
  "enum": [
@@ -2771,6 +2816,21 @@
2771
2816
  "to": {
2772
2817
  "type": "string"
2773
2818
  },
2819
+ "context": {
2820
+ "type": "object",
2821
+ "properties": {
2822
+ "message_id": {
2823
+ "type": "string",
2824
+ "minLength": 1,
2825
+ "description": "Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.",
2826
+ "example": "wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA"
2827
+ }
2828
+ },
2829
+ "required": [
2830
+ "message_id"
2831
+ ],
2832
+ "title": "Reply context"
2833
+ },
2774
2834
  "type": {
2775
2835
  "type": "string",
2776
2836
  "enum": [
@@ -2826,6 +2886,21 @@
2826
2886
  "to": {
2827
2887
  "type": "string"
2828
2888
  },
2889
+ "context": {
2890
+ "type": "object",
2891
+ "properties": {
2892
+ "message_id": {
2893
+ "type": "string",
2894
+ "minLength": 1,
2895
+ "description": "Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.",
2896
+ "example": "wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA"
2897
+ }
2898
+ },
2899
+ "required": [
2900
+ "message_id"
2901
+ ],
2902
+ "title": "Reply context"
2903
+ },
2829
2904
  "type": {
2830
2905
  "type": "string",
2831
2906
  "enum": [
@@ -2884,6 +2959,21 @@
2884
2959
  "to": {
2885
2960
  "type": "string"
2886
2961
  },
2962
+ "context": {
2963
+ "type": "object",
2964
+ "properties": {
2965
+ "message_id": {
2966
+ "type": "string",
2967
+ "minLength": 1,
2968
+ "description": "Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.",
2969
+ "example": "wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA"
2970
+ }
2971
+ },
2972
+ "required": [
2973
+ "message_id"
2974
+ ],
2975
+ "title": "Reply context"
2976
+ },
2887
2977
  "type": {
2888
2978
  "type": "string",
2889
2979
  "enum": [
@@ -2997,6 +3087,21 @@
2997
3087
  "to": {
2998
3088
  "type": "string"
2999
3089
  },
3090
+ "context": {
3091
+ "type": "object",
3092
+ "properties": {
3093
+ "message_id": {
3094
+ "type": "string",
3095
+ "minLength": 1,
3096
+ "description": "Meta WhatsApp message id (wamid) of the message to reply to. From the inbound webhook — NOT a Kirim `msg_*` external id.",
3097
+ "example": "wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA"
3098
+ }
3099
+ },
3100
+ "required": [
3101
+ "message_id"
3102
+ ],
3103
+ "title": "Reply context"
3104
+ },
3000
3105
  "type": {
3001
3106
  "type": "string",
3002
3107
  "enum": [
@@ -4431,6 +4536,16 @@
4431
4536
  }
4432
4537
  }
4433
4538
  },
4539
+ "409": {
4540
+ "description": "Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive)",
4541
+ "content": {
4542
+ "application/json": {
4543
+ "schema": {
4544
+ "$ref": "#/components/schemas/ApiErrorEnvelope"
4545
+ }
4546
+ }
4547
+ }
4548
+ },
4434
4549
  "422": {
4435
4550
  "description": "Semantic failure (e.g. idempotency key reuse)",
4436
4551
  "content": {
@@ -5305,7 +5420,7 @@
5305
5420
  }
5306
5421
  },
5307
5422
  "409": {
5308
- "description": "Conflict (e.g. webhook subscription disabled, setup link inactive)",
5423
+ "description": "Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive)",
5309
5424
  "content": {
5310
5425
  "application/json": {
5311
5426
  "schema": {
@@ -5738,7 +5853,7 @@
5738
5853
  }
5739
5854
  },
5740
5855
  "409": {
5741
- "description": "Conflict (e.g. webhook subscription disabled, setup link inactive)",
5856
+ "description": "Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive)",
5742
5857
  "content": {
5743
5858
  "application/json": {
5744
5859
  "schema": {
@@ -5863,7 +5978,7 @@
5863
5978
  }
5864
5979
  },
5865
5980
  "409": {
5866
- "description": "Conflict (e.g. webhook subscription disabled, setup link inactive)",
5981
+ "description": "Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive)",
5867
5982
  "content": {
5868
5983
  "application/json": {
5869
5984
  "schema": {
@@ -9024,7 +9139,7 @@
9024
9139
  }
9025
9140
  },
9026
9141
  "409": {
9027
- "description": "Conflict (e.g. webhook subscription disabled, setup link inactive)",
9142
+ "description": "Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive)",
9028
9143
  "content": {
9029
9144
  "application/json": {
9030
9145
  "schema": {
@@ -9138,7 +9253,7 @@
9138
9253
  }
9139
9254
  },
9140
9255
  "409": {
9141
- "description": "Conflict (e.g. webhook subscription disabled, setup link inactive)",
9256
+ "description": "Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive)",
9142
9257
  "content": {
9143
9258
  "application/json": {
9144
9259
  "schema": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirimdev/sdk",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "Official TypeScript SDK for the Kirimdev Public API.",
5
5
  "type": "module",
6
6
  "license": "MIT",