@novu/api 0.5.0 → 0.6.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.
Files changed (225) hide show
  1. package/README.md +97 -64
  2. package/bin/mcp-server.js +223 -173
  3. package/bin/mcp-server.js.map +65 -64
  4. package/docs/sdks/authentication/README.md +17 -17
  5. package/docs/sdks/integrations/README.md +55 -55
  6. package/docs/sdks/novu/README.md +146 -146
  7. package/docs/sdks/novumessages/README.md +34 -34
  8. package/docs/sdks/stats/README.md +14 -14
  9. package/docs/sdks/subscribers/README.md +82 -82
  10. package/jsr.json +1 -1
  11. package/lib/config.d.ts +3 -3
  12. package/lib/config.js +3 -3
  13. package/lib/sdks.d.ts.map +1 -1
  14. package/lib/sdks.js +2 -8
  15. package/lib/sdks.js.map +1 -1
  16. package/lib/security.d.ts +4 -3
  17. package/lib/security.d.ts.map +1 -1
  18. package/lib/security.js +6 -1
  19. package/lib/security.js.map +1 -1
  20. package/mcp-server/extensions.d.ts +11 -0
  21. package/mcp-server/extensions.d.ts.map +1 -0
  22. package/mcp-server/extensions.js +6 -0
  23. package/mcp-server/extensions.js.map +1 -0
  24. package/mcp-server/mcp-server.js +1 -1
  25. package/mcp-server/prompts.d.ts +26 -0
  26. package/mcp-server/prompts.d.ts.map +1 -0
  27. package/mcp-server/prompts.js +48 -0
  28. package/mcp-server/prompts.js.map +1 -0
  29. package/mcp-server/resources.d.ts +9 -4
  30. package/mcp-server/resources.d.ts.map +1 -1
  31. package/mcp-server/resources.js +38 -10
  32. package/mcp-server/resources.js.map +1 -1
  33. package/mcp-server/server.d.ts.map +1 -1
  34. package/mcp-server/server.js +31 -24
  35. package/mcp-server/server.js.map +1 -1
  36. package/mcp-server/tools/integrationsCreate.js +1 -1
  37. package/mcp-server/tools/integrationsDelete.js +1 -1
  38. package/mcp-server/tools/integrationsList.js +1 -1
  39. package/mcp-server/tools/integrationsListActive.js +1 -1
  40. package/mcp-server/tools/integrationsSetAsPrimary.js +1 -1
  41. package/mcp-server/tools/integrationsUpdate.js +1 -1
  42. package/mcp-server/tools/integrationsWebhooksRetrieve.js +1 -1
  43. package/mcp-server/tools/messagesDelete.js +1 -1
  44. package/mcp-server/tools/messagesDeleteByTransactionId.js +1 -1
  45. package/mcp-server/tools/messagesRetrieve.js +1 -1
  46. package/mcp-server/tools/notificationsList.js +1 -1
  47. package/mcp-server/tools/notificationsRetrieve.js +1 -1
  48. package/mcp-server/tools/notificationsStatsGraph.js +1 -1
  49. package/mcp-server/tools/notificationsStatsRetrieve.js +1 -1
  50. package/mcp-server/tools/subscribersAuthenticationChatAccessOauth.js +1 -1
  51. package/mcp-server/tools/subscribersAuthenticationChatAccessOauthCallBack.js +1 -1
  52. package/mcp-server/tools/subscribersCreate.js +1 -1
  53. package/mcp-server/tools/subscribersCreateBulk.js +1 -1
  54. package/mcp-server/tools/subscribersCredentialsAppend.js +1 -1
  55. package/mcp-server/tools/subscribersCredentialsDelete.js +1 -1
  56. package/mcp-server/tools/subscribersCredentialsUpdate.js +1 -1
  57. package/mcp-server/tools/subscribersDelete.js +1 -1
  58. package/mcp-server/tools/subscribersList.js +1 -1
  59. package/mcp-server/tools/subscribersMessagesMarkAll.js +1 -1
  60. package/mcp-server/tools/subscribersMessagesMarkAllAs.js +1 -1
  61. package/mcp-server/tools/subscribersMessagesUpdateAsSeen.js +1 -1
  62. package/mcp-server/tools/subscribersNotificationsFeed.js +1 -1
  63. package/mcp-server/tools/subscribersNotificationsUnseenCount.js +1 -1
  64. package/mcp-server/tools/subscribersPatch.js +1 -1
  65. package/mcp-server/tools/subscribersPreferencesList.js +1 -1
  66. package/mcp-server/tools/subscribersPreferencesUpdate.js +1 -1
  67. package/mcp-server/tools/subscribersPropertiesUpdateOnlineFlag.js +1 -1
  68. package/mcp-server/tools/subscribersRetrieve.js +1 -1
  69. package/mcp-server/tools/subscribersSearch.js +1 -1
  70. package/mcp-server/tools/topicsCreate.js +1 -1
  71. package/mcp-server/tools/topicsDelete.js +1 -1
  72. package/mcp-server/tools/topicsList.js +1 -1
  73. package/mcp-server/tools/topicsRename.js +1 -1
  74. package/mcp-server/tools/topicsRetrieve.js +1 -1
  75. package/mcp-server/tools/topicsSubscribersAssign.js +1 -1
  76. package/mcp-server/tools/topicsSubscribersRemove.js +1 -1
  77. package/mcp-server/tools/topicsSubscribersRetrieve.js +1 -1
  78. package/mcp-server/tools.d.ts.map +1 -1
  79. package/mcp-server/tools.js +4 -0
  80. package/mcp-server/tools.js.map +1 -1
  81. package/models/components/activitynotificationjobresponsedto.d.ts +9 -0
  82. package/models/components/activitynotificationjobresponsedto.d.ts.map +1 -1
  83. package/models/components/activitynotificationjobresponsedto.js +2 -0
  84. package/models/components/activitynotificationjobresponsedto.js.map +1 -1
  85. package/models/components/channelsettingsdto.d.ts +8 -8
  86. package/models/components/channelsettingsdto.d.ts.map +1 -1
  87. package/models/components/channelsettingsdto.js +14 -13
  88. package/models/components/channelsettingsdto.js.map +1 -1
  89. package/models/components/index.d.ts +0 -1
  90. package/models/components/index.d.ts.map +1 -1
  91. package/models/components/index.js +0 -1
  92. package/models/components/index.js.map +1 -1
  93. package/models/components/integrationresponsedto.d.ts +8 -8
  94. package/models/components/integrationresponsedto.d.ts.map +1 -1
  95. package/models/components/integrationresponsedto.js +13 -14
  96. package/models/components/integrationresponsedto.js.map +1 -1
  97. package/models/components/markallmessageasrequestdto.d.ts +8 -8
  98. package/models/components/markallmessageasrequestdto.d.ts.map +1 -1
  99. package/models/components/markallmessageasrequestdto.js +14 -13
  100. package/models/components/markallmessageasrequestdto.js.map +1 -1
  101. package/models/components/messagemarkasrequestdto.d.ts +8 -8
  102. package/models/components/messagemarkasrequestdto.d.ts.map +1 -1
  103. package/models/components/messagemarkasrequestdto.js +13 -14
  104. package/models/components/messagemarkasrequestdto.js.map +1 -1
  105. package/models/components/overrides.d.ts +8 -8
  106. package/models/components/overrides.d.ts.map +1 -1
  107. package/models/components/overrides.js +14 -13
  108. package/models/components/overrides.js.map +1 -1
  109. package/models/components/patchsubscriberrequestdto.d.ts +15 -15
  110. package/models/components/patchsubscriberrequestdto.d.ts.map +1 -1
  111. package/models/components/patchsubscriberrequestdto.js +19 -20
  112. package/models/components/patchsubscriberrequestdto.js.map +1 -1
  113. package/models/components/subscriberchanneldto.d.ts +8 -8
  114. package/models/components/subscriberchanneldto.d.ts.map +1 -1
  115. package/models/components/subscriberchanneldto.js +13 -14
  116. package/models/components/subscriberchanneldto.js.map +1 -1
  117. package/models/components/subscriberpayloaddto.d.ts +13 -13
  118. package/models/components/subscriberpayloaddto.d.ts.map +1 -1
  119. package/models/components/subscriberpayloaddto.js +16 -17
  120. package/models/components/subscriberpayloaddto.js.map +1 -1
  121. package/models/operations/eventscontrollercancel.d.ts +2 -3
  122. package/models/operations/eventscontrollercancel.d.ts.map +1 -1
  123. package/models/operations/eventscontrollercancel.js +2 -3
  124. package/models/operations/eventscontrollercancel.js.map +1 -1
  125. package/models/operations/notificationscontrollerlistnotifications.d.ts +2 -2
  126. package/package.json +1 -1
  127. package/sdk/authentication.d.ts +4 -4
  128. package/sdk/authentication.d.ts.map +1 -1
  129. package/sdk/authentication.js +6 -6
  130. package/sdk/authentication.js.map +1 -1
  131. package/sdk/integrations.d.ts +7 -7
  132. package/sdk/integrations.d.ts.map +1 -1
  133. package/sdk/integrations.js +9 -9
  134. package/sdk/integrations.js.map +1 -1
  135. package/sdk/novumessages.d.ts +4 -4
  136. package/sdk/novumessages.d.ts.map +1 -1
  137. package/sdk/novumessages.js +6 -6
  138. package/sdk/novumessages.js.map +1 -1
  139. package/sdk/sdk.d.ts +12 -12
  140. package/sdk/sdk.d.ts.map +1 -1
  141. package/sdk/sdk.js +15 -15
  142. package/sdk/sdk.js.map +1 -1
  143. package/sdk/stats.d.ts +4 -4
  144. package/sdk/stats.d.ts.map +1 -1
  145. package/sdk/stats.js +6 -6
  146. package/sdk/stats.js.map +1 -1
  147. package/sdk/subscribers.d.ts +26 -26
  148. package/sdk/subscribers.d.ts.map +1 -1
  149. package/sdk/subscribers.js +29 -29
  150. package/sdk/subscribers.js.map +1 -1
  151. package/sources/json-development.json +1146 -1148
  152. package/src/lib/config.ts +3 -3
  153. package/src/lib/sdks.ts +2 -7
  154. package/src/lib/security.ts +11 -3
  155. package/src/mcp-server/extensions.ts +17 -0
  156. package/src/mcp-server/mcp-server.ts +1 -1
  157. package/src/mcp-server/prompts.ts +110 -0
  158. package/src/mcp-server/resources.ts +76 -14
  159. package/src/mcp-server/server.ts +41 -24
  160. package/src/mcp-server/tools/integrationsCreate.ts +1 -1
  161. package/src/mcp-server/tools/integrationsDelete.ts +1 -1
  162. package/src/mcp-server/tools/integrationsList.ts +1 -1
  163. package/src/mcp-server/tools/integrationsListActive.ts +1 -1
  164. package/src/mcp-server/tools/integrationsSetAsPrimary.ts +1 -1
  165. package/src/mcp-server/tools/integrationsUpdate.ts +1 -1
  166. package/src/mcp-server/tools/integrationsWebhooksRetrieve.ts +1 -1
  167. package/src/mcp-server/tools/messagesDelete.ts +1 -1
  168. package/src/mcp-server/tools/messagesDeleteByTransactionId.ts +1 -1
  169. package/src/mcp-server/tools/messagesRetrieve.ts +1 -1
  170. package/src/mcp-server/tools/notificationsList.ts +1 -1
  171. package/src/mcp-server/tools/notificationsRetrieve.ts +1 -1
  172. package/src/mcp-server/tools/notificationsStatsGraph.ts +1 -1
  173. package/src/mcp-server/tools/notificationsStatsRetrieve.ts +1 -1
  174. package/src/mcp-server/tools/subscribersAuthenticationChatAccessOauth.ts +1 -1
  175. package/src/mcp-server/tools/subscribersAuthenticationChatAccessOauthCallBack.ts +1 -1
  176. package/src/mcp-server/tools/subscribersCreate.ts +1 -1
  177. package/src/mcp-server/tools/subscribersCreateBulk.ts +1 -1
  178. package/src/mcp-server/tools/subscribersCredentialsAppend.ts +1 -1
  179. package/src/mcp-server/tools/subscribersCredentialsDelete.ts +1 -1
  180. package/src/mcp-server/tools/subscribersCredentialsUpdate.ts +1 -1
  181. package/src/mcp-server/tools/subscribersDelete.ts +1 -1
  182. package/src/mcp-server/tools/subscribersList.ts +1 -1
  183. package/src/mcp-server/tools/subscribersMessagesMarkAll.ts +1 -1
  184. package/src/mcp-server/tools/subscribersMessagesMarkAllAs.ts +1 -1
  185. package/src/mcp-server/tools/subscribersMessagesUpdateAsSeen.ts +1 -1
  186. package/src/mcp-server/tools/subscribersNotificationsFeed.ts +1 -1
  187. package/src/mcp-server/tools/subscribersNotificationsUnseenCount.ts +1 -1
  188. package/src/mcp-server/tools/subscribersPatch.ts +1 -1
  189. package/src/mcp-server/tools/subscribersPreferencesList.ts +1 -1
  190. package/src/mcp-server/tools/subscribersPreferencesUpdate.ts +1 -1
  191. package/src/mcp-server/tools/subscribersPropertiesUpdateOnlineFlag.ts +1 -1
  192. package/src/mcp-server/tools/subscribersRetrieve.ts +1 -1
  193. package/src/mcp-server/tools/subscribersSearch.ts +1 -1
  194. package/src/mcp-server/tools/topicsCreate.ts +1 -1
  195. package/src/mcp-server/tools/topicsDelete.ts +1 -1
  196. package/src/mcp-server/tools/topicsList.ts +1 -1
  197. package/src/mcp-server/tools/topicsRename.ts +1 -1
  198. package/src/mcp-server/tools/topicsRetrieve.ts +1 -1
  199. package/src/mcp-server/tools/topicsSubscribersAssign.ts +1 -1
  200. package/src/mcp-server/tools/topicsSubscribersRemove.ts +1 -1
  201. package/src/mcp-server/tools/topicsSubscribersRetrieve.ts +1 -1
  202. package/src/mcp-server/tools.ts +5 -0
  203. package/src/models/components/activitynotificationjobresponsedto.ts +7 -0
  204. package/src/models/components/channelsettingsdto.ts +14 -18
  205. package/src/models/components/index.ts +0 -1
  206. package/src/models/components/integrationresponsedto.ts +18 -14
  207. package/src/models/components/markallmessageasrequestdto.ts +14 -18
  208. package/src/models/components/messagemarkasrequestdto.ts +18 -14
  209. package/src/models/components/overrides.ts +14 -16
  210. package/src/models/components/patchsubscriberrequestdto.ts +23 -37
  211. package/src/models/components/subscriberchanneldto.ts +18 -14
  212. package/src/models/components/subscriberpayloaddto.ts +37 -19
  213. package/src/models/operations/eventscontrollercancel.ts +4 -5
  214. package/src/models/operations/notificationscontrollerlistnotifications.ts +2 -2
  215. package/src/sdk/authentication.ts +16 -16
  216. package/src/sdk/integrations.ts +17 -17
  217. package/src/sdk/novumessages.ts +16 -16
  218. package/src/sdk/sdk.ts +24 -24
  219. package/src/sdk/stats.ts +10 -10
  220. package/src/sdk/subscribers.ts +61 -61
  221. package/models/components/databooleandto.d.ts +0 -29
  222. package/models/components/databooleandto.d.ts.map +0 -1
  223. package/models/components/databooleandto.js +0 -59
  224. package/models/components/databooleandto.js.map +0 -1
  225. package/src/models/components/databooleandto.ts +0 -62
