@productcraft/notify 0.3.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.
- package/README.md +8 -6
- package/api.md +199 -12
- package/dist/index.cjs +221 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1842 -160
- package/dist/index.d.ts +1842 -160
- package/dist/index.js +221 -16
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +132 -0
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +132 -0
- package/dist/testing.js.map +1 -1
- package/manifest.json +106 -1
- package/package.json +1 -1
package/dist/testing.cjs
CHANGED
|
@@ -135,6 +135,7 @@ var ROUTES = [
|
|
|
135
135
|
]
|
|
136
136
|
} },
|
|
137
137
|
{ op: "notificationTypes.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types$/, status: 201, contentType: "application/json", body: {
|
|
138
|
+
approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
|
|
138
139
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
139
140
|
batch: {
|
|
140
141
|
inbox: "collapse",
|
|
@@ -168,6 +169,7 @@ var ROUTES = [
|
|
|
168
169
|
{ op: "notificationTypes.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types$/, status: 200, contentType: "application/json", body: {
|
|
169
170
|
data: [
|
|
170
171
|
{
|
|
172
|
+
approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
|
|
171
173
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
172
174
|
batch: {
|
|
173
175
|
inbox: "collapse",
|
|
@@ -300,6 +302,23 @@ var ROUTES = [
|
|
|
300
302
|
],
|
|
301
303
|
pagination: { next_cursor: null, has_more: false }
|
|
302
304
|
} },
|
|
305
|
+
{ op: "me.approvals.decide", method: "POST", pattern: /^\/v1\/client\/approvals\/[^\/]+\/decision$/, status: 200, contentType: "application/json", body: {
|
|
306
|
+
approvers: ["string"],
|
|
307
|
+
body: "string",
|
|
308
|
+
created_at: "2026-01-01T00:00:00.000Z",
|
|
309
|
+
decided_at: "2026-01-01T00:00:00.000Z",
|
|
310
|
+
decided_by: "string",
|
|
311
|
+
decided_via: "inbox",
|
|
312
|
+
expires_at: "2026-01-01T00:00:00.000Z",
|
|
313
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
314
|
+
metadata: {},
|
|
315
|
+
notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
316
|
+
reason: "string",
|
|
317
|
+
requester: { id: "string", kind: "agent", name: "string" },
|
|
318
|
+
status: "pending",
|
|
319
|
+
title: "string",
|
|
320
|
+
type: "deploy.approval"
|
|
321
|
+
} },
|
|
303
322
|
{ op: "notifications.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notifications$/, status: 200, contentType: "application/json", body: {
|
|
304
323
|
data: [
|
|
305
324
|
{
|
|
@@ -472,6 +491,45 @@ var ROUTES = [
|
|
|
472
491
|
],
|
|
473
492
|
pagination: { next_cursor: null, has_more: false }
|
|
474
493
|
} },
|
|
494
|
+
{ op: "approvals.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/approvals$/, status: 200, contentType: "application/json", body: {
|
|
495
|
+
approvers: ["string"],
|
|
496
|
+
body: "string",
|
|
497
|
+
created_at: "2026-01-01T00:00:00.000Z",
|
|
498
|
+
decided_at: "2026-01-01T00:00:00.000Z",
|
|
499
|
+
decided_by: "string",
|
|
500
|
+
decided_via: "inbox",
|
|
501
|
+
expires_at: "2026-01-01T00:00:00.000Z",
|
|
502
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
503
|
+
metadata: {},
|
|
504
|
+
notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
505
|
+
reason: "string",
|
|
506
|
+
requester: { id: "string", kind: "agent", name: "string" },
|
|
507
|
+
status: "pending",
|
|
508
|
+
title: "string",
|
|
509
|
+
type: "deploy.approval"
|
|
510
|
+
} },
|
|
511
|
+
{ op: "approvals.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/approvals$/, status: 200, contentType: "application/json", body: {
|
|
512
|
+
data: [
|
|
513
|
+
{
|
|
514
|
+
approvers: ["string"],
|
|
515
|
+
body: "string",
|
|
516
|
+
created_at: "2026-01-01T00:00:00.000Z",
|
|
517
|
+
decided_at: "2026-01-01T00:00:00.000Z",
|
|
518
|
+
decided_by: "string",
|
|
519
|
+
decided_via: "inbox",
|
|
520
|
+
expires_at: "2026-01-01T00:00:00.000Z",
|
|
521
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
522
|
+
metadata: {},
|
|
523
|
+
notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
524
|
+
reason: "string",
|
|
525
|
+
requester: { id: "string", kind: "agent", name: "string" },
|
|
526
|
+
status: "pending",
|
|
527
|
+
title: "string",
|
|
528
|
+
type: "deploy.approval"
|
|
529
|
+
}
|
|
530
|
+
],
|
|
531
|
+
pagination: { next_cursor: null, has_more: false }
|
|
532
|
+
} },
|
|
475
533
|
{ op: "channels.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/channels$/, status: 200, contentType: "application/json", body: {
|
|
476
534
|
data: [
|
|
477
535
|
{
|
|
@@ -564,6 +622,7 @@ var ROUTES = [
|
|
|
564
622
|
exported_at: "2026-01-01T00:00:00.000Z",
|
|
565
623
|
notification_types: [
|
|
566
624
|
{
|
|
625
|
+
approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
|
|
567
626
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
568
627
|
batch: {
|
|
569
628
|
inbox: "collapse",
|
|
@@ -595,6 +654,23 @@ var ROUTES = [
|
|
|
595
654
|
email_enabled: true
|
|
596
655
|
}
|
|
597
656
|
} },
|
|
657
|
+
{ op: "me.approvals.retrieve", method: "GET", pattern: /^\/v1\/client\/approvals\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
658
|
+
approvers: ["string"],
|
|
659
|
+
body: "string",
|
|
660
|
+
created_at: "2026-01-01T00:00:00.000Z",
|
|
661
|
+
decided_at: "2026-01-01T00:00:00.000Z",
|
|
662
|
+
decided_by: "string",
|
|
663
|
+
decided_via: "inbox",
|
|
664
|
+
expires_at: "2026-01-01T00:00:00.000Z",
|
|
665
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
666
|
+
metadata: {},
|
|
667
|
+
notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
668
|
+
reason: "string",
|
|
669
|
+
requester: { id: "string", kind: "agent", name: "string" },
|
|
670
|
+
status: "pending",
|
|
671
|
+
title: "string",
|
|
672
|
+
type: "deploy.approval"
|
|
673
|
+
} },
|
|
598
674
|
{ op: "stats.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/stats$/, status: 200, contentType: "application/json", body: {
|
|
599
675
|
data: [
|
|
600
676
|
{
|
|
@@ -636,6 +712,7 @@ var ROUTES = [
|
|
|
636
712
|
url: "https://api.acme.com/webhooks"
|
|
637
713
|
} },
|
|
638
714
|
{ op: "notificationTypes.archive", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+\/archive$/, status: 200, contentType: "application/json", body: {
|
|
715
|
+
approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
|
|
639
716
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
640
717
|
batch: {
|
|
641
718
|
inbox: "collapse",
|
|
@@ -685,6 +762,7 @@ var ROUTES = [
|
|
|
685
762
|
} },
|
|
686
763
|
{ op: "channels.apns.deleteCredential", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/channels\/apns\/credentials\/[^\/]+$/, status: 204, contentType: null, body: null },
|
|
687
764
|
{ op: "notificationTypes.replaceByKey", method: "PUT", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/by-key\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
765
|
+
approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
|
|
688
766
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
689
767
|
batch: {
|
|
690
768
|
inbox: "collapse",
|
|
@@ -846,7 +924,25 @@ var ROUTES = [
|
|
|
846
924
|
],
|
|
847
925
|
pagination: { next_cursor: null, has_more: false }
|
|
848
926
|
} },
|
|
927
|
+
{ op: "approvals.recordDecision", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/approvals\/[^\/]+\/decision$/, status: 200, contentType: "application/json", body: {
|
|
928
|
+
approvers: ["string"],
|
|
929
|
+
body: "string",
|
|
930
|
+
created_at: "2026-01-01T00:00:00.000Z",
|
|
931
|
+
decided_at: "2026-01-01T00:00:00.000Z",
|
|
932
|
+
decided_by: "string",
|
|
933
|
+
decided_via: "inbox",
|
|
934
|
+
expires_at: "2026-01-01T00:00:00.000Z",
|
|
935
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
936
|
+
metadata: {},
|
|
937
|
+
notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
938
|
+
reason: "string",
|
|
939
|
+
requester: { id: "string", kind: "agent", name: "string" },
|
|
940
|
+
status: "pending",
|
|
941
|
+
title: "string",
|
|
942
|
+
type: "deploy.approval"
|
|
943
|
+
} },
|
|
849
944
|
{ op: "notificationTypes.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
945
|
+
approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
|
|
850
946
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
851
947
|
batch: {
|
|
852
948
|
inbox: "collapse",
|
|
@@ -878,6 +974,7 @@ var ROUTES = [
|
|
|
878
974
|
version: 1
|
|
879
975
|
} },
|
|
880
976
|
{ op: "notificationTypes.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/notification-types\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
977
|
+
approval: { default_expires_in_seconds: 1, reason: "optional", timeout_outcome: "expired" },
|
|
881
978
|
archived_at: "2026-01-01T00:00:00.000Z",
|
|
882
979
|
batch: {
|
|
883
980
|
inbox: "collapse",
|
|
@@ -983,6 +1080,23 @@ var ROUTES = [
|
|
|
983
1080
|
updated_at: "2026-01-01T00:00:00.000Z",
|
|
984
1081
|
url: "https://api.acme.com/webhooks"
|
|
985
1082
|
} },
|
|
1083
|
+
{ op: "approvals.cancel", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/approvals\/[^\/]+\/cancel$/, status: 200, contentType: "application/json", body: {
|
|
1084
|
+
approvers: ["string"],
|
|
1085
|
+
body: "string",
|
|
1086
|
+
created_at: "2026-01-01T00:00:00.000Z",
|
|
1087
|
+
decided_at: "2026-01-01T00:00:00.000Z",
|
|
1088
|
+
decided_by: "string",
|
|
1089
|
+
decided_via: "inbox",
|
|
1090
|
+
expires_at: "2026-01-01T00:00:00.000Z",
|
|
1091
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
1092
|
+
metadata: {},
|
|
1093
|
+
notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
1094
|
+
reason: "string",
|
|
1095
|
+
requester: { id: "string", kind: "agent", name: "string" },
|
|
1096
|
+
status: "pending",
|
|
1097
|
+
title: "string",
|
|
1098
|
+
type: "deploy.approval"
|
|
1099
|
+
} },
|
|
986
1100
|
{ op: "recipients.inbox.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/recipients\/[^\/]+\/inbox$/, status: 200, contentType: "application/json", body: {
|
|
987
1101
|
counts: { unread: 1, unseen: 1 },
|
|
988
1102
|
data: [
|
|
@@ -1212,6 +1326,24 @@ var ROUTES = [
|
|
|
1212
1326
|
unsubscribed_all: true,
|
|
1213
1327
|
updated_at: "2026-01-01T00:00:00.000Z"
|
|
1214
1328
|
} },
|
|
1329
|
+
{ op: "approvals.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/approvals\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
1330
|
+
approvers: ["string"],
|
|
1331
|
+
body: "string",
|
|
1332
|
+
created_at: "2026-01-01T00:00:00.000Z",
|
|
1333
|
+
decided_at: "2026-01-01T00:00:00.000Z",
|
|
1334
|
+
decided_by: "string",
|
|
1335
|
+
decided_via: "inbox",
|
|
1336
|
+
events: [{ actor: "string", at: "2026-01-01T00:00:00.000Z", detail: {}, kind: "decided" }],
|
|
1337
|
+
expires_at: "2026-01-01T00:00:00.000Z",
|
|
1338
|
+
id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
1339
|
+
metadata: {},
|
|
1340
|
+
notification_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
1341
|
+
reason: "string",
|
|
1342
|
+
requester: { id: "string", kind: "agent", name: "string" },
|
|
1343
|
+
status: "pending",
|
|
1344
|
+
title: "string",
|
|
1345
|
+
type: "deploy.approval"
|
|
1346
|
+
} },
|
|
1215
1347
|
{ op: "batches.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/batches\/[^\/]+$/, status: 200, contentType: "application/json", body: {
|
|
1216
1348
|
deliveries: [
|
|
1217
1349
|
{
|