@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/README.md +6 -5
- package/api.md +128 -3
- package/dist/index.cjs +139 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1041 -44
- package/dist/index.d.ts +1041 -44
- package/dist/index.js +139 -6
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +159 -0
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +159 -0
- package/dist/testing.js.map +1 -1
- package/manifest.json +62 -2
- package/package.json +1 -1
package/dist/testing.cjs
CHANGED
|
@@ -136,6 +136,16 @@ var ROUTES = [
|
|
|
136
136
|
} },
|
|
137
137
|
{ op: "notificationTypes.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types$/, status: 201, contentType: "application/json", body: {
|
|
138
138
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
139
|
+
batch: {
|
|
140
|
+
inbox: "collapse",
|
|
141
|
+
key: "string",
|
|
142
|
+
max_items: 1,
|
|
143
|
+
max_window_seconds: 1,
|
|
144
|
+
mode: "window",
|
|
145
|
+
schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
|
|
146
|
+
sliding: true,
|
|
147
|
+
window_seconds: 1
|
|
148
|
+
},
|
|
139
149
|
category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
140
150
|
category_key: "string",
|
|
141
151
|
created_at: "2026-01-01T00:00:00.000Z",
|
|
@@ -159,6 +169,16 @@ var ROUTES = [
|
|
|
159
169
|
data: [
|
|
160
170
|
{
|
|
161
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
|
+
},
|
|
162
182
|
category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
163
183
|
category_key: "string",
|
|
164
184
|
created_at: "2026-01-01T00:00:00.000Z",
|
|
@@ -312,6 +332,12 @@ var ROUTES = [
|
|
|
312
332
|
dry_run: true,
|
|
313
333
|
plan: [
|
|
314
334
|
{
|
|
335
|
+
batch: {
|
|
336
|
+
batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
337
|
+
flush_at: "2026-01-01T00:00:00.000Z",
|
|
338
|
+
item_count: 1,
|
|
339
|
+
key: "string"
|
|
340
|
+
},
|
|
315
341
|
channel: "inbox",
|
|
316
342
|
decision: "deliver",
|
|
317
343
|
explanation: "string",
|
|
@@ -375,6 +401,7 @@ var ROUTES = [
|
|
|
375
401
|
data: [
|
|
376
402
|
{
|
|
377
403
|
attempts: 1,
|
|
404
|
+
batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
378
405
|
channel: "inbox",
|
|
379
406
|
created_at: "2026-01-01T00:00:00.000Z",
|
|
380
407
|
device_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
@@ -474,6 +501,12 @@ var ROUTES = [
|
|
|
474
501
|
]
|
|
475
502
|
} },
|
|
476
503
|
{ op: "settings.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/settings$/, status: 200, contentType: "application/json", body: {
|
|
504
|
+
branding: {
|
|
505
|
+
accent_color: "#4f46e5",
|
|
506
|
+
logo_url: "https://example.com",
|
|
507
|
+
name: "Acme",
|
|
508
|
+
privacy_url: "https://example.com"
|
|
509
|
+
},
|
|
477
510
|
client_origins: ["https://app.example.com"],
|
|
478
511
|
default_quiet_hours: { end: "08:00", start: "22:00" },
|
|
479
512
|
default_timezone: "Europe/Lisbon",
|
|
@@ -483,6 +516,12 @@ var ROUTES = [
|
|
|
483
516
|
email_resumed_at: "2026-01-01T00:00:00.000Z"
|
|
484
517
|
} },
|
|
485
518
|
{ op: "settings.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/settings$/, status: 200, contentType: "application/json", body: {
|
|
519
|
+
branding: {
|
|
520
|
+
accent_color: "#4f46e5",
|
|
521
|
+
logo_url: "https://example.com",
|
|
522
|
+
name: "Acme",
|
|
523
|
+
privacy_url: "https://example.com"
|
|
524
|
+
},
|
|
486
525
|
client_origins: ["https://app.example.com"],
|
|
487
526
|
default_quiet_hours: { end: "08:00", start: "22:00" },
|
|
488
527
|
default_timezone: "Europe/Lisbon",
|
|
@@ -491,6 +530,22 @@ var ROUTES = [
|
|
|
491
530
|
email_paused_reason: "string",
|
|
492
531
|
email_resumed_at: "2026-01-01T00:00:00.000Z"
|
|
493
532
|
} },
|
|
533
|
+
{ op: "batches.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/batches$/, status: 200, contentType: "application/json", body: {
|
|
534
|
+
data: [
|
|
535
|
+
{
|
|
536
|
+
flush_at: "2026-01-01T00:00:00.000Z",
|
|
537
|
+
flushed_at: "2026-01-01T00:00:00.000Z",
|
|
538
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
539
|
+
item_count: 1,
|
|
540
|
+
key: "p_42",
|
|
541
|
+
opened_at: "2026-01-01T00:00:00.000Z",
|
|
542
|
+
recipient: "user_123",
|
|
543
|
+
state: "open",
|
|
544
|
+
type: "comment.created"
|
|
545
|
+
}
|
|
546
|
+
],
|
|
547
|
+
pagination: { next_cursor: null, has_more: false }
|
|
548
|
+
} },
|
|
494
549
|
{ op: "export.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/export$/, status: 200, contentType: "application/json", body: {
|
|
495
550
|
categories: [
|
|
496
551
|
{
|
|
@@ -510,6 +565,16 @@ var ROUTES = [
|
|
|
510
565
|
notification_types: [
|
|
511
566
|
{
|
|
512
567
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
568
|
+
batch: {
|
|
569
|
+
inbox: "collapse",
|
|
570
|
+
key: "string",
|
|
571
|
+
max_items: 1,
|
|
572
|
+
max_window_seconds: 1,
|
|
573
|
+
mode: "window",
|
|
574
|
+
schedule: { frequency: null, time: "09:00", weekday: null },
|
|
575
|
+
sliding: true,
|
|
576
|
+
window_seconds: 1
|
|
577
|
+
},
|
|
513
578
|
category_key: "string",
|
|
514
579
|
critical: true,
|
|
515
580
|
default_locale: "string",
|
|
@@ -572,6 +637,16 @@ var ROUTES = [
|
|
|
572
637
|
} },
|
|
573
638
|
{ op: "notificationTypes.archive", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+\/archive$/, status: 200, contentType: "application/json", body: {
|
|
574
639
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
640
|
+
batch: {
|
|
641
|
+
inbox: "collapse",
|
|
642
|
+
key: "string",
|
|
643
|
+
max_items: 1,
|
|
644
|
+
max_window_seconds: 1,
|
|
645
|
+
mode: "window",
|
|
646
|
+
schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
|
|
647
|
+
sliding: true,
|
|
648
|
+
window_seconds: 1
|
|
649
|
+
},
|
|
575
650
|
category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
576
651
|
category_key: "string",
|
|
577
652
|
created_at: "2026-01-01T00:00:00.000Z",
|
|
@@ -603,9 +678,24 @@ var ROUTES = [
|
|
|
603
678
|
],
|
|
604
679
|
cross_channel_mismatches: {}
|
|
605
680
|
} },
|
|
681
|
+
{ op: "recipients.createPreferenceLink", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/recipients\/[^\/]+\/preference-link$/, status: 201, contentType: "application/json", body: {
|
|
682
|
+
category_key: "string",
|
|
683
|
+
expires_at: "2026-01-01T00:00:00.000Z",
|
|
684
|
+
url: "https://api.notify.productcraft.co/v1/preferences/p1.AQ\u2026"
|
|
685
|
+
} },
|
|
606
686
|
{ op: "channels.apns.deleteCredential", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/channels\/apns\/credentials\/[^\/]+$/, status: 204, contentType: null, body: null },
|
|
607
687
|
{ op: "notificationTypes.replaceByKey", method: "PUT", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/by-key\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
608
688
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
689
|
+
batch: {
|
|
690
|
+
inbox: "collapse",
|
|
691
|
+
key: "string",
|
|
692
|
+
max_items: 1,
|
|
693
|
+
max_window_seconds: 1,
|
|
694
|
+
mode: "window",
|
|
695
|
+
schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
|
|
696
|
+
sliding: true,
|
|
697
|
+
window_seconds: 1
|
|
698
|
+
},
|
|
609
699
|
category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
610
700
|
category_key: "string",
|
|
611
701
|
created_at: "2026-01-01T00:00:00.000Z",
|
|
@@ -714,6 +804,7 @@ var ROUTES = [
|
|
|
714
804
|
data: [
|
|
715
805
|
{
|
|
716
806
|
attempts: 1,
|
|
807
|
+
batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
717
808
|
channel: "inbox",
|
|
718
809
|
created_at: "2026-01-01T00:00:00.000Z",
|
|
719
810
|
device: {
|
|
@@ -757,6 +848,16 @@ var ROUTES = [
|
|
|
757
848
|
} },
|
|
758
849
|
{ op: "notificationTypes.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
759
850
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
851
|
+
batch: {
|
|
852
|
+
inbox: "collapse",
|
|
853
|
+
key: "string",
|
|
854
|
+
max_items: 1,
|
|
855
|
+
max_window_seconds: 1,
|
|
856
|
+
mode: "window",
|
|
857
|
+
schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
|
|
858
|
+
sliding: true,
|
|
859
|
+
window_seconds: 1
|
|
860
|
+
},
|
|
760
861
|
category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
761
862
|
category_key: "string",
|
|
762
863
|
created_at: "2026-01-01T00:00:00.000Z",
|
|
@@ -778,6 +879,16 @@ var ROUTES = [
|
|
|
778
879
|
} },
|
|
779
880
|
{ op: "notificationTypes.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
780
881
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
882
|
+
batch: {
|
|
883
|
+
inbox: "collapse",
|
|
884
|
+
key: "string",
|
|
885
|
+
max_items: 1,
|
|
886
|
+
max_window_seconds: 1,
|
|
887
|
+
mode: "window",
|
|
888
|
+
schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
|
|
889
|
+
sliding: true,
|
|
890
|
+
window_seconds: 1
|
|
891
|
+
},
|
|
781
892
|
category_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
782
893
|
category_key: "string",
|
|
783
894
|
created_at: "2026-01-01T00:00:00.000Z",
|
|
@@ -934,6 +1045,31 @@ var ROUTES = [
|
|
|
934
1045
|
test: true,
|
|
935
1046
|
type: "notification.accepted"
|
|
936
1047
|
} },
|
|
1048
|
+
{ op: "batches.flush", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/batches\/[^\/]+\/flush$/, status: 200, contentType: "application/json", body: {
|
|
1049
|
+
batch: {
|
|
1050
|
+
deliveries: [
|
|
1051
|
+
{
|
|
1052
|
+
channel: "string",
|
|
1053
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
1054
|
+
notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
1055
|
+
reason: "string",
|
|
1056
|
+
state: "string"
|
|
1057
|
+
}
|
|
1058
|
+
],
|
|
1059
|
+
flush_at: "2026-01-01T00:00:00.000Z",
|
|
1060
|
+
flushed_at: "2026-01-01T00:00:00.000Z",
|
|
1061
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
1062
|
+
item_count: 1,
|
|
1063
|
+
key: "p_42",
|
|
1064
|
+
notification_ids: ["9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"],
|
|
1065
|
+
opened_at: "2026-01-01T00:00:00.000Z",
|
|
1066
|
+
payload: {},
|
|
1067
|
+
recipient: "user_123",
|
|
1068
|
+
state: "open",
|
|
1069
|
+
type: "comment.created"
|
|
1070
|
+
},
|
|
1071
|
+
merged: 1
|
|
1072
|
+
} },
|
|
937
1073
|
{ op: "notifications.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notifications\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
938
1074
|
actor: { avatar_url: "string", external_id: "string", name: "string" },
|
|
939
1075
|
caller: "string",
|
|
@@ -995,6 +1131,7 @@ var ROUTES = [
|
|
|
995
1131
|
retry_after_s: 1
|
|
996
1132
|
}
|
|
997
1133
|
],
|
|
1134
|
+
batch_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
998
1135
|
channel: "inbox",
|
|
999
1136
|
created_at: "2026-01-01T00:00:00.000Z",
|
|
1000
1137
|
device_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
@@ -1075,6 +1212,28 @@ var ROUTES = [
|
|
|
1075
1212
|
unsubscribed_all: true,
|
|
1076
1213
|
updated_at: "2026-01-01T00:00:00.000Z"
|
|
1077
1214
|
} },
|
|
1215
|
+
{ op: "batches.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/batches\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
1216
|
+
deliveries: [
|
|
1217
|
+
{
|
|
1218
|
+
channel: "string",
|
|
1219
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
1220
|
+
notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
1221
|
+
reason: "string",
|
|
1222
|
+
state: "string"
|
|
1223
|
+
}
|
|
1224
|
+
],
|
|
1225
|
+
flush_at: "2026-01-01T00:00:00.000Z",
|
|
1226
|
+
flushed_at: "2026-01-01T00:00:00.000Z",
|
|
1227
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
1228
|
+
item_count: 1,
|
|
1229
|
+
key: "p_42",
|
|
1230
|
+
notification_ids: ["9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"],
|
|
1231
|
+
opened_at: "2026-01-01T00:00:00.000Z",
|
|
1232
|
+
payload: {},
|
|
1233
|
+
recipient: "user_123",
|
|
1234
|
+
state: "open",
|
|
1235
|
+
type: "comment.created"
|
|
1236
|
+
} },
|
|
1078
1237
|
{ op: "recipients.devices.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/recipients\/[^\/]+\/devices\/[^\/]+$/, status: 204, contentType: null, body: null },
|
|
1079
1238
|
{ op: "notificationTypes.templates.versions", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+\/templates\/[^\/]+\/[^\/]+\/versions$/, status: 200, contentType: "application/json", body: {
|
|
1080
1239
|
data: [{ actor: "string", body: {}, created_at: "2026-01-01T00:00:00.000Z", version: 1 }]
|