@linqapp/sdk 0.26.0 → 0.27.1

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +4 -3
  2. package/README.md +2 -2
  3. package/client.d.mts +16 -5
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +16 -5
  6. package/client.d.ts.map +1 -1
  7. package/client.js +5 -1
  8. package/client.js.map +1 -1
  9. package/client.mjs +5 -1
  10. package/client.mjs.map +1 -1
  11. package/package.json +4 -2
  12. package/resources/capability.d.mts +4 -4
  13. package/resources/capability.d.ts +4 -4
  14. package/resources/capability.js +2 -2
  15. package/resources/capability.mjs +2 -2
  16. package/resources/chats/chats.d.mts +100 -1
  17. package/resources/chats/chats.d.mts.map +1 -1
  18. package/resources/chats/chats.d.ts +100 -1
  19. package/resources/chats/chats.d.ts.map +1 -1
  20. package/resources/chats/chats.js.map +1 -1
  21. package/resources/chats/chats.mjs.map +1 -1
  22. package/resources/chats/messages.d.mts +101 -3
  23. package/resources/chats/messages.d.mts.map +1 -1
  24. package/resources/chats/messages.d.ts +101 -3
  25. package/resources/chats/messages.d.ts.map +1 -1
  26. package/resources/index.d.mts +2 -2
  27. package/resources/index.d.ts +2 -2
  28. package/resources/messages.d.mts +107 -3
  29. package/resources/messages.d.mts.map +1 -1
  30. package/resources/messages.d.ts +107 -3
  31. package/resources/messages.d.ts.map +1 -1
  32. package/resources/webhooks.d.mts +178 -5
  33. package/resources/webhooks.d.mts.map +1 -1
  34. package/resources/webhooks.d.ts +178 -5
  35. package/resources/webhooks.d.ts.map +1 -1
  36. package/resources/webhooks.js +9 -1
  37. package/resources/webhooks.js.map +1 -1
  38. package/resources/webhooks.mjs +9 -1
  39. package/resources/webhooks.mjs.map +1 -1
  40. package/src/client.ts +20 -4
  41. package/src/resources/capability.ts +5 -5
  42. package/src/resources/chats/chats.ts +117 -1
  43. package/src/resources/chats/messages.ts +124 -3
  44. package/src/resources/index.ts +2 -2
  45. package/src/resources/messages.ts +131 -3
  46. package/src/resources/webhooks.ts +230 -6
  47. package/src/version.ts +1 -1
  48. package/version.d.mts +1 -1
  49. package/version.d.ts +1 -1
  50. package/version.js +1 -1
  51. package/version.mjs +1 -1
@@ -3,10 +3,20 @@
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as Shared from './shared';
5
5
  import * as WebhookEventsAPI from './webhook-events';
6
+ import { Webhook } from 'standardwebhooks';
6
7
 
