@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.
- package/README.md +10 -7
- package/api.md +316 -4
- package/dist/index.cjs +347 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5531 -2852
- package/dist/index.d.ts +5531 -2852
- package/dist/index.js +347 -9
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +291 -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 +291 -0
- package/dist/testing.js.map +1 -1
- package/manifest.json +167 -2
- package/package.json +1 -1
package/manifest.json
CHANGED
|
@@ -1,5 +1,125 @@
|
|
|
1
1
|
{
|
|
2
2
|
"operations": {
|
|
3
|
+
"ApprovalsController_cancel": {
|
|
4
|
+
"actor": null,
|
|
5
|
+
"deprecated": false,
|
|
6
|
+
"http": "POST /v1/workspaces/{workspace_id}/approvals/{approval_id}/cancel",
|
|
7
|
+
"idempotent": false,
|
|
8
|
+
"method": "cancel",
|
|
9
|
+
"paginated": false,
|
|
10
|
+
"params": null,
|
|
11
|
+
"poll": null,
|
|
12
|
+
"public": false,
|
|
13
|
+
"resource": "approvals",
|
|
14
|
+
"scope": null,
|
|
15
|
+
"signature": "notify.approvals.cancel(approvalId, options?): Notify.Approval",
|
|
16
|
+
"snippet": "const approval = await notify.approvals.cancel(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");"
|
|
17
|
+
},
|
|
18
|
+
"ApprovalsController_create": {
|
|
19
|
+
"actor": null,
|
|
20
|
+
"deprecated": false,
|
|
21
|
+
"http": "POST /v1/workspaces/{workspace_id}/approvals",
|
|
22
|
+
"idempotent": true,
|
|
23
|
+
"method": "create",
|
|
24
|
+
"paginated": false,
|
|
25
|
+
"params": "Notify.ApprovalCreateParams",
|
|
26
|
+
"poll": null,
|
|
27
|
+
"public": false,
|
|
28
|
+
"resource": "approvals",
|
|
29
|
+
"scope": null,
|
|
30
|
+
"signature": "notify.approvals.create(params, options?): Notify.Approval",
|
|
31
|
+
"snippet": "const approval = await notify.approvals.create({\n approvers: [\"user_123\"],\n title: \"Deploy api v2.14 to production?\",\n type: \"deploy.approval\",\n});"
|
|
32
|
+
},
|
|
33
|
+
"ApprovalsController_list": {
|
|
34
|
+
"actor": null,
|
|
35
|
+
"deprecated": false,
|
|
36
|
+
"http": "GET /v1/workspaces/{workspace_id}/approvals",
|
|
37
|
+
"idempotent": false,
|
|
38
|
+
"method": "list",
|
|
39
|
+
"paginated": true,
|
|
40
|
+
"params": "Notify.ApprovalListParams",
|
|
41
|
+
"poll": null,
|
|
42
|
+
"public": false,
|
|
43
|
+
"resource": "approvals",
|
|
44
|
+
"scope": null,
|
|
45
|
+
"signature": "notify.approvals.list(params?, options?): PagePromise<Notify.Approval>",
|
|
46
|
+
"snippet": "for await (const approval of notify.approvals.list()) {\n console.log(approval);\n}\nconst page = await notify.approvals.list({}, { timeout: 5_000 });"
|
|
47
|
+
},
|
|
48
|
+
"ApprovalsController_recordDecision": {
|
|
49
|
+
"actor": null,
|
|
50
|
+
"deprecated": false,
|
|
51
|
+
"http": "POST /v1/workspaces/{workspace_id}/approvals/{approval_id}/decision",
|
|
52
|
+
"idempotent": false,
|
|
53
|
+
"method": "recordDecision",
|
|
54
|
+
"paginated": false,
|
|
55
|
+
"params": "Notify.ApprovalRecordDecisionParams",
|
|
56
|
+
"poll": null,
|
|
57
|
+
"public": false,
|
|
58
|
+
"resource": "approvals",
|
|
59
|
+
"scope": null,
|
|
60
|
+
"signature": "notify.approvals.recordDecision(approvalId, params, options?): Notify.Approval",
|
|
61
|
+
"snippet": "const approval = await notify.approvals.recordDecision(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", { approver: \"user_123\", decision: \"approve\" });"
|
|
62
|
+
},
|
|
63
|
+
"ApprovalsController_retrieve": {
|
|
64
|
+
"actor": null,
|
|
65
|
+
"deprecated": false,
|
|
66
|
+
"http": "GET /v1/workspaces/{workspace_id}/approvals/{approval_id}",
|
|
67
|
+
"idempotent": false,
|
|
68
|
+
"method": "retrieve",
|
|
69
|
+
"paginated": false,
|
|
70
|
+
"params": "Notify.ApprovalRetrieveParams",
|
|
71
|
+
"poll": null,
|
|
72
|
+
"public": false,
|
|
73
|
+
"resource": "approvals",
|
|
74
|
+
"scope": null,
|
|
75
|
+
"signature": "notify.approvals.retrieve(approvalId, params?, options?): Notify.ApprovalDetail",
|
|
76
|
+
"snippet": "const approvalDetail = await notify.approvals.retrieve(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");"
|
|
77
|
+
},
|
|
78
|
+
"BatchesController_flush": {
|
|
79
|
+
"actor": null,
|
|
80
|
+
"deprecated": false,
|
|
81
|
+
"http": "POST /v1/workspaces/{workspace_id}/batches/{batch_id}/flush",
|
|
82
|
+
"idempotent": true,
|
|
83
|
+
"method": "flush",
|
|
84
|
+
"paginated": false,
|
|
85
|
+
"params": null,
|
|
86
|
+
"poll": null,
|
|
87
|
+
"public": false,
|
|
88
|
+
"resource": "batches",
|
|
89
|
+
"scope": null,
|
|
90
|
+
"signature": "notify.batches.flush(batchId, options?): Notify.FlushBatch",
|
|
91
|
+
"snippet": "const flushBatch = await notify.batches.flush(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");"
|
|
92
|
+
},
|
|
93
|
+
"BatchesController_list": {
|
|
94
|
+
"actor": null,
|
|
95
|
+
"deprecated": false,
|
|
96
|
+
"http": "GET /v1/workspaces/{workspace_id}/batches",
|
|
97
|
+
"idempotent": false,
|
|
98
|
+
"method": "list",
|
|
99
|
+
"paginated": true,
|
|
100
|
+
"params": "Notify.BatchListParams",
|
|
101
|
+
"poll": null,
|
|
102
|
+
"public": false,
|
|
103
|
+
"resource": "batches",
|
|
104
|
+
"scope": null,
|
|
105
|
+
"signature": "notify.batches.list(params?, options?): PagePromise<Notify.BatchSummary>",
|
|
106
|
+
"snippet": "for await (const batch of notify.batches.list()) {\n console.log(batch);\n}\nconst page = await notify.batches.list({}, { timeout: 5_000 });"
|
|
107
|
+
},
|
|
108
|
+
"BatchesController_retrieve": {
|
|
109
|
+
"actor": null,
|
|
110
|
+
"deprecated": false,
|
|
111
|
+
"http": "GET /v1/workspaces/{workspace_id}/batches/{batch_id}",
|
|
112
|
+
"idempotent": false,
|
|
113
|
+
"method": "retrieve",
|
|
114
|
+
"paginated": false,
|
|
115
|
+
"params": null,
|
|
116
|
+
"poll": null,
|
|
117
|
+
"public": false,
|
|
118
|
+
"resource": "batches",
|
|
119
|
+
"scope": null,
|
|
120
|
+
"signature": "notify.batches.retrieve(batchId, options?): Notify.BatchDetail",
|
|
121
|
+
"snippet": "const batchDetail = await notify.batches.retrieve(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");"
|
|
122
|
+
},
|
|
3
123
|
"CategoriesController_create": {
|
|
4
124
|
"actor": null,
|
|
5
125
|
"deprecated": false,
|
|
@@ -195,6 +315,36 @@
|
|
|
195
315
|
"signature": "notify.channels.webpush.retrieve(options?): Notify.WebPushChannel",
|
|
196
316
|
"snippet": "const webPushChannel = await notify.channels.webpush.retrieve();"
|
|
197
317
|
},
|
|
318
|
+
"ClientApprovalsController_decide": {
|
|
319
|
+
"actor": null,
|
|
320
|
+
"deprecated": false,
|
|
321
|
+
"http": "POST /v1/client/approvals/{approval_id}/decision",
|
|
322
|
+
"idempotent": false,
|
|
323
|
+
"method": "decide",
|
|
324
|
+
"paginated": false,
|
|
325
|
+
"params": "Notify.MeApprovalDecideParams",
|
|
326
|
+
"poll": null,
|
|
327
|
+
"public": false,
|
|
328
|
+
"resource": "approvals",
|
|
329
|
+
"scope": "client",
|
|
330
|
+
"signature": "notify.client({ token }).approvals.decide(approvalId, params, options?): Notify.Approval",
|
|
331
|
+
"snippet": "const approval = await notify.client({ token: \"rt_example_recipient_token\" }).approvals.decide(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", { decision: \"approve\" });"
|
|
332
|
+
},
|
|
333
|
+
"ClientApprovalsController_retrieve": {
|
|
334
|
+
"actor": null,
|
|
335
|
+
"deprecated": false,
|
|
336
|
+
"http": "GET /v1/client/approvals/{approval_id}",
|
|
337
|
+
"idempotent": false,
|
|
338
|
+
"method": "retrieve",
|
|
339
|
+
"paginated": false,
|
|
340
|
+
"params": null,
|
|
341
|
+
"poll": null,
|
|
342
|
+
"public": false,
|
|
343
|
+
"resource": "approvals",
|
|
344
|
+
"scope": "client",
|
|
345
|
+
"signature": "notify.client({ token }).approvals.retrieve(approvalId, options?): Notify.Approval",
|
|
346
|
+
"snippet": "const approval = await notify.client({ token: \"rt_example_recipient_token\" }).approvals.retrieve(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");"
|
|
347
|
+
},
|
|
198
348
|
"ClientController_counts": {
|
|
199
349
|
"actor": null,
|
|
200
350
|
"deprecated": false,
|
|
@@ -510,6 +660,21 @@
|
|
|
510
660
|
"signature": "notify.notifications.send(params, options?): Notify.NotificationSendResponse",
|
|
511
661
|
"snippet": "const result = await notify.notifications.send({\n recipients: [\"user_123\", { email: \"a@example.com\", external_id: \"user_456\", locale: \"pt-PT\" }],\n type: \"invoice.paid\",\n});"
|
|
512
662
|
},
|
|
663
|
+
"PreferenceLinkController_create": {
|
|
664
|
+
"actor": null,
|
|
665
|
+
"deprecated": false,
|
|
666
|
+
"http": "POST /v1/workspaces/{workspace_id}/recipients/{external_id}/preference-link",
|
|
667
|
+
"idempotent": false,
|
|
668
|
+
"method": "createPreferenceLink",
|
|
669
|
+
"paginated": false,
|
|
670
|
+
"params": "Notify.RecipientCreatePreferenceLinkParams",
|
|
671
|
+
"poll": null,
|
|
672
|
+
"public": false,
|
|
673
|
+
"resource": "recipients",
|
|
674
|
+
"scope": null,
|
|
675
|
+
"signature": "notify.recipients.createPreferenceLink(externalId, params?, options?): Notify.PreferenceLink",
|
|
676
|
+
"snippet": "const preferenceLink = await notify.recipients.createPreferenceLink(\"user_123\", { category_key: \"product-updates\" });"
|
|
677
|
+
},
|
|
513
678
|
"PreferencesController_replace": {
|
|
514
679
|
"actor": null,
|
|
515
680
|
"deprecated": false,
|
|
@@ -748,7 +913,7 @@
|
|
|
748
913
|
"resource": "settings",
|
|
749
914
|
"scope": null,
|
|
750
915
|
"signature": "notify.settings.update(params?, options?): Notify.NotifySettings",
|
|
751
|
-
"snippet": "const notifySettings = await notify.settings.update({
|
|
916
|
+
"snippet": "const notifySettings = await notify.settings.update({\n branding: {\n accent_color: \"#4f46e5\",\n logo_url: \"https://acme.example/logo.png\",\n name: \"Acme\",\n privacy_url: \"https://acme.example/privacy\",\n },\n});"
|
|
752
917
|
},
|
|
753
918
|
"SetupStatusController_get": {
|
|
754
919
|
"actor": null,
|
|
@@ -943,7 +1108,7 @@
|
|
|
943
1108
|
"resource": "notificationTypes",
|
|
944
1109
|
"scope": null,
|
|
945
1110
|
"signature": "notify.notificationTypes.update(typeId, params?, options?): Notify.NotificationType",
|
|
946
|
-
"snippet": "const notificationType = await notify.notificationTypes.update(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", {
|
|
1111
|
+
"snippet": "const notificationType = await notify.notificationTypes.update(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", {\n approval: { default_expires_in_seconds: 86400, reason: \"optional\", timeout_outcome: \"expired\" },\n});"
|
|
947
1112
|
},
|
|
948
1113
|
"TypesController_versions": {
|
|
949
1114
|
"actor": null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@productcraft/notify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Node.js / TypeScript client for ProductCraft Notify: one call notifies a user across an in-app inbox, email, web push, APNs and FCM, with preferences, fallbacks, quiet hours, templates, delivery history and signed webhooks. Includes the browser-safe recipient-token client scope.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|