@productcraft/notify 0.2.0 → 0.4.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.
@@ -7,13 +7,13 @@ export { SignWebhookParams, SignedWebhook, signWebhook } from '@productcraft/cor
7
7
  *
8
8
  * @example
9
9
  * ```ts
10
- * const { payload, headers } = await signWebhook({ payload: { id: "evt_test_1", type: "credential.invalid", created_at: new Date().toISOString(), data: {} }, secret });
10
+ * const { payload, headers } = await signWebhook({ payload: { id: "evt_test_1", type: "approval.resolved", created_at: new Date().toISOString(), data: {} }, secret });
11
11
  * const res = await fetch("http://localhost:3000/webhooks", { method: "POST", headers, body: payload });
12
12
  * ```
13
13
  */
14
14
 
15
15
  /** Every operation name, as `resource.method`. */
16
- type OperationName = "categories.create" | "categories.delete" | "categories.list" | "categories.retrieve" | "categories.update" | "channels.apns.deleteCredential" | "channels.apns.uploadCredential" | "channels.fcm.deleteCredential" | "channels.fcm.uploadCredential" | "channels.list" | "channels.webpush.generateVapidKeys" | "channels.webpush.importVapidKeys" | "channels.webpush.retrieve" | "deliveries.list" | "deliveries.retrieve" | "export.retrieve" | "me.devices.delete" | "me.devices.register" | "me.inbox.counts" | "me.inbox.interact" | "me.inbox.list" | "me.inbox.mark" | "me.preferences.retrieve" | "me.preferences.update" | "me.webpush.vapidPublicKey" | "notificationTypes.archive" | "notificationTypes.create" | "notificationTypes.list" | "notificationTypes.preview" | "notificationTypes.replaceByKey" | "notificationTypes.retrieve" | "notificationTypes.templates.delete" | "notificationTypes.templates.retrieve" | "notificationTypes.templates.revert" | "notificationTypes.templates.update" | "notificationTypes.templates.versions" | "notificationTypes.update" | "notifications.cancel" | "notifications.cancelByKey" | "notifications.list" | "notifications.retract" | "notifications.retrieve" | "notifications.send" | "recipientTokens.mint" | "recipients.bulkIdentify" | "recipients.delete" | "recipients.devices.create" | "recipients.devices.delete" | "recipients.devices.list" | "recipients.identify" | "recipients.inbox.list" | "recipients.list" | "recipients.preferences.replace" | "recipients.preferences.retrieve" | "recipients.preferences.update" | "recipients.retrieve" | "recipients.revokeTokens" | "recipients.timeline" | "recipients.update" | "settings.retrieve" | "settings.revokeAllTokens" | "settings.update" | "setupStatus.retrieve" | "stats.retrieve" | "webhooks.endpoints.create" | "webhooks.endpoints.delete" | "webhooks.endpoints.list" | "webhooks.endpoints.retrieve" | "webhooks.endpoints.rotateSecret" | "webhooks.endpoints.test" | "webhooks.endpoints.update" | "webhooks.eventTypes.list" | "webhooks.events.list" | "webhooks.events.replay" | "webhooks.events.retrieve";
16
+ type OperationName = "approvals.cancel" | "approvals.create" | "approvals.list" | "approvals.recordDecision" | "approvals.retrieve" | "batches.flush" | "batches.list" | "batches.retrieve" | "categories.create" | "categories.delete" | "categories.list" | "categories.retrieve" | "categories.update" | "channels.apns.deleteCredential" | "channels.apns.uploadCredential" | "channels.fcm.deleteCredential" | "channels.fcm.uploadCredential" | "channels.list" | "channels.webpush.generateVapidKeys" | "channels.webpush.importVapidKeys" | "channels.webpush.retrieve" | "deliveries.list" | "deliveries.retrieve" | "export.retrieve" | "me.approvals.decide" | "me.approvals.retrieve" | "me.devices.delete" | "me.devices.register" | "me.inbox.counts" | "me.inbox.interact" | "me.inbox.list" | "me.inbox.mark" | "me.preferences.retrieve" | "me.preferences.update" | "me.webpush.vapidPublicKey" | "notificationTypes.archive" | "notificationTypes.create" | "notificationTypes.list" | "notificationTypes.preview" | "notificationTypes.replaceByKey" | "notificationTypes.retrieve" | "notificationTypes.templates.delete" | "notificationTypes.templates.retrieve" | "notificationTypes.templates.revert" | "notificationTypes.templates.update" | "notificationTypes.templates.versions" | "notificationTypes.update" | "notifications.cancel" | "notifications.cancelByKey" | "notifications.list" | "notifications.retract" | "notifications.retrieve" | "notifications.send" | "recipientTokens.mint" | "recipients.bulkIdentify" | "recipients.createPreferenceLink" | "recipients.delete" | "recipients.devices.create" | "recipients.devices.delete" | "recipients.devices.list" | "recipients.identify" | "recipients.inbox.list" | "recipients.list" | "recipients.preferences.replace" | "recipients.preferences.retrieve" | "recipients.preferences.update" | "recipients.retrieve" | "recipients.revokeTokens" | "recipients.timeline" | "recipients.update" | "settings.retrieve" | "settings.revokeAllTokens" | "settings.update" | "setupStatus.retrieve" | "stats.retrieve" | "webhooks.endpoints.create" | "webhooks.endpoints.delete" | "webhooks.endpoints.list" | "webhooks.endpoints.retrieve" | "webhooks.endpoints.rotateSecret" | "webhooks.endpoints.test" | "webhooks.endpoints.update" | "webhooks.eventTypes.list" | "webhooks.events.list" | "webhooks.events.replay" | "webhooks.events.retrieve";
17
17
  /** One request the mock received. */