@@ -5,12 +5,12 @@
5
5
 
6
6
  ### Available Operations
7
7
 
8
- * [retrieve](#retrieve) - Get notification statistics
9
8
  * [graph](#graph) - Get notification graph statistics
9
+ * [retrieve](#retrieve) - Get notification statistics
10
10
 
11
- ## retrieve
11
+ ## graph
12
12
 
13
- Get notification statistics
13
+ Get notification graph statistics
14
14
 
15
15
  ### Example Usage
16
16
 
@@ -22,7 +22,7 @@ const novu = new Novu({
22
22
  });
23
23
 
24
24
  async function run() {
25
- const result = await novu.notifications.stats.retrieve();
25
+ const result = await novu.notifications.stats.graph();
26
26
 
27
27
  // Handle the result
28
28
  console.log(result);
@@ -37,7 +37,7 @@ The standalone function version of this method:
37
37
 
38
38
  ```typescript
39
39
  import { NovuCore } from "@novu/api/core.js";
40
- import { notificationsStatsRetrieve } from "@novu/api/funcs/notificationsStatsRetrieve.js";
40
+ import { notificationsStatsGraph } from "@novu/api/funcs/notificationsStatsGraph.js";
41
41
 
42
42
  // Use `NovuCore` for best tree-shaking performance.
43
43
  // You can create one instance of it to use across an application.
@@ -46,7 +46,7 @@ const novu = new NovuCore({
46
46
  });
47
47
 
48
48
  async function run() {
49
- const res = await notificationsStatsRetrieve(novu);
49
+ const res = await notificationsStatsGraph(novu);
50
50
 
51
51
  if (!res.ok) {
52
52
  throw res.error;
@@ -65,6 +65,7 @@ run();
65
65
 
66
66
  | Parameter | Type | Required | Description |
67
67
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
68
+ | `days` | *number* | :heavy_minus_sign: | N/A |
68
69
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
69
70
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
70
71
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -72,7 +73,7 @@ run();
72
73
 
73
74
  ### Response
74
75
 
75
- **Promise\<[operations.NotificationsControllerGetActivityStatsResponse](../../models/operations/notificationscontrollergetactivitystatsresponse.md)\>**
76
+ **Promise\<[operations.NotificationsControllerGetActivityGraphStatsResponse](../../models/operations/notificationscontrollergetactivitygraphstatsresponse.md)\>**
76
77
 
77
78
  ### Errors
78
79
 
@@ -84,9 +85,9 @@ run();
84
85
  | errors.ErrorDto | 500 | application/json |
85
86
  | errors.SDKError | 4XX, 5XX | \*/\* |
86
87
 
87
- ## graph
88
+ ## retrieve
88
89
 
89
- Get notification graph statistics
90
+ Get notification statistics
90
91
 
91
92
  ### Example Usage
92
93
 
@@ -98,7 +99,7 @@ const novu = new Novu({
98
99
  });
99
100
 
100
101
  async function run() {
101
- const result = await novu.notifications.stats.graph();
102
+ const result = await novu.notifications.stats.retrieve();
102
103
 
103
104
  // Handle the result
104
105
  console.log(result);
@@ -113,7 +114,7 @@ The standalone function version of this method:
113
114
 
114
115
  ```typescript
115
116
  import { NovuCore } from "@novu/api/core.js";
116
- import { notificationsStatsGraph } from "@novu/api/funcs/notificationsStatsGraph.js";
117
+ import { notificationsStatsRetrieve } from "@novu/api/funcs/notificationsStatsRetrieve.js";
117
118
 
118
119
  // Use `NovuCore` for best tree-shaking performance.
119
120
  // You can create one instance of it to use across an application.
@@ -122,7 +123,7 @@ const novu = new NovuCore({
122
123
  });
123
124
 
124
125
  async function run() {
125
- const res = await notificationsStatsGraph(novu);
126
+ const res = await notificationsStatsRetrieve(novu);
126
127
 
127
128
  if (!res.ok) {
128
129
  throw res.error;
@@ -141,7 +142,6 @@ run();
141
142
 
142
143
  | Parameter | Type | Required | Description |
143
144
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
144
- | `days` | *number* | :heavy_minus_sign: | N/A |
145
145
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
146
146
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
147
147
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -149,7 +149,7 @@ run();
149
149
 
150
150
  ### Response
151
151
 
152
- **Promise\<[operations.NotificationsControllerGetActivityGraphStatsResponse](../../models/operations/notificationscontrollergetactivitygraphstatsresponse.md)\>**
152
+ **Promise\<[operations.NotificationsControllerGetActivityStatsResponse](../../models/operations/notificationscontrollergetactivitystatsresponse.md)\>**
153
153
 
154
154
  ### Errors
155
155
 
@@ -8,17 +8,17 @@ A subscriber in Novu represents someone who should receive a message. A subscrib
8
8
 
9
9
  ### Available Operations
10
10
 
11
- * [list](#list) - Get subscribers
12
- * [createBulk](#createbulk) - Bulk create subscribers
13
11
  * [search](#search) - Search for subscribers
14
12
  * [create](#create) - Create subscriber
15
13
  * [retrieve](#retrieve) - Get subscriber
16
14
  * [patch](#patch) - Patch subscriber
17
15
  * [delete](#delete) - Delete subscriber
16
+ * [list](#list) - Get subscribers
17
+ * [createBulk](#createbulk) - Bulk create subscribers
18
18
 
19
- ## list
19
+ ## search
20
20
 
21
- Returns a list of subscribers, could paginated using the `page` and `limit` query parameter
21
+ Search for subscribers
22
22
 
23
23
  ### Example Usage
24
24
 
@@ -30,12 +30,10 @@ const novu = new Novu({
30
30
  });
31
31
 
32
32
  async function run() {
33
- const result = await novu.subscribers.list();
33
+ const result = await novu.subscribers.search({});
34
34
 
35
- for await (const page of result) {
36
- // Handle the page
37
- console.log(page);
38
- }
35
+ // Handle the result
36
+ console.log(result);
39
37
  }
40
38
 
41
39
  run();
@@ -47,7 +45,7 @@ The standalone function version of this method:
47
45
 
48
46
  ```typescript
49
47
  import { NovuCore } from "@novu/api/core.js";
50
- import { subscribersList } from "@novu/api/funcs/subscribersList.js";
48
+ import { subscribersSearch } from "@novu/api/funcs/subscribersSearch.js";
51
49
 
52
50
  // Use `NovuCore` for best tree-shaking performance.
53
51
  // You can create one instance of it to use across an application.
@@ -56,7 +54,7 @@ const novu = new NovuCore({
56
54
  });
57
55
 
58
56
  async function run() {
59
- const res = await subscribersList(novu);
57
+ const res = await subscribersSearch(novu, {});
60
58
 
61
59
  if (!res.ok) {
62
60
  throw res.error;
@@ -64,10 +62,8 @@ async function run() {
64
62
 
65
63
  const { value: result } = res;
66
64
 
67
- for await (const page of result) {
68
- // Handle the page
69
- console.log(page);
70
- }
65
+ // Handle the result
66
+ console.log(result);
71
67
  }
72
68
 
73
69
  run();
@@ -77,16 +73,14 @@ run();
77
73
 
78
74
  | Parameter | Type | Required | Description |
79
75
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
80
- | `page` | *number* | :heavy_minus_sign: | N/A |
81
- | `limit` | *number* | :heavy_minus_sign: | N/A |
82
- | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
76
+ | `request` | [operations.SubscribersControllerSearchSubscribersRequest](../../models/operations/subscriberscontrollersearchsubscribersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
83
77
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
84
78
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
85
79
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
86
80
 
87
81
  ### Response
88
82
 
89
- **Promise\<[operations.SubscribersV1ControllerListSubscribersResponse](../../models/operations/subscribersv1controllerlistsubscribersresponse.md)\>**
83
+ **Promise\<[operations.SubscribersControllerSearchSubscribersResponse](../../models/operations/subscriberscontrollersearchsubscribersresponse.md)\>**
90
84
 
91
85
  ### Errors
92
86
 
@@ -98,12 +92,9 @@ run();
98
92
  | errors.ErrorDto | 500 | application/json |
99
93
  | errors.SDKError | 4XX, 5XX | \*/\* |
100
94
 
101
- ## createBulk
102
-
95
+ ## create
103
96
 
104
- Using this endpoint you can create multiple subscribers at once, to avoid multiple calls to the API.
105
- The bulk API is limited to 500 subscribers per request.
106
-
97
+ Create subscriber with the given data
107
98
 
108
99
  ### Example Usage
109
100
 
@@ -115,12 +106,8 @@ const novu = new Novu({
115
106
  });
116
107
 
117
108
  async function run() {
118
- const result = await novu.subscribers.createBulk({
119
- subscribers: [
120
- {
121
- subscriberId: "<id>",
122
- },
123
- ],
109
+ const result = await novu.subscribers.create({
110
+ subscriberId: "<id>",
124
111
  });
125
112
 
126
113
  // Handle the result
@@ -136,7 +123,7 @@ The standalone function version of this method:
136
123
 
137
124
  ```typescript
138
125
  import { NovuCore } from "@novu/api/core.js";
139
- import { subscribersCreateBulk } from "@novu/api/funcs/subscribersCreateBulk.js";
126
+ import { subscribersCreate } from "@novu/api/funcs/subscribersCreate.js";
140
127
 
141
128
  // Use `NovuCore` for best tree-shaking performance.
142
129
  // You can create one instance of it to use across an application.
@@ -145,12 +132,8 @@ const novu = new NovuCore({
145
132
  });
146
133
 
147
134
  async function run() {
148
- const res = await subscribersCreateBulk(novu, {
149
- subscribers: [
150
- {
151
- subscriberId: "<id>",
152
- },
153
- ],
135
+ const res = await subscribersCreate(novu, {
136
+ subscriberId: "<id>",
154
137
  });
155
138
 
156
139
  if (!res.ok) {
@@ -170,7 +153,7 @@ run();
170
153
 
171
154
  | Parameter | Type | Required | Description |
172
155
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
173
- | `bulkSubscriberCreateDto` | [components.BulkSubscriberCreateDto](../../models/components/bulksubscribercreatedto.md) | :heavy_check_mark: | N/A |
156
+ | `createSubscriberRequestDto` | [components.CreateSubscriberRequestDto](../../models/components/createsubscriberrequestdto.md) | :heavy_check_mark: | N/A |
174
157
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
175
158
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
176
159
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -178,7 +161,7 @@ run();
178
161
 
179
162
  ### Response
180
163
 
181
- **Promise\<[operations.SubscribersV1ControllerBulkCreateSubscribersResponse](../../models/operations/subscribersv1controllerbulkcreatesubscribersresponse.md)\>**
164
+ **Promise\<[operations.SubscribersControllerCreateSubscriberResponse](../../models/operations/subscriberscontrollercreatesubscriberresponse.md)\>**
182
165
 
183
166
  ### Errors
184
167
 
@@ -190,9 +173,9 @@ run();
190
173
  | errors.ErrorDto | 500 | application/json |
191
174
  | errors.SDKError | 4XX, 5XX | \*/\* |
192
175
 
193
- ## search
176
+ ## retrieve
194
177
 
195
- Search for subscribers
178
+ Get subscriber by your internal id used to identify the subscriber
196
179
 
197
180
  ### Example Usage
198
181
 
@@ -204,7 +187,7 @@ const novu = new Novu({
204
187
  });
205
188
 
206
189
  async function run() {
207
- const result = await novu.subscribers.search({});
190
+ const result = await novu.subscribers.retrieve("<id>");
208
191
 
209
192
  // Handle the result
210
193
  console.log(result);
@@ -219,7 +202,7 @@ The standalone function version of this method:
219
202
 
220
203
  ```typescript
221
204
  import { NovuCore } from "@novu/api/core.js";
222
- import { subscribersSearch } from "@novu/api/funcs/subscribersSearch.js";
205
+ import { subscribersRetrieve } from "@novu/api/funcs/subscribersRetrieve.js";
223
206
 
224
207
  // Use `NovuCore` for best tree-shaking performance.
225
208
  // You can create one instance of it to use across an application.
@@ -228,7 +211,7 @@ const novu = new NovuCore({
228
211
  });
229
212
 
230
213
  async function run() {
231
- const res = await subscribersSearch(novu, {});
214
+ const res = await subscribersRetrieve(novu, "<id>");
232
215
 
233
216
  if (!res.ok) {
234
217
  throw res.error;
@@ -247,14 +230,15 @@ run();
247
230
 
248
231
  | Parameter | Type | Required | Description |
249
232
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
250
- | `request` | [operations.SubscribersControllerSearchSubscribersRequest](../../models/operations/subscriberscontrollersearchsubscribersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
233
+ | `subscriberId` | *string* | :heavy_check_mark: | N/A |
234
+ | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
251
235
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
252
236
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
253
237
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
254
238
 
255
239
  ### Response
256
240
 
257
- **Promise\<[operations.SubscribersControllerSearchSubscribersResponse](../../models/operations/subscriberscontrollersearchsubscribersresponse.md)\>**
241
+ **Promise\<[operations.SubscribersControllerGetSubscriberResponse](../../models/operations/subscriberscontrollergetsubscriberresponse.md)\>**
258
242
 
259
243
  ### Errors
260
244
 
@@ -266,9 +250,9 @@ run();
266
250
  | errors.ErrorDto | 500 | application/json |
267
251
  | errors.SDKError | 4XX, 5XX | \*/\* |
268
252
 
269
- ## create
253
+ ## patch
270
254
 
271
- Create subscriber with the given data
255
+ Patch subscriber by your internal id used to identify the subscriber
272
256
 
273
257
  ### Example Usage
274
258
 
@@ -280,9 +264,7 @@ const novu = new Novu({
280
264
  });
281
265
 
282
266
  async function run() {
283
- const result = await novu.subscribers.create({
284
- subscriberId: "<id>",
285
- });
267
+ const result = await novu.subscribers.patch({}, "<id>");
286
268
 
287
269
  // Handle the result
288
270
  console.log(result);
@@ -297,7 +279,7 @@ The standalone function version of this method:
297
279
 
298
280
  ```typescript
299
281
  import { NovuCore } from "@novu/api/core.js";
300
- import { subscribersCreate } from "@novu/api/funcs/subscribersCreate.js";
282
+ import { subscribersPatch } from "@novu/api/funcs/subscribersPatch.js";
301
283
 
302
284
  // Use `NovuCore` for best tree-shaking performance.
303
285
  // You can create one instance of it to use across an application.
@@ -306,9 +288,7 @@ const novu = new NovuCore({
306
288
  });
307
289
 
308
290
  async function run() {
309
- const res = await subscribersCreate(novu, {
310
- subscriberId: "<id>",
311
- });
291
+ const res = await subscribersPatch(novu, {}, "<id>");
312
292
 
313
293
  if (!res.ok) {
314
294
  throw res.error;
@@ -327,7 +307,8 @@ run();
327
307
 
328
308
  | Parameter | Type | Required | Description |
329
309
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
330
- | `createSubscriberRequestDto` | [components.CreateSubscriberRequestDto](../../models/components/createsubscriberrequestdto.md) | :heavy_check_mark: | N/A |
310
+ | `subscriberId` | *string* | :heavy_check_mark: | N/A |
311
+ | `patchSubscriberRequestDto` | [components.PatchSubscriberRequestDto](../../models/components/patchsubscriberrequestdto.md) | :heavy_check_mark: | N/A |
331
312
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
332
313
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
333
314
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -335,7 +316,7 @@ run();
335
316
 
336
317
  ### Response
337
318
 
338
- **Promise\<[operations.SubscribersControllerCreateSubscriberResponse](../../models/operations/subscriberscontrollercreatesubscriberresponse.md)\>**
319
+ **Promise\<[operations.SubscribersControllerPatchSubscriberResponse](../../models/operations/subscriberscontrollerpatchsubscriberresponse.md)\>**
339
320
 
340
321
  ### Errors
341
322
 
@@ -347,9 +328,9 @@ run();
347
328
  | errors.ErrorDto | 500 | application/json |
348
329
  | errors.SDKError | 4XX, 5XX | \*/\* |
349
330
 
350
- ## retrieve
331
+ ## delete
351
332
 
352
- Get subscriber by your internal id used to identify the subscriber
333
+ Deletes a subscriber entity from the Novu platform
353
334
 
354
335
  ### Example Usage
355
336
 
@@ -361,7 +342,7 @@ const novu = new Novu({
361
342
  });
362
343
 
363
344
  async function run() {
364
- const result = await novu.subscribers.retrieve("<id>");
345
+ const result = await novu.subscribers.delete("<id>");
365
346
 
366
347
  // Handle the result
367
348
  console.log(result);
@@ -376,7 +357,7 @@ The standalone function version of this method:
376
357
 
377
358
  ```typescript
378
359
  import { NovuCore } from "@novu/api/core.js";
379
- import { subscribersRetrieve } from "@novu/api/funcs/subscribersRetrieve.js";
360
+ import { subscribersDelete } from "@novu/api/funcs/subscribersDelete.js";
380
361
 
381
362
  // Use `NovuCore` for best tree-shaking performance.
382
363
  // You can create one instance of it to use across an application.
@@ -385,7 +366,7 @@ const novu = new NovuCore({
385
366
  });
386
367
 
387
368
  async function run() {
388
- const res = await subscribersRetrieve(novu, "<id>");
369
+ const res = await subscribersDelete(novu, "<id>");
389
370
 
390
371
  if (!res.ok) {
391
372
  throw res.error;
@@ -412,7 +393,7 @@ run();
412
393
 
413
394
  ### Response
414
395
 
415
- **Promise\<[operations.SubscribersControllerGetSubscriberResponse](../../models/operations/subscriberscontrollergetsubscriberresponse.md)\>**
396
+ **Promise\<[operations.SubscribersControllerRemoveSubscriberResponse](../../models/operations/subscriberscontrollerremovesubscriberresponse.md)\>**
416
397
 
417
398
  ### Errors
418
399
 
@@ -424,9 +405,9 @@ run();
424
405
  | errors.ErrorDto | 500 | application/json |
425
406
  | errors.SDKError | 4XX, 5XX | \*/\* |
426
407
 
427
- ## patch
408
+ ## list
428
409
 
429
- Patch subscriber by your internal id used to identify the subscriber
410
+ Returns a list of subscribers, could paginated using the `page` and `limit` query parameter
430
411
 
431
412
  ### Example Usage
432
413
 
@@ -438,10 +419,12 @@ const novu = new Novu({
438
419
  });
439
420
 
440
421
  async function run() {
441
- const result = await novu.subscribers.patch({}, "<id>");
422
+ const result = await novu.subscribers.list();
442
423
 
443
- // Handle the result
444
- console.log(result);
424
+ for await (const page of result) {
425
+ // Handle the page
426
+ console.log(page);
427
+ }
445
428
  }
446
429
 
447
430
  run();
@@ -453,7 +436,7 @@ The standalone function version of this method:
453
436
 
454
437
  ```typescript
455
438
  import { NovuCore } from "@novu/api/core.js";
456
- import { subscribersPatch } from "@novu/api/funcs/subscribersPatch.js";
439
+ import { subscribersList } from "@novu/api/funcs/subscribersList.js";
457
440
 
458
441
  // Use `NovuCore` for best tree-shaking performance.
459
442
  // You can create one instance of it to use across an application.
@@ -462,7 +445,7 @@ const novu = new NovuCore({
462
445
  });
463
446
 
464
447
  async function run() {
465
- const res = await subscribersPatch(novu, {}, "<id>");
448
+ const res = await subscribersList(novu);
466
449
 
467
450
  if (!res.ok) {
468
451
  throw res.error;
@@ -470,8 +453,10 @@ async function run() {
470
453
 
471
454
  const { value: result } = res;
472
455
 
473
- // Handle the result
474
- console.log(result);
456
+ for await (const page of result) {
457
+ // Handle the page
458
+ console.log(page);
459
+ }
475
460
  }
476
461
 
477
462
  run();
@@ -481,8 +466,8 @@ run();
481
466
 
482
467
  | Parameter | Type | Required | Description |
483
468
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
484
- | `subscriberId` | *string* | :heavy_check_mark: | N/A |
485
- | `patchSubscriberRequestDto` | [components.PatchSubscriberRequestDto](../../models/components/patchsubscriberrequestdto.md) | :heavy_check_mark: | N/A |
469
+ | `page` | *number* | :heavy_minus_sign: | N/A |
470
+ | `limit` | *number* | :heavy_minus_sign: | N/A |
486
471
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
487
472
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
488
473
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -490,7 +475,7 @@ run();
490
475
 
491
476
  ### Response
492
477
 
493
- **Promise\<[operations.SubscribersControllerPatchSubscriberResponse](../../models/operations/subscriberscontrollerpatchsubscriberresponse.md)\>**
478
+ **Promise\<[operations.SubscribersV1ControllerListSubscribersResponse](../../models/operations/subscribersv1controllerlistsubscribersresponse.md)\>**
494
479
 
495
480
  ### Errors
496
481
 
@@ -502,9 +487,12 @@ run();
502
487
  | errors.ErrorDto | 500 | application/json |
503
488
  | errors.SDKError | 4XX, 5XX | \*/\* |
504
489
 
505
- ## delete
490
+ ## createBulk
506
491
 
507
- Deletes a subscriber entity from the Novu platform
492
+
493
+ Using this endpoint you can create multiple subscribers at once, to avoid multiple calls to the API.
494
+ The bulk API is limited to 500 subscribers per request.
495
+
508
496
 
509
497
  ### Example Usage
510
498
 
@@ -516,7 +504,13 @@ const novu = new Novu({
516
504
  });
517
505
 
518
506
  async function run() {
519
- const result = await novu.subscribers.delete("<id>");
507
+ const result = await novu.subscribers.createBulk({
508
+ subscribers: [
509
+ {
510
+ subscriberId: "<id>",
511
+ },
512
+ ],
513
+ });
520
514
 
521
515
  // Handle the result
522
516
  console.log(result);
@@ -531,7 +525,7 @@ The standalone function version of this method:
531
525
 
532
526
  ```typescript
533
527
  import { NovuCore } from "@novu/api/core.js";
534
- import { subscribersDelete } from "@novu/api/funcs/subscribersDelete.js";
528
+ import { subscribersCreateBulk } from "@novu/api/funcs/subscribersCreateBulk.js";
535
529
 
536
530
  // Use `NovuCore` for best tree-shaking performance.
537
531
  // You can create one instance of it to use across an application.
@@ -540,7 +534,13 @@ const novu = new NovuCore({
540
534
  });
541
535
 
542
536
  async function run() {
543
- const res = await subscribersDelete(novu, "<id>");
537
+ const res = await subscribersCreateBulk(novu, {
538
+ subscribers: [
539
+ {
540
+ subscriberId: "<id>",
541
+ },
542
+ ],
543
+ });
544
544
 
545
545
  if (!res.ok) {
546
546
  throw res.error;
@@ -559,7 +559,7 @@ run();
559
559
 
560
560
  | Parameter | Type | Required | Description |
561
561
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
562
- | `subscriberId` | *string* | :heavy_check_mark: | N/A |
562
+ | `bulkSubscriberCreateDto` | [components.BulkSubscriberCreateDto](../../models/components/bulksubscribercreatedto.md) | :heavy_check_mark: | N/A |
563
563
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
564
564
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
565
565
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -567,7 +567,7 @@ run();
567
567
 
568
568
  ### Response
569
569
 
570
- **Promise\<[operations.SubscribersControllerRemoveSubscriberResponse](../../models/operations/subscriberscontrollerremovesubscriberresponse.md)\>**
570
+ **Promise\<[operations.SubscribersV1ControllerBulkCreateSubscribersResponse](../../models/operations/subscribersv1controllerbulkcreatesubscribersresponse.md)\>**
571
571
 
572
572
  ### Errors
573
573
 
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@novu/api",
5
- "version": "0.5.0",
5
+ "version": "0.6.0",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",