@productcraft/notify 0.2.0 → 0.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.
package/dist/testing.js CHANGED
@@ -134,6 +134,16 @@ var ROUTES = [
134
134
  } },
135
135
  { op: "notificationTypes.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types$/, status: 201, contentType: "application/json", body: {
136
136
  archived_at: "2026-01-01T00:00:00.000Z",
137
+ batch: {
138
+ inbox: "collapse",
139
+ key: "string",
140
+ max_items: 1,
141
+ max_window_seconds: 1,
142
+ mode: "window",
143
+ schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
144
+ sliding: true,
145
+ window_seconds: 1
146
+ },
137
147
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
138
148
  category_key: "string",
139
149
  created_at: "2026-01-01T00:00:00.000Z",
@@ -157,6 +167,16 @@ var ROUTES = [
157
167
  data: [
158
168
  {
159
169
  archived_at: "2026-01-01T00:00:00.000Z",
170
+ batch: {
171
+ inbox: "collapse",
172
+ key: "string",
173
+ max_items: 1,
174
+ max_window_seconds: 1,
175
+ mode: "window",
176
+ schedule: { frequency: null, time: "09:00", weekday: null },
177
+ sliding: true,
178
+ window_seconds: 1
179
+ },
160
180
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
161
181
  category_key: "string",
162
182
  created_at: "2026-01-01T00:00:00.000Z",
@@ -310,6 +330,12 @@ var ROUTES = [
310
330
  dry_run: true,
311
331
  plan: [
312
332
  {
333
+ batch: {
334
+ batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
335
+ flush_at: "2026-01-01T00:00:00.000Z",
336
+ item_count: 1,
337
+ key: "string"
338
+ },
313
339
  channel: "inbox",
314
340
  decision: "deliver",
315
341
  explanation: "string",
@@ -373,6 +399,7 @@ var ROUTES = [
373
399
  data: [
374
400
  {
375
401
  attempts: 1,
402
+ batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
376
403
  channel: "inbox",
377
404
  created_at: "2026-01-01T00:00:00.000Z",
378
405
  device_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
@@ -472,6 +499,12 @@ var ROUTES = [
472
499
  ]
473
500
  } },
474
501
  { op: "settings.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/settings$/, status: 200, contentType: "application/json", body: {
502
+ branding: {
503
+ accent_color: "#4f46e5",
504
+ logo_url: "https://example.com",
505
+ name: "Acme",
506
+ privacy_url: "https://example.com"
507
+ },
475
508
  client_origins: ["https://app.example.com"],
476
509
  default_quiet_hours: { end: "08:00", start: "22:00" },
477
510
  default_timezone: "Europe/Lisbon",
@@ -481,6 +514,12 @@ var ROUTES = [
481
514
  email_resumed_at: "2026-01-01T00:00:00.000Z"
482
515
  } },
483
516
  { op: "settings.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/settings$/, status: 200, contentType: "application/json", body: {
517
+ branding: {
518
+ accent_color: "#4f46e5",
519
+ logo_url: "https://example.com",
520
+ name: "Acme",
521
+ privacy_url: "https://example.com"
522
+ },
484
523
  client_origins: ["https://app.example.com"],
485
524
  default_quiet_hours: { end: "08:00", start: "22:00" },
486
525
  default_timezone: "Europe/Lisbon",
@@ -489,6 +528,22 @@ var ROUTES = [
489
528
  email_paused_reason: "string",
490
529
  email_resumed_at: "2026-01-01T00:00:00.000Z"
491
530
  } },
531
+ { op: "batches.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/batches$/, status: 200, contentType: "application/json", body: {
532
+ data: [
533
+ {
534
+ flush_at: "2026-01-01T00:00:00.000Z",
535
+ flushed_at: "2026-01-01T00:00:00.000Z",
536
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
537
+ item_count: 1,
538
+ key: "p_42",
539
+ opened_at: "2026-01-01T00:00:00.000Z",
540
+ recipient: "user_123",
541
+ state: "open",
542
+ type: "comment.created"
543
+ }
544
+ ],
545
+ pagination: { next_cursor: null, has_more: false }
546
+ } },
492
547
  { op: "export.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/export$/, status: 200, contentType: "application/json", body: {
493
548
  categories: [
494
549
  {
@@ -508,6 +563,16 @@ var ROUTES = [
508
563
  notification_types: [
509
564
  {
510
565
  archived_at: "2026-01-01T00:00:00.000Z",
566
+ batch: {
567
+ inbox: "collapse",
568
+ key: "string",
569
+ max_items: 1,
570
+ max_window_seconds: 1,
571
+ mode: "window",
572
+ schedule: { frequency: null, time: "09:00", weekday: null },
573
+ sliding: true,
574
+ window_seconds: 1
575
+ },
511
576
  category_key: "string",
512
577
  critical: true,
513
578
  default_locale: "string",
@@ -570,6 +635,16 @@ var ROUTES = [
570
635
  } },
571
636
  { op: "notificationTypes.archive", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+\/archive$/, status: 200, contentType: "application/json", body: {
572
637
  archived_at: "2026-01-01T00:00:00.000Z",
638
+ batch: {
639
+ inbox: "collapse",
640
+ key: "string",
641
+ max_items: 1,
642
+ max_window_seconds: 1,
643
+ mode: "window",
644
+ schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
645
+ sliding: true,
646
+ window_seconds: 1
647
+ },
573
648
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
574
649
  category_key: "string",
575
650
  created_at: "2026-01-01T00:00:00.000Z",
@@ -601,9 +676,24 @@ var ROUTES = [
601
676
  ],
602
677
  cross_channel_mismatches: {}
603
678
  } },
679
+ { op: "recipients.createPreferenceLink", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/recipients\/[^\/]+\/preference-link$/, status: 201, contentType: "application/json", body: {
680
+ category_key: "string",
681
+ expires_at: "2026-01-01T00:00:00.000Z",
682
+ url: "https://api.notify.productcraft.co/v1/preferences/p1.AQ\u2026"
683
+ } },
604
684
  { op: "channels.apns.deleteCredential", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/channels\/apns\/credentials\/[^\/]+$/, status: 204, contentType: null, body: null },
605
685
  { op: "notificationTypes.replaceByKey", method: "PUT", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/by-key\/[^\/]+$/, status: 200, contentType: "application/json", body: {
606
686
  archived_at: "2026-01-01T00:00:00.000Z",
687
+ batch: {
688
+ inbox: "collapse",
689
+ key: "string",
690
+ max_items: 1,
691
+ max_window_seconds: 1,
692
+ mode: "window",
693
+ schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
694
+ sliding: true,
695
+ window_seconds: 1
696
+ },
607
697
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
608
698
  category_key: "string",
609
699
  created_at: "2026-01-01T00:00:00.000Z",
@@ -712,6 +802,7 @@ var ROUTES = [
712
802
  data: [
713
803
  {
714
804
  attempts: 1,
805
+ batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
715
806
  channel: "inbox",
716
807
  created_at: "2026-01-01T00:00:00.000Z",
717
808
  device: {
@@ -755,6 +846,16 @@ var ROUTES = [
755
846
  } },
756
847
  { op: "notificationTypes.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+$/, status: 200, contentType: "application/json", body: {
757
848
  archived_at: "2026-01-01T00:00:00.000Z",
849
+ batch: {
850
+ inbox: "collapse",
851
+ key: "string",
852
+ max_items: 1,
853
+ max_window_seconds: 1,
854
+ mode: "window",
855
+ schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
856
+ sliding: true,
857
+ window_seconds: 1
858
+ },
758
859
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
759
860
  category_key: "string",
760
861
  created_at: "2026-01-01T00:00:00.000Z",
@@ -776,6 +877,16 @@ var ROUTES = [
776
877
  } },
777
878
  { op: "notificationTypes.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+$/, status: 200, contentType: "application/json", body: {
778
879
  archived_at: "2026-01-01T00:00:00.000Z",
880
+ batch: {
881
+ inbox: "collapse",
882
+ key: "string",
883
+ max_items: 1,
884
+ max_window_seconds: 1,
885
+ mode: "window",
886
+ schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
887
+ sliding: true,
888
+ window_seconds: 1
889
+ },
779
890
  category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
780
891
  category_key: "string",
781
892
  created_at: "2026-01-01T00:00:00.000Z",
@@ -932,6 +1043,31 @@ var ROUTES = [
932
1043
  test: true,
933
1044
  type: "notification.accepted"
934
1045
  } },
1046
+ { op: "batches.flush", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/batches\/[^\/]+\/flush$/, status: 200, contentType: "application/json", body: {
1047
+ batch: {
1048
+ deliveries: [
1049
+ {
1050
+ channel: "string",
1051
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1052
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1053
+ reason: "string",
1054
+ state: "string"
1055
+ }
1056
+ ],
1057
+ flush_at: "2026-01-01T00:00:00.000Z",
1058
+ flushed_at: "2026-01-01T00:00:00.000Z",
1059
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1060
+ item_count: 1,
1061
+ key: "p_42",
1062
+ notification_ids: ["9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"],
1063
+ opened_at: "2026-01-01T00:00:00.000Z",
1064
+ payload: {},
1065
+ recipient: "user_123",
1066
+ state: "open",
1067
+ type: "comment.created"
1068
+ },
1069
+ merged: 1
1070
+ } },
935
1071
  { op: "notifications.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notifications\/[^\/]+$/, status: 200, contentType: "application/json", body: {
936
1072
  actor: { avatar_url: "string", external_id: "string", name: "string" },
937
1073
  caller: "string",
@@ -993,6 +1129,7 @@ var ROUTES = [
993
1129
  retry_after_s: 1
994
1130
  }
995
1131
  ],
1132
+ batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
996
1133
  channel: "inbox",
997
1134
  created_at: "2026-01-01T00:00:00.000Z",
998
1135
  device_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
@@ -1073,6 +1210,28 @@ var ROUTES = [
1073
1210
  unsubscribed_all: true,
1074
1211
  updated_at: "2026-01-01T00:00:00.000Z"
1075
1212
  } },
1213
+ { op: "batches.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/batches\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1214
+ deliveries: [
1215
+ {
1216
+ channel: "string",
1217
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1218
+ notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1219
+ reason: "string",
1220
+ state: "string"
1221
+ }
1222
+ ],
1223
+ flush_at: "2026-01-01T00:00:00.000Z",
1224
+ flushed_at: "2026-01-01T00:00:00.000Z",
1225
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1226
+ item_count: 1,
1227
+ key: "p_42",
1228
+ notification_ids: ["9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"],
1229
+ opened_at: "2026-01-01T00:00:00.000Z",
1230
+ payload: {},
1231
+ recipient: "user_123",
1232
+ state: "open",
1233
+ type: "comment.created"
1234
+ } },
1076
1235
  { op: "recipients.devices.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/recipients\/[^\/]+\/devices\/[^\/]+$/, status: 204, contentType: null, body: null },
1077
1236
  { op: "notificationTypes.templates.versions", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+\/templates\/[^\/]+\/[^\/]+\/versions$/, status: 200, contentType: "application/json", body: {
1078
1237
  data: [{ actor: "string", body: {}, created_at: "2026-01-01T00:00:00.000Z", version: 1 }]