18
18
  interface MockCall {
19
19
  /** The matched operation, or `undefined` when nothing matched (the mock answers 404). */
package/dist/testing.d.ts CHANGED
@@ -7,13 +7,13 @@ export { SignWebhookParams, SignedWebhook, signWebhook } from '@productcraft/cor
7
7
  *
8
8
  * @example
9
9
  * ```ts
10
- * const { payload, headers } = await signWebhook({ payload: { id: "evt_test_1", type: "credential.invalid", created_at: new Date().toISOString(), data: {} }, secret });
10
+ * const { payload, headers } = await signWebhook({ payload: { id: "evt_test_1", type: "approval.resolved", created_at: new Date().toISOString(), data: {} }, secret });
11
11
  * const res = await fetch("http://localhost:3000/webhooks", { method: "POST", headers, body: payload });
12
12
  * ```
13
13
  */
14
14
 
15
15
  /** Every operation name, as `resource.method`. */
16
- type OperationName = "categories.create" | "categories.delete" | "categories.list" | "categories.retrieve" | "categories.update" | "channels.apns.deleteCredential" | "channels.apns.uploadCredential" | "channels.fcm.deleteCredential" | "channels.fcm.uploadCredential" | "channels.list" | "channels.webpush.generateVapidKeys" | "channels.webpush.importVapidKeys" | "channels.webpush.retrieve" | "deliveries.list" | "deliveries.retrieve" | "export.retrieve" | "me.devices.delete" | "me.devices.register" | "me.inbox.counts" | "me.inbox.interact" | "me.inbox.list" | "me.inbox.mark" | "me.preferences.retrieve" | "me.preferences.update" | "me.webpush.vapidPublicKey" | "notificationTypes.archive" | "notificationTypes.create" | "notificationTypes.list" | "notificationTypes.preview" | "notificationTypes.replaceByKey" | "notificationTypes.retrieve" | "notificationTypes.templates.delete" | "notificationTypes.templates.retrieve" | "notificationTypes.templates.revert" | "notificationTypes.templates.update" | "notificationTypes.templates.versions" | "notificationTypes.update" | "notifications.cancel" | "notifications.cancelByKey" | "notifications.list" | "notifications.retract" | "notifications.retrieve" | "notifications.send" | "recipientTokens.mint" | "recipients.bulkIdentify" | "recipients.delete" | "recipients.devices.create" | "recipients.devices.delete" | "recipients.devices.list" | "recipients.identify" | "recipients.inbox.list" | "recipients.list" | "recipients.preferences.replace" | "recipients.preferences.retrieve" | "recipients.preferences.update" | "recipients.retrieve" | "recipients.revokeTokens" | "recipients.timeline" | "recipients.update" | "settings.retrieve" | "settings.revokeAllTokens" | "settings.update" | "setupStatus.retrieve" | "stats.retrieve" | "webhooks.endpoints.create" | "webhooks.endpoints.delete" | "webhooks.endpoints.list" | "webhooks.endpoints.retrieve" | "webhooks.endpoints.rotateSecret" | "webhooks.endpoints.test" | "webhooks.endpoints.update" | "webhooks.eventTypes.list" | "webhooks.events.list" | "webhooks.events.replay" | "webhooks.events.retrieve";
16
+ type OperationName = "approvals.cancel" | "approvals.create" | "approvals.list" | "approvals.recordDecision" | "approvals.retrieve" | "batches.flush" | "batches.list" | "batches.retrieve" | "categories.create" | "categories.delete" | "categories.list" | "categories.retrieve" | "categories.update" | "channels.apns.deleteCredential" | "channels.apns.uploadCredential" | "channels.fcm.deleteCredential" | "channels.fcm.uploadCredential" | "channels.list" | "channels.webpush.generateVapidKeys" | "channels.webpush.importVapidKeys" | "channels.webpush.retrieve" | "deliveries.list" | "deliveries.retrieve" | "export.retrieve" | "me.approvals.decide" | "me.approvals.retrieve" | "me.devices.delete" | "me.devices.register" | "me.inbox.counts" | "me.inbox.interact" | "me.inbox.list" | "me.inbox.mark" | "me.preferences.retrieve" | "me.preferences.update" | "me.webpush.vapidPublicKey" | "notificationTypes.archive" | "notificationTypes.create" | "notificationTypes.list" | "notificationTypes.preview" | "notificationTypes.replaceByKey" | "notificationTypes.retrieve" | "notificationTypes.templates.delete" | "notificationTypes.templates.retrieve" | "notificationTypes.templates.revert" | "notificationTypes.templates.update" | "notificationTypes.templates.versions" | "notificationTypes.update" | "notifications.cancel" | "notifications.cancelByKey" | "notifications.list" | "notifications.retract" | "notifications.retrieve" | "notifications.send" | "recipientTokens.mint" | "recipients.bulkIdentify" | "recipients.createPreferenceLink" | "recipients.delete" | "recipients.devices.create" | "recipients.devices.delete" | "recipients.devices.list" | "recipients.identify" | "recipients.inbox.list" | "recipients.list" | "recipients.preferences.replace" | "recipients.preferences.retrieve" | "recipients.preferences.update" | "recipients.retrieve" | "recipients.revokeTokens" | "recipients.timeline" | "recipients.update" | "settings.retrieve" | "settings.revokeAllTokens" | "settings.update" | "setupStatus.retrieve" | "stats.retrieve" | "webhooks.endpoints.create" | "webhooks.endpoints.delete" | "webhooks.endpoints.list" | "webhooks.endpoints.retrieve" | "webhooks.endpoints.rotateSecret" | "webhooks.endpoints.test" | "webhooks.endpoints.update" | "webhooks.eventTypes.list" | "webhooks.events.list" | "webhooks.events.replay" | "webhooks.events.retrieve";
17
17
  /** One request the mock received. */
18
18
  interface MockCall {
19
19
  /** The matched operation, or `undefined` when nothing matched (the mock answers 404). */
package/dist/testing.js CHANGED
@@ -133,7 +133,18 @@ var ROUTES = [
133
133
  ]
134
134
  } },