7
8
  export class Webhooks extends APIResource {
8
- events(body: string): EventsWebhookEvent {
9
- return JSON.parse(body) as EventsWebhookEvent;
9
+ unwrap(
10
+ body: string,
11
+ { headers, key }: { headers: Record<string, string>; key?: string },
12
+ ): UnwrapWebhookEvent {
13
+ if (headers !== undefined) {
14
+ const keyStr: string | null = key === undefined ? this._client.webhookSecret : key;
15
+ if (keyStr === null) throw new Error('Webhook key must not be null in order to unwrap');
16
+ const wh = new Webhook(keyStr);
17
+ wh.verify(body, headers);
18
+ }
19
+ return JSON.parse(body) as UnwrapWebhookEvent;
10
20
  }
11
21
  }
12
22
 
@@ -50,7 +60,12 @@ export interface MessageEventV2 {
50
60
  /**
51
61
  * Message parts (text and/or media)
52
62
  */
53
- parts: Array<SchemasTextPartResponse | SchemasMediaPartResponse | MessageEventV2.SchemasLinkPartResponse>;
63
+ parts: Array<
64
+ | SchemasTextPartResponse
65
+ | SchemasMediaPartResponse
66
+ | MessageEventV2.SchemasLinkPartResponse
67
+ | MessageEventV2.SchemasIMessageAppPartResponse
68
+ >;
54
69
 
55
70
  /**
56
71
  * The handle that sent this message
@@ -183,6 +198,108 @@ export namespace MessageEventV2 {
183
198
  value: string;
184
199
  }
185
200
 
201
+ /**
202
+ * An iMessage app card part.
203
+ */
204
+ export interface SchemasIMessageAppPartResponse {
205
+ /**
206
+ * Identifies the iMessage app (Messages app extension) that backs the card.
207
+ */
208
+ app: SchemasIMessageAppPartResponse.App;
209
+
210
+ /**
211
+ * Visible layout of the card.
212
+ */
213
+ layout: SchemasIMessageAppPartResponse.Layout;
214
+
215
+ /**
216
+ * Indicates this is an iMessage app card part.
217
+ */
218
+ type: 'imessage_app';
219
+
220
+ /**
221
+ * The URL delivered to the iMessage app on tap.
222
+ */
223
+ url: string;
224
+
225
+ /**
226
+ * Fallback text for surfaces that cannot render the card.
227
+ */
228
+ fallback_text?: string | null;
229
+
230
+ /**
231
+ * Client-supplied session identifier, echoed back when provided.
232
+ */
233
+ session_id?: string | null;
234
+ }
235
+
236
+ export namespace SchemasIMessageAppPartResponse {
237
+ /**
238
+ * Identifies the iMessage app (Messages app extension) that backs the card.
239
+ */
240
+ export interface App {
241
+ /**
242
+ * Bundle identifier of the Messages app extension.
243
+ */
244
+ bundle_id: string;
245
+
246
+ /**
247
+ * Display name of the app.
248
+ */
249
+ name: string;
250
+
251
+ /**
252
+ * The app's 10-character team identifier.
253
+ */
254
+ team_id: string;
255
+
256
+ /**
257
+ * The owning app's App Store id, when known.
258
+ */
259
+ app_store_id?: number | null;
260
+ }
261
+
262
+ /**
263
+ * Visible layout of the card.
264
+ */
265
+ export interface Layout {
266
+ /**
267
+ * Primary label, top-left and bold.
268
+ */
269
+ caption?: string | null;
270
+
271
+ /**
272
+ * Overlay text shown below image_title.
273
+ */
274
+ image_subtitle?: string | null;
275
+
276
+ /**
277
+ * Overlay text shown above the image.
278
+ */
279
+ image_title?: string | null;
280
+
281
+ /**
282
+ * Presigned URL of the card preview image, when present.
283
+ */
284
+ image_url?: string | null;
285
+
286
+ /**
287
+ * Secondary label, below caption on the left.
288
+ */
289
+ subcaption?: string | null;
290
+
291
+ /**
292
+ * Label shown top-right.
293
+ */
294
+ trailing_caption?: string | null;
295
+
296
+ /**
297
+ * Label shown below trailing_caption.
298
+ */
299
+ trailing_subcaption?: string | null;
300
+ }
301
+ }
302
+
186
303
  /**
187
304
  * Reference to the message this is replying to (for threaded replies)
188
305
  */
@@ -236,7 +353,12 @@ export interface MessagePayload {
236
353
  /**
237
354
  * Message content parts (text and/or media)
238
355
  */
239
- parts?: Array<SchemasTextPartResponse | SchemasMediaPartResponse | MessagePayload.SchemasLinkPartResponse>;
356
+ parts?: Array<
357
+ | SchemasTextPartResponse
358
+ | SchemasMediaPartResponse
359
+ | MessagePayload.SchemasLinkPartResponse
360
+ | MessagePayload.SchemasIMessageAppPartResponse
361
+ >;
240
362
 
241
363
  /**
242
364
  * When the message was read
@@ -275,6 +397,108 @@ export namespace MessagePayload {
275
397
  value: string;
276
398
  }
277
399
 
400
+ /**
401
+ * An iMessage app card part.
402
+ */
403
+ export interface SchemasIMessageAppPartResponse {
404
+ /**
405
+ * Identifies the iMessage app (Messages app extension) that backs the card.
406
+ */
407
+ app: SchemasIMessageAppPartResponse.App;
408
+
409
+ /**
410
+ * Visible layout of the card.
411
+ */
412
+ layout: SchemasIMessageAppPartResponse.Layout;
413
+
414
+ /**
415
+ * Indicates this is an iMessage app card part.
416
+ */
417
+ type: 'imessage_app';
418
+
419
+ /**
420
+ * The URL delivered to the iMessage app on tap.
421
+ */
422
+ url: string;
423
+
424
+ /**
425
+ * Fallback text for surfaces that cannot render the card.
426
+ */
427
+ fallback_text?: string | null;
428
+
429
+ /**
430
+ * Client-supplied session identifier, echoed back when provided.
431
+ */
432
+ session_id?: string | null;
433
+ }
434
+
435
+ export namespace SchemasIMessageAppPartResponse {
436
+ /**
437
+ * Identifies the iMessage app (Messages app extension) that backs the card.
438
+ */
439
+ export interface App {
440
+ /**
441
+ * Bundle identifier of the Messages app extension.
442
+ */
443
+ bundle_id: string;
444
+
445
+ /**
446
+ * Display name of the app.
447
+ */
448
+ name: string;
449
+
450
+ /**
451
+ * The app's 10-character team identifier.
452
+ */
453
+ team_id: string;
454
+
455
+ /**
456
+ * The owning app's App Store id, when known.
457
+ */
458
+ app_store_id?: number | null;
459
+ }
460
+
461
+ /**
462
+ * Visible layout of the card.
463
+ */
464
+ export interface Layout {
465
+ /**
466
+ * Primary label, top-left and bold.
467
+ */
468
+ caption?: string | null;
469
+
470
+ /**
471
+ * Overlay text shown below image_title.
472
+ */
473
+ image_subtitle?: string | null;
474
+
475
+ /**
476
+ * Overlay text shown above the image.
477
+ */
478
+ image_title?: string | null;
479
+
480
+ /**
481
+ * Presigned URL of the card preview image, when present.
482
+ */
483
+ image_url?: string | null;
484
+
485
+ /**
486
+ * Secondary label, below caption on the left.
487
+ */
488
+ subcaption?: string | null;
489
+
490
+ /**
491
+ * Label shown top-right.
492
+ */
493
+ trailing_caption?: string | null;
494
+
495
+ /**
496
+ * Label shown below trailing_caption.
497
+ */
498
+ trailing_subcaption?: string | null;
499
+ }
500
+ }
501
+
278
502
  /**
279
503
  * Reference to the message this is replying to
280
504
  */
@@ -1966,7 +2190,7 @@ export namespace PhoneNumberStatusUpdatedWebhookEvent {
1966
2190
  /**
1967
2191
  * Complete webhook payload for message.sent events (2026-02-03 format)
1968
2192
  */
1969
- export type EventsWebhookEvent =
2193
+ export type UnwrapWebhookEvent =
1970
2194
  | MessageSentWebhookEvent
1971
2195
  | MessageReceivedWebhookEvent
1972
2196
  | MessageReadWebhookEvent
@@ -2012,6 +2236,6 @@ export declare namespace Webhooks {
2012
2236
  type ChatTypingIndicatorStartedWebhookEvent as ChatTypingIndicatorStartedWebhookEvent,
2013
2237
  type ChatTypingIndicatorStoppedWebhookEvent as ChatTypingIndicatorStoppedWebhookEvent,
2014
2238
  type PhoneNumberStatusUpdatedWebhookEvent as PhoneNumberStatusUpdatedWebhookEvent,
2015
- type EventsWebhookEvent as EventsWebhookEvent,
2239
+ type UnwrapWebhookEvent as UnwrapWebhookEvent,
2016
2240
  };
2017
2241
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.26.0'; // x-release-please-version
1
+ export const VERSION = '0.27.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.26.0";
1
+ export declare const VERSION = "0.27.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.26.0";
1
+ export declare const VERSION = "0.27.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.26.0'; // x-release-please-version
4
+ exports.VERSION = '0.27.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.26.0'; // x-release-please-version
1
+ export const VERSION = '0.27.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map