135
135
  { op: "notificationTypes.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types$/, status: 201, contentType: "application/json", body: {
136
+ approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
136
137
  archived_at: "2026-01-01T00:00:00.000Z",
138
+ batch: {
139
+ inbox: "collapse",
140
+ key: "string",
141
+ max_items: 1,
142
+ max_window_seconds: 1,
143
+ mode: "window",
144
+ schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
145
+ sliding: true,
146
+ window_seconds: 1
147
+ },
137
148
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
138
149
  category_key: "string",
139
150
  created_at: "2026-01-01T00:00:00.000Z",
@@ -156,7 +167,18 @@ var ROUTES = [
156
167
  { op: "notificationTypes.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types$/, status: 200, contentType: "application/json", body: {
157
168
  data: [
158
169
  {
170
+ approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
159
171
  archived_at: "2026-01-01T00:00:00.000Z",
172
+ batch: {
173
+ inbox: "collapse",
174
+ key: "string",
175
+ max_items: 1,
176
+ max_window_seconds: 1,
177
+ mode: "window",
178
+ schedule: { frequency: null, time: "09:00", weekday: null },
179
+ sliding: true,
180
+ window_seconds: 1
181
+ },
160
182
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
161
183
  category_key: "string",
162
184
  created_at: "2026-01-01T00:00:00.000Z",
@@ -278,6 +300,23 @@ var ROUTES = [
278
300
  ],
279
301
  pagination: { next_cursor: null, has_more: false }
280
302
  } },
303
+ { op: "me.approvals.decide", method: "POST", pattern: /^\/v1\/client\/approvals\/[^\/]+\/decision$/, status: 200, contentType: "application/json", body: {
304
+ approvers: ["string"],
305
+ body: "string",
306
+ created_at: "2026-01-01T00:00:00.000Z",
307
+ decided_at: "2026-01-01T00:00:00.000Z",
308
+ decided_by: "string",
309
+ decided_via: "inbox",
310
+ expires_at: "2026-01-01T00:00:00.000Z",
311
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
312
+ metadata: {},
313
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
314
+ reason: "string",
315
+ requester: { id: "string", kind: "agent", name: "string" },
316
+ status: "pending",
317
+ title: "string",
318
+ type: "deploy.approval"
319
+ } },
281
320
  { op: "notifications.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notifications$/, status: 200, contentType: "application/json", body: {
282
321
  data: [
283
322
  {
@@ -310,6 +349,12 @@ var ROUTES = [
310
349
  dry_run: true,
311
350
  plan: [
312
351
  {
352
+ batch: {
353
+ batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
354
+ flush_at: "2026-01-01T00:00:00.000Z",
355
+ item_count: 1,
356
+ key: "string"
357
+ },
313
358
  channel: "inbox",
314
359
  decision: "deliver",
315
360
  explanation: "string",
@@ -373,6 +418,7 @@ var ROUTES = [
373
418
  data: [
374
419
  {
375
420
  attempts: 1,
421
+ batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
376
422
  channel: "inbox",
377
423
  created_at: "2026-01-01T00:00:00.000Z",
378
424
  device_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
@@ -443,6 +489,45 @@ var ROUTES = [
443
489
  ],
444
490
  pagination: { next_cursor: null, has_more: false }
445
491
  } },
492
+ { op: "approvals.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/approvals$/, status: 200, contentType: "application/json", body: {
493
+ approvers: ["string"],
494
+ body: "string",
495
+ created_at: "2026-01-01T00:00:00.000Z",
496
+ decided_at: "2026-01-01T00:00:00.000Z",
497
+ decided_by: "string",
498
+ decided_via: "inbox",
499
+ expires_at: "2026-01-01T00:00:00.000Z",
500
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
501
+ metadata: {},
502
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
503
+ reason: "string",
504
+ requester: { id: "string", kind: "agent", name: "string" },
505
+ status: "pending",
506
+ title: "string",
507
+ type: "deploy.approval"
508
+ } },
509
+ { op: "approvals.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/approvals$/, status: 200, contentType: "application/json", body: {
510
+ data: [
511
+ {
512
+ approvers: ["string"],
513
+ body: "string",
514
+ created_at: "2026-01-01T00:00:00.000Z",
515
+ decided_at: "2026-01-01T00:00:00.000Z",
516
+ decided_by: "string",
517
+ decided_via: "inbox",
518
+ expires_at: "2026-01-01T00:00:00.000Z",
519
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
520
+ metadata: {},
521
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
522
+ reason: "string",
523
+ requester: { id: "string", kind: "agent", name: "string" },
524
+ status: "pending",
525
+ title: "string",
526
+ type: "deploy.approval"
527
+ }
528
+ ],
529
+ pagination: { next_cursor: null, has_more: false }
530
+ } },
446
531
  { op: "channels.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/channels$/, status: 200, contentType: "application/json", body: {
447
532
  data: [
448
533
  {
@@ -472,6 +557,12 @@ var ROUTES = [
472
557
  ]
473
558
  } },
474
559
  { op: "settings.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/settings$/, status: 200, contentType: "application/json", body: {
560
+ branding: {
561
+ accent_color: "#4f46e5",
562
+ logo_url: "https://example.com",
563
+ name: "Acme",
564
+ privacy_url: "https://example.com"
565
+ },
475
566
  client_origins: ["https://app.example.com"],
476
567
  default_quiet_hours: { end: "08:00", start: "22:00" },
477
568
  default_timezone: "Europe/Lisbon",
@@ -481,6 +572,12 @@ var ROUTES = [
481
572
  email_resumed_at: "2026-01-01T00:00:00.000Z"
482
573
  } },
483
574
  { op: "settings.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/settings$/, status: 200, contentType: "application/json", body: {
575
+ branding: {
576
+ accent_color: "#4f46e5",
577
+ logo_url: "https://example.com",
578
+ name: "Acme",
579
+ privacy_url: "https://example.com"
580
+ },
484
581
  client_origins: ["https://app.example.com"],
485
582
  default_quiet_hours: { end: "08:00", start: "22:00" },
486
583
  default_timezone: "Europe/Lisbon",
@@ -489,6 +586,22 @@ var ROUTES = [
489
586
  email_paused_reason: "string",
490
587
  email_resumed_at: "2026-01-01T00:00:00.000Z"
491
588
  } },
589
+ { op: "batches.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/batches$/, status: 200, contentType: "application/json", body: {
590
+ data: [
591
+ {
592
+ flush_at: "2026-01-01T00:00:00.000Z",
593
+ flushed_at: "2026-01-01T00:00:00.000Z",
594
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
595
+ item_count: 1,
596
+ key: "p_42",
597
+ opened_at: "2026-01-01T00:00:00.000Z",
598
+ recipient: "user_123",
599
+ state: "open",
600
+ type: "comment.created"
601
+ }
602
+ ],
603
+ pagination: { next_cursor: null, has_more: false }
604
+ } },
492
605
  { op: "export.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/export$/, status: 200, contentType: "application/json", body: {
493
606
  categories: [
494
607
  {
@@ -507,7 +620,18 @@ var ROUTES = [
507
620
  exported_at: "2026-01-01T00:00:00.000Z",
508
621
  notification_types: [
509
622
  {
623
+ approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
510
624
  archived_at: "2026-01-01T00:00:00.000Z",
625
+ batch: {
626
+ inbox: "collapse",
627
+ key: "string",
628
+ max_items: 1,
629
+ max_window_seconds: 1,
630
+ mode: "window",
631
+ schedule: { frequency: null, time: "09:00", weekday: null },
632
+ sliding: true,
633
+ window_seconds: 1
634
+ },
511
635
  category_key: "string",
512
636
  critical: true,
513
637
  default_locale: "string",
@@ -528,6 +652,23 @@ var ROUTES = [
528
652
  email_enabled: true
529
653
  }
530
654
  } },
655
+ { op: "me.approvals.retrieve", method: "GET", pattern: /^\/v1\/client\/approvals\/[^\/]+$/, status: 200, contentType: "application/json", body: {
656
+ approvers: ["string"],
657
+ body: "string",
658
+ created_at: "2026-01-01T00:00:00.000Z",
659
+ decided_at: "2026-01-01T00:00:00.000Z",
660
+ decided_by: "string",
661
+ decided_via: "inbox",
662
+ expires_at: "2026-01-01T00:00:00.000Z",
663
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
664
+ metadata: {},
665
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
666
+ reason: "string",
667
+ requester: { id: "string", kind: "agent", name: "string" },
668
+ status: "pending",
669
+ title: "string",
670
+ type: "deploy.approval"
671
+ } },
531
672
  { op: "stats.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/stats$/, status: 200, contentType: "application/json", body: {
532
673
  data: [
533
674
  {
@@ -569,7 +710,18 @@ var ROUTES = [
569
710
  url: "https://api.acme.com/webhooks"
570
711
  } },
571
712
  { op: "notificationTypes.archive", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+\/archive$/, status: 200, contentType: "application/json", body: {
713
+ approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
572
714
  archived_at: "2026-01-01T00:00:00.000Z",
715
+ batch: {
716
+ inbox: "collapse",
717
+ key: "string",
718
+ max_items: 1,
719
+ max_window_seconds: 1,
720
+ mode: "window",
721
+ schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
722
+ sliding: true,
723
+ window_seconds: 1
724
+ },
573
725
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
574
726
  category_key: "string",
575
727
  created_at: "2026-01-01T00:00:00.000Z",
@@ -601,9 +753,25 @@ var ROUTES = [
601
753
  ],
602
754
  cross_channel_mismatches: {}
603
755
  } },
756
+ { op: "recipients.createPreferenceLink", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/recipients\/[^\/]+\/preference-link$/, status: 201, contentType: "application/json", body: {
757
+ category_key: "string",
758
+ expires_at: "2026-01-01T00:00:00.000Z",
759
+ url: "https://api.notify.productcraft.co/v1/preferences/p1.AQ\u2026"
760
+ } },
604
761
  { op: "channels.apns.deleteCredential", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/channels\/apns\/credentials\/[^\/]+$/, status: 204, contentType: null, body: null },
605
762
  { op: "notificationTypes.replaceByKey", method: "PUT", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/by-key\/[^\/]+$/, status: 200, contentType: "application/json", body: {
763
+ approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
606
764
  archived_at: "2026-01-01T00:00:00.000Z",
765
+ batch: {
766
+ inbox: "collapse",
767
+ key: "string",
768
+ max_items: 1,
769
+ max_window_seconds: 1,
770
+ mode: "window",
771
+ schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
772
+ sliding: true,
773
+ window_seconds: 1
774
+ },
607
775
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
608
776
  category_key: "string",
609
777
  created_at: "2026-01-01T00:00:00.000Z",
@@ -712,6 +880,7 @@ var ROUTES = [
712
880
  data: [
713
881
  {
714
882
  attempts: 1,
883
+ batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
715
884
  channel: "inbox",
716
885
  created_at: "2026-01-01T00:00:00.000Z",
717
886
  device: {
@@ -753,8 +922,36 @@ var ROUTES = [
753
922
  ],
754
923
  pagination: { next_cursor: null, has_more: false }
755
924
  } },
925
+ { op: "approvals.recordDecision", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/approvals\/[^\/]+\/decision$/, status: 200, contentType: "application/json", body: {
926
+ approvers: ["string"],
927
+ body: "string",
928
+ created_at: "2026-01-01T00:00:00.000Z",
929
+ decided_at: "2026-01-01T00:00:00.000Z",
930
+ decided_by: "string",
931
+ decided_via: "inbox",
932
+ expires_at: "2026-01-01T00:00:00.000Z",
933
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
934
+ metadata: {},
935
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
936
+ reason: "string",
937
+ requester: { id: "string", kind: "agent", name: "string" },
938
+ status: "pending",
939
+ title: "string",
940
+ type: "deploy.approval"
941
+ } },
756
942
  { op: "notificationTypes.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+$/, status: 200, contentType: "application/json", body: {
943
+ approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
757
944
  archived_at: "2026-01-01T00:00:00.000Z",
945
+ batch: {
946
+ inbox: "collapse",
947
+ key: "string",
948
+ max_items: 1,
949
+ max_window_seconds: 1,
950
+ mode: "window",
951
+ schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
952
+ sliding: true,
953
+ window_seconds: 1
954
+ },
758
955
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
759
956
  category_key: "string",
760
957
  created_at: "2026-01-01T00:00:00.000Z",
@@ -775,7 +972,18 @@ var ROUTES = [
775
972
  version: 1
776
973
  } },
777
974
  { op: "notificationTypes.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+$/, status: 200, contentType: "application/json", body: {
975
+ approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
778
976
  archived_at: "2026-01-01T00:00:00.000Z",
977
+ batch: {
978
+ inbox: "collapse",
979
+ key: "string",
980
+ max_items: 1,
981
+ max_window_seconds: 1,
982
+ mode: "window",
983
+ schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
984
+ sliding: true,
985
+ window_seconds: 1
986
+ },
779
987
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
780
988
  category_key: "string",
781
989
  created_at: "2026-01-01T00:00:00.000Z",
@@ -870,6 +1078,23 @@ var ROUTES = [
870
1078
  updated_at: "2026-01-01T00:00:00.000Z",
871
1079
  url: "https://api.acme.com/webhooks"
872
1080
  } },
1081
+ { op: "approvals.cancel", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/approvals\/[^\/]+\/cancel$/, status: 200, contentType: "application/json", body: {
1082
+ approvers: ["string"],
1083
+ body: "string",
1084
+ created_at: "2026-01-01T00:00:00.000Z",
1085
+ decided_at: "2026-01-01T00:00:00.000Z",
1086
+ decided_by: "string",
1087
+ decided_via: "inbox",
1088
+ expires_at: "2026-01-01T00:00:00.000Z",
1089
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1090
+ metadata: {},
1091
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1092
+ reason: "string",
1093
+ requester: { id: "string", kind: "agent", name: "string" },
1094
+ status: "pending",
1095
+ title: "string",
1096
+ type: "deploy.approval"
1097
+ } },
873
1098
  { op: "recipients.inbox.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/recipients\/[^\/]+\/inbox$/, status: 200, contentType: "application/json", body: {
874
1099
  counts: { unread: 1, unseen: 1 },
875
1100
  data: [
@@ -932,6 +1157,31 @@ var ROUTES = [
932
1157
  test: true,
933
1158
  type: "notification.accepted"
934
1159
  } },
1160
+ { op: "batches.flush", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/batches\/[^\/]+\/flush$/, status: 200, contentType: "application/json", body: {
1161
+ batch: {
1162
+ deliveries: [
1163
+ {
1164
+ channel: "string",
1165
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1166
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1167
+ reason: "string",
1168
+ state: "string"
1169
+ }
1170
+ ],
1171
+ flush_at: "2026-01-01T00:00:00.000Z",
1172
+ flushed_at: "2026-01-01T00:00:00.000Z",
1173
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1174
+ item_count: 1,
1175
+ key: "p_42",
1176
+ notification_ids: ["9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"],
1177
+ opened_at: "2026-01-01T00:00:00.000Z",
1178
+ payload: {},
1179
+ recipient: "user_123",
1180
+ state: "open",
1181
+ type: "comment.created"
1182
+ },
1183
+ merged: 1
1184
+ } },
935
1185
  { op: "notifications.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notifications\/[^\/]+$/, status: 200, contentType: "application/json", body: {
936
1186
  actor: { avatar_url: "string", external_id: "string", name: "string" },
937
1187
  caller: "string",
@@ -993,6 +1243,7 @@ var ROUTES = [
993
1243
  retry_after_s: 1
994
1244
  }
995
1245
  ],
1246
+ batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
996
1247
  channel: "inbox",
997
1248
  created_at: "2026-01-01T00:00:00.000Z",
998
1249
  device_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
@@ -1073,6 +1324,46 @@ var ROUTES = [
1073
1324
  unsubscribed_all: true,
1074
1325
  updated_at: "2026-01-01T00:00:00.000Z"
1075
1326
  } },
1327
+ { op: "approvals.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/approvals\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1328
+ approvers: ["string"],
1329
+ body: "string",
1330
+ created_at: "2026-01-01T00:00:00.000Z",
1331
+ decided_at: "2026-01-01T00:00:00.000Z",
1332
+ decided_by: "string",
1333
+ decided_via: "inbox",
1334
+ events: [{ actor: "string", at: "2026-01-01T00:00:00.000Z", detail: {}, kind: "decided" }],
1335
+ expires_at: "2026-01-01T00:00:00.000Z",
1336
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1337
+ metadata: {},
1338
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1339
+ reason: "string",
1340
+ requester: { id: "string", kind: "agent", name: "string" },
1341
+ status: "pending",
1342
+ title: "string",
1343
+ type: "deploy.approval"
1344
+ } },
1345
+ { op: "batches.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/batches\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1346
+ deliveries: [
1347
+ {
1348
+ channel: "string",
1349
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1350
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1351
+ reason: "string",
1352
+ state: "string"
1353
+ }
1354
+ ],
1355
+ flush_at: "2026-01-01T00:00:00.000Z",
1356
+ flushed_at: "2026-01-01T00:00:00.000Z",
1357
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1358
+ item_count: 1,
1359
+ key: "p_42",
1360
+ notification_ids: ["9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"],
1361
+ opened_at: "2026-01-01T00:00:00.000Z",
1362
+ payload: {},
1363
+ recipient: "user_123",
1364
+ state: "open",
1365
+ type: "comment.created"
1366
+ } },
1076
1367
  { op: "recipients.devices.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/recipients\/[^\/]+\/devices\/[^\/]+$/, status: 204, contentType: null, body: null },
1077
1368
  { op: "notificationTypes.templates.versions", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+\/templates\/[^\/]+\/[^\/]+\/versions$/, status: 200, contentType: "application/json", body: {
1078
1369
  data: [{ actor: "string", body: {}, created_at: "2026-01-01T00:00:00.000Z", version: 1 }]