@novu/api 0.2.1 → 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.
Files changed (282) hide show
  1. package/README.md +4 -4
  2. package/funcs/cancel.d.ts +2 -1
  3. package/funcs/cancel.d.ts.map +1 -1
  4. package/funcs/cancel.js +11 -7
  5. package/funcs/cancel.js.map +1 -1
  6. package/funcs/integrationsCreate.d.ts +2 -1
  7. package/funcs/integrationsCreate.d.ts.map +1 -1
  8. package/funcs/integrationsCreate.js +11 -7
  9. package/funcs/integrationsCreate.js.map +1 -1
  10. package/funcs/integrationsDelete.d.ts +2 -1
  11. package/funcs/integrationsDelete.d.ts.map +1 -1
  12. package/funcs/integrationsDelete.js +11 -7
  13. package/funcs/integrationsDelete.js.map +1 -1
  14. package/funcs/integrationsList.d.ts +2 -1
  15. package/funcs/integrationsList.d.ts.map +1 -1
  16. package/funcs/integrationsList.js +11 -7
  17. package/funcs/integrationsList.js.map +1 -1
  18. package/funcs/integrationsListActive.d.ts +2 -1
  19. package/funcs/integrationsListActive.d.ts.map +1 -1
  20. package/funcs/integrationsListActive.js +11 -7
  21. package/funcs/integrationsListActive.js.map +1 -1
  22. package/funcs/integrationsSetAsPrimary.d.ts +2 -1
  23. package/funcs/integrationsSetAsPrimary.d.ts.map +1 -1
  24. package/funcs/integrationsSetAsPrimary.js +11 -7
  25. package/funcs/integrationsSetAsPrimary.js.map +1 -1
  26. package/funcs/integrationsUpdate.d.ts +2 -1
  27. package/funcs/integrationsUpdate.d.ts.map +1 -1
  28. package/funcs/integrationsUpdate.js +11 -7
  29. package/funcs/integrationsUpdate.js.map +1 -1
  30. package/funcs/integrationsWebhooksRetrieve.d.ts +2 -1
  31. package/funcs/integrationsWebhooksRetrieve.d.ts.map +1 -1
  32. package/funcs/integrationsWebhooksRetrieve.js +11 -7
  33. package/funcs/integrationsWebhooksRetrieve.js.map +1 -1
  34. package/funcs/messagesDelete.d.ts +2 -1
  35. package/funcs/messagesDelete.d.ts.map +1 -1
  36. package/funcs/messagesDelete.js +11 -7
  37. package/funcs/messagesDelete.js.map +1 -1
  38. package/funcs/messagesDeleteByTransactionId.d.ts +2 -1
  39. package/funcs/messagesDeleteByTransactionId.d.ts.map +1 -1
  40. package/funcs/messagesDeleteByTransactionId.js +11 -7
  41. package/funcs/messagesDeleteByTransactionId.js.map +1 -1
  42. package/funcs/messagesRetrieve.d.ts +2 -1
  43. package/funcs/messagesRetrieve.d.ts.map +1 -1
  44. package/funcs/messagesRetrieve.js +11 -7
  45. package/funcs/messagesRetrieve.js.map +1 -1
  46. package/funcs/notificationsList.d.ts +2 -1
  47. package/funcs/notificationsList.d.ts.map +1 -1
  48. package/funcs/notificationsList.js +12 -7
  49. package/funcs/notificationsList.js.map +1 -1
  50. package/funcs/notificationsRetrieve.d.ts +2 -1
  51. package/funcs/notificationsRetrieve.d.ts.map +1 -1
  52. package/funcs/notificationsRetrieve.js +11 -7
  53. package/funcs/notificationsRetrieve.js.map +1 -1
  54. package/funcs/notificationsStatsGraph.d.ts +2 -1
  55. package/funcs/notificationsStatsGraph.d.ts.map +1 -1
  56. package/funcs/notificationsStatsGraph.js +11 -7
  57. package/funcs/notificationsStatsGraph.js.map +1 -1
  58. package/funcs/notificationsStatsRetrieve.d.ts +2 -1
  59. package/funcs/notificationsStatsRetrieve.d.ts.map +1 -1
  60. package/funcs/notificationsStatsRetrieve.js +11 -7
  61. package/funcs/notificationsStatsRetrieve.js.map +1 -1
  62. package/funcs/subscribersAuthenticationChatAccessOauth.d.ts +2 -1
  63. package/funcs/subscribersAuthenticationChatAccessOauth.d.ts.map +1 -1
  64. package/funcs/subscribersAuthenticationChatAccessOauth.js +11 -7
  65. package/funcs/subscribersAuthenticationChatAccessOauth.js.map +1 -1
  66. package/funcs/subscribersAuthenticationChatAccessOauthCallBack.d.ts +2 -1
  67. package/funcs/subscribersAuthenticationChatAccessOauthCallBack.d.ts.map +1 -1
  68. package/funcs/subscribersAuthenticationChatAccessOauthCallBack.js +11 -7
  69. package/funcs/subscribersAuthenticationChatAccessOauthCallBack.js.map +1 -1
  70. package/funcs/subscribersCreate.d.ts +2 -1
  71. package/funcs/subscribersCreate.d.ts.map +1 -1
  72. package/funcs/subscribersCreate.js +12 -8
  73. package/funcs/subscribersCreate.js.map +1 -1
  74. package/funcs/subscribersCreateBulk.d.ts +2 -1
  75. package/funcs/subscribersCreateBulk.d.ts.map +1 -1
  76. package/funcs/subscribersCreateBulk.js +11 -7
  77. package/funcs/subscribersCreateBulk.js.map +1 -1
  78. package/funcs/subscribersCredentialsAppend.d.ts +2 -1
  79. package/funcs/subscribersCredentialsAppend.d.ts.map +1 -1
  80. package/funcs/subscribersCredentialsAppend.js +11 -7
  81. package/funcs/subscribersCredentialsAppend.js.map +1 -1
  82. package/funcs/subscribersCredentialsDelete.d.ts +2 -1
  83. package/funcs/subscribersCredentialsDelete.d.ts.map +1 -1
  84. package/funcs/subscribersCredentialsDelete.js +11 -7
  85. package/funcs/subscribersCredentialsDelete.js.map +1 -1
  86. package/funcs/subscribersCredentialsUpdate.d.ts +2 -1
  87. package/funcs/subscribersCredentialsUpdate.d.ts.map +1 -1
  88. package/funcs/subscribersCredentialsUpdate.js +11 -7
  89. package/funcs/subscribersCredentialsUpdate.js.map +1 -1
  90. package/funcs/subscribersDelete.d.ts +2 -1
  91. package/funcs/subscribersDelete.d.ts.map +1 -1
  92. package/funcs/subscribersDelete.js +11 -7
  93. package/funcs/subscribersDelete.js.map +1 -1
  94. package/funcs/subscribersList.d.ts +2 -1
  95. package/funcs/subscribersList.d.ts.map +1 -1
  96. package/funcs/subscribersList.js +19 -7
  97. package/funcs/subscribersList.js.map +1 -1
  98. package/funcs/subscribersMessagesMarkAll.d.ts +2 -1
  99. package/funcs/subscribersMessagesMarkAll.d.ts.map +1 -1
  100. package/funcs/subscribersMessagesMarkAll.js +11 -7
  101. package/funcs/subscribersMessagesMarkAll.js.map +1 -1
  102. package/funcs/subscribersMessagesMarkAllAs.d.ts +2 -1
  103. package/funcs/subscribersMessagesMarkAllAs.d.ts.map +1 -1
  104. package/funcs/subscribersMessagesMarkAllAs.js +11 -7
  105. package/funcs/subscribersMessagesMarkAllAs.js.map +1 -1
  106. package/funcs/subscribersMessagesUpdateAsSeen.d.ts +2 -1
  107. package/funcs/subscribersMessagesUpdateAsSeen.d.ts.map +1 -1
  108. package/funcs/subscribersMessagesUpdateAsSeen.js +11 -7
  109. package/funcs/subscribersMessagesUpdateAsSeen.js.map +1 -1
  110. package/funcs/subscribersNotificationsFeed.d.ts +2 -1
  111. package/funcs/subscribersNotificationsFeed.d.ts.map +1 -1
  112. package/funcs/subscribersNotificationsFeed.js +11 -7
  113. package/funcs/subscribersNotificationsFeed.js.map +1 -1
  114. package/funcs/subscribersNotificationsUnseenCount.d.ts +2 -1
  115. package/funcs/subscribersNotificationsUnseenCount.d.ts.map +1 -1
  116. package/funcs/subscribersNotificationsUnseenCount.js +11 -7
  117. package/funcs/subscribersNotificationsUnseenCount.js.map +1 -1
  118. package/funcs/subscribersPatch.d.ts +2 -1
  119. package/funcs/subscribersPatch.d.ts.map +1 -1
  120. package/funcs/subscribersPatch.js +11 -7
  121. package/funcs/subscribersPatch.js.map +1 -1
  122. package/funcs/subscribersPreferencesList.d.ts +2 -1
  123. package/funcs/subscribersPreferencesList.d.ts.map +1 -1
  124. package/funcs/subscribersPreferencesList.js +11 -7
  125. package/funcs/subscribersPreferencesList.js.map +1 -1
  126. package/funcs/subscribersPreferencesUpdate.d.ts +2 -1
  127. package/funcs/subscribersPreferencesUpdate.d.ts.map +1 -1
  128. package/funcs/subscribersPreferencesUpdate.js +11 -7
  129. package/funcs/subscribersPreferencesUpdate.js.map +1 -1
  130. package/funcs/subscribersPropertiesUpdateOnlineFlag.d.ts +2 -1
  131. package/funcs/subscribersPropertiesUpdateOnlineFlag.d.ts.map +1 -1
  132. package/funcs/subscribersPropertiesUpdateOnlineFlag.js +11 -7
  133. package/funcs/subscribersPropertiesUpdateOnlineFlag.js.map +1 -1
  134. package/funcs/subscribersRetrieve.d.ts +2 -1
  135. package/funcs/subscribersRetrieve.d.ts.map +1 -1
  136. package/funcs/subscribersRetrieve.js +11 -7
  137. package/funcs/subscribersRetrieve.js.map +1 -1
  138. package/funcs/subscribersSearch.d.ts +2 -1
  139. package/funcs/subscribersSearch.d.ts.map +1 -1
  140. package/funcs/subscribersSearch.js +11 -7
  141. package/funcs/subscribersSearch.js.map +1 -1
  142. package/funcs/topicsCreate.d.ts +2 -1
  143. package/funcs/topicsCreate.d.ts.map +1 -1
  144. package/funcs/topicsCreate.js +11 -7
  145. package/funcs/topicsCreate.js.map +1 -1
  146. package/funcs/topicsDelete.d.ts +2 -1
  147. package/funcs/topicsDelete.d.ts.map +1 -1
  148. package/funcs/topicsDelete.js +11 -7
  149. package/funcs/topicsDelete.js.map +1 -1
  150. package/funcs/topicsList.d.ts +2 -1
  151. package/funcs/topicsList.d.ts.map +1 -1
  152. package/funcs/topicsList.js +11 -7
  153. package/funcs/topicsList.js.map +1 -1
  154. package/funcs/topicsRename.d.ts +2 -1
  155. package/funcs/topicsRename.d.ts.map +1 -1
  156. package/funcs/topicsRename.js +11 -7
  157. package/funcs/topicsRename.js.map +1 -1
  158. package/funcs/topicsRetrieve.d.ts +2 -1
  159. package/funcs/topicsRetrieve.d.ts.map +1 -1
  160. package/funcs/topicsRetrieve.js +11 -7
  161. package/funcs/topicsRetrieve.js.map +1 -1
  162. package/funcs/topicsSubscribersAssign.d.ts +2 -1
  163. package/funcs/topicsSubscribersAssign.d.ts.map +1 -1
  164. package/funcs/topicsSubscribersAssign.js +11 -7
  165. package/funcs/topicsSubscribersAssign.js.map +1 -1
  166. package/funcs/topicsSubscribersRemove.d.ts +2 -1
  167. package/funcs/topicsSubscribersRemove.d.ts.map +1 -1
  168. package/funcs/topicsSubscribersRemove.js +11 -7
  169. package/funcs/topicsSubscribersRemove.js.map +1 -1
  170. package/funcs/topicsSubscribersRetrieve.d.ts +2 -1
  171. package/funcs/topicsSubscribersRetrieve.d.ts.map +1 -1
  172. package/funcs/topicsSubscribersRetrieve.js +11 -7
  173. package/funcs/topicsSubscribersRetrieve.js.map +1 -1
  174. package/funcs/trigger.d.ts +2 -1
  175. package/funcs/trigger.d.ts.map +1 -1
  176. package/funcs/trigger.js +11 -7
  177. package/funcs/trigger.js.map +1 -1
  178. package/funcs/triggerBroadcast.d.ts +2 -1
  179. package/funcs/triggerBroadcast.d.ts.map +1 -1
  180. package/funcs/triggerBroadcast.js +11 -7
  181. package/funcs/triggerBroadcast.js.map +1 -1
  182. package/funcs/triggerBulk.d.ts +2 -1
  183. package/funcs/triggerBulk.d.ts.map +1 -1
  184. package/funcs/triggerBulk.js +11 -7
  185. package/funcs/triggerBulk.js.map +1 -1
  186. package/jsr.json +1 -1
  187. package/lib/config.d.ts +3 -3
  188. package/lib/config.js +3 -3
  189. package/models/components/activitynotificationtemplateresponsedto.d.ts +6 -0
  190. package/models/components/activitynotificationtemplateresponsedto.d.ts.map +1 -1
  191. package/models/components/activitynotificationtemplateresponsedto.js +3 -0
  192. package/models/components/activitynotificationtemplateresponsedto.js.map +1 -1
  193. package/models/components/createsubscriberrequestdto.d.ts +28 -50
  194. package/models/components/createsubscriberrequestdto.d.ts.map +1 -1
  195. package/models/components/createsubscriberrequestdto.js +17 -41
  196. package/models/components/createsubscriberrequestdto.js.map +1 -1
  197. package/models/components/index.d.ts +1 -0
  198. package/models/components/index.d.ts.map +1 -1
  199. package/models/components/index.js +1 -0
  200. package/models/components/index.js.map +1 -1
  201. package/models/components/patchsubscriberrequestdto.d.ts +0 -5
  202. package/models/components/patchsubscriberrequestdto.d.ts.map +1 -1
  203. package/models/components/patchsubscriberrequestdto.js +0 -2
  204. package/models/components/patchsubscriberrequestdto.js.map +1 -1
  205. package/models/components/subscriberpayloaddto.d.ts +5 -0
  206. package/models/components/subscriberpayloaddto.d.ts.map +1 -1
  207. package/models/components/subscriberpayloaddto.js +2 -0
  208. package/models/components/subscriberpayloaddto.js.map +1 -1
  209. package/models/components/triggereventresponsedto.d.ts +3 -0
  210. package/models/components/triggereventresponsedto.d.ts.map +1 -1
  211. package/models/components/triggereventresponsedto.js +1 -0
  212. package/models/components/triggereventresponsedto.js.map +1 -1
  213. package/models/components/workfloworiginenum.d.ts +37 -0
  214. package/models/components/workfloworiginenum.d.ts.map +1 -0
  215. package/models/components/workfloworiginenum.js +54 -0
  216. package/models/components/workfloworiginenum.js.map +1 -0
  217. package/models/operations/notificationscontrollerlistnotifications.d.ts +5 -0
  218. package/models/operations/notificationscontrollerlistnotifications.d.ts.map +1 -1
  219. package/models/operations/notificationscontrollerlistnotifications.js +2 -0
  220. package/models/operations/notificationscontrollerlistnotifications.js.map +1 -1
  221. package/package.json +1 -1
  222. package/sources/json-development.json +57 -45
  223. package/src/funcs/cancel.ts +40 -7
  224. package/src/funcs/integrationsCreate.ts +40 -7
  225. package/src/funcs/integrationsDelete.ts +40 -7
  226. package/src/funcs/integrationsList.ts +38 -7
  227. package/src/funcs/integrationsListActive.ts +38 -7
  228. package/src/funcs/integrationsSetAsPrimary.ts +40 -7
  229. package/src/funcs/integrationsUpdate.ts +42 -7
  230. package/src/funcs/integrationsWebhooksRetrieve.ts +40 -7
  231. package/src/funcs/messagesDelete.ts +40 -7
  232. package/src/funcs/messagesDeleteByTransactionId.ts +43 -7
  233. package/src/funcs/messagesRetrieve.ts +38 -7
  234. package/src/funcs/notificationsList.ts +39 -7
  235. package/src/funcs/notificationsRetrieve.ts +40 -7
  236. package/src/funcs/notificationsStatsGraph.ts +40 -7
  237. package/src/funcs/notificationsStatsRetrieve.ts +38 -7
  238. package/src/funcs/subscribersAuthenticationChatAccessOauth.ts +38 -7
  239. package/src/funcs/subscribersAuthenticationChatAccessOauthCallBack.ts +40 -7
  240. package/src/funcs/subscribersCreate.ts +41 -8
  241. package/src/funcs/subscribersCreateBulk.ts +40 -7
  242. package/src/funcs/subscribersCredentialsAppend.ts +43 -7
  243. package/src/funcs/subscribersCredentialsDelete.ts +43 -7
  244. package/src/funcs/subscribersCredentialsUpdate.ts +43 -7
  245. package/src/funcs/subscribersDelete.ts +40 -7
  246. package/src/funcs/subscribersList.ts +53 -7
  247. package/src/funcs/subscribersMessagesMarkAll.ts +42 -7
  248. package/src/funcs/subscribersMessagesMarkAllAs.ts +42 -7
  249. package/src/funcs/subscribersMessagesUpdateAsSeen.ts +38 -7
  250. package/src/funcs/subscribersNotificationsFeed.ts +38 -7
  251. package/src/funcs/subscribersNotificationsUnseenCount.ts +38 -7
  252. package/src/funcs/subscribersPatch.ts +42 -7
  253. package/src/funcs/subscribersPreferencesList.ts +40 -7
  254. package/src/funcs/subscribersPreferencesUpdate.ts +42 -7
  255. package/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts +43 -7
  256. package/src/funcs/subscribersRetrieve.ts +40 -7
  257. package/src/funcs/subscribersSearch.ts +38 -7
  258. package/src/funcs/topicsCreate.ts +40 -7
  259. package/src/funcs/topicsDelete.ts +40 -7
  260. package/src/funcs/topicsList.ts +38 -7
  261. package/src/funcs/topicsRename.ts +42 -7
  262. package/src/funcs/topicsRetrieve.ts +40 -7
  263. package/src/funcs/topicsSubscribersAssign.ts +42 -7
  264. package/src/funcs/topicsSubscribersRemove.ts +42 -7
  265. package/src/funcs/topicsSubscribersRetrieve.ts +42 -7
  266. package/src/funcs/trigger.ts +40 -7
  267. package/src/funcs/triggerBroadcast.ts +40 -7
  268. package/src/funcs/triggerBulk.ts +40 -7
  269. package/src/lib/config.ts +3 -3
  270. package/src/models/components/activitynotificationtemplateresponsedto.ts +12 -0
  271. package/src/models/components/createsubscriberrequestdto.ts +41 -111
  272. package/src/models/components/index.ts +1 -0
  273. package/src/models/components/patchsubscriberrequestdto.ts +0 -7
  274. package/src/models/components/subscriberpayloaddto.ts +7 -0
  275. package/src/models/components/triggereventresponsedto.ts +1 -0
  276. package/src/models/components/workfloworiginenum.ts +40 -0
  277. package/src/models/operations/notificationscontrollerlistnotifications.ts +7 -0
  278. package/src/types/async.ts +68 -0
  279. package/types/async.d.ts +23 -0
  280. package/types/async.d.ts.map +1 -0
  281. package/types/async.js +44 -0
  282. package/types/async.js.map +1 -0
@@ -21,6 +21,7 @@ import * as errors from "../models/errors/index.js";
21
21
  import { SDKError } from "../models/errors/sdkerror.js";
22
22
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
23
  import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
24
25
  import { Result } from "../types/fp.js";
25
26
 
26
27
  /**
@@ -29,13 +30,13 @@ import { Result } from "../types/fp.js";
29
30
  * @remarks
30
31
  * Deletes messages entity from the Novu platform using TransactionId of message
31
32
  */
32
- export async function messagesDeleteByTransactionId(
33
+ export function messagesDeleteByTransactionId(
33
34
  client: NovuCore,
34
35
  transactionId: string,
35
36
  channel?: operations.Channel | undefined,
36
37
  idempotencyKey?: string | undefined,
37
38
  options?: RequestOptions,
38
- ): Promise<
39
+ ): APIPromise<
39
40
  Result<
40
41
  | operations.MessagesControllerDeleteMessagesByTransactionIdResponse
41
42
  | undefined,
@@ -51,6 +52,41 @@ export async function messagesDeleteByTransactionId(
51
52
  | RequestTimeoutError
52
53
  | ConnectionError
53
54
  >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ transactionId,
59
+ channel,
60
+ idempotencyKey,
61
+ options,
62
+ ));
63
+ }
64
+
65
+ async function $do(
66
+ client: NovuCore,
67
+ transactionId: string,
68
+ channel?: operations.Channel | undefined,
69
+ idempotencyKey?: string | undefined,
70
+ options?: RequestOptions,
71
+ ): Promise<
72
+ [
73
+ Result<
74
+ | operations.MessagesControllerDeleteMessagesByTransactionIdResponse
75
+ | undefined,
76
+ | errors.ErrorDto
77
+ | errors.ErrorDto
78
+ | errors.ValidationErrorDto
79
+ | errors.ErrorDto
80
+ | SDKError
81
+ | SDKValidationError
82
+ | UnexpectedClientError
83
+ | InvalidRequestError
84
+ | RequestAbortedError
85
+ | RequestTimeoutError
86
+ | ConnectionError
87
+ >,
88
+ APICall,
89
+ ]
54
90
  > {
55
91
  const input:
56
92
  operations.MessagesControllerDeleteMessagesByTransactionIdRequest = {
@@ -68,7 +104,7 @@ export async function messagesDeleteByTransactionId(
68
104
  "Input validation failed",
69
105
  );
70
106
  if (!parsed.ok) {
71
- return parsed;
107
+ return [parsed, { status: "invalid" }];
72
108
  }
73
109
  const payload = parsed.value;
74
110
  const body = null;
@@ -136,7 +172,7 @@ export async function messagesDeleteByTransactionId(
136
172
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
137
173
  }, options);
138
174
  if (!requestRes.ok) {
139
- return requestRes;
175
+ return [requestRes, { status: "invalid" }];
140
176
  }
141
177
  const req = requestRes.value;
142
178
 
@@ -163,7 +199,7 @@ export async function messagesDeleteByTransactionId(
163
199
  retryCodes: context.retryCodes,
164
200
  });
165
201
  if (!doResult.ok) {
166
- return doResult;
202
+ return [doResult, { status: "request-error", request: req }];
167
203
  }
168
204
  const response = doResult.value;
169
205
 
@@ -207,8 +243,8 @@ export async function messagesDeleteByTransactionId(
207
243
  M.fail("5XX"),
208
244
  )(response, { extraFields: responseFields });
209
245
  if (!result.ok) {
210
- return result;
246
+ return [result, { status: "complete", request: req, response }];
211
247
  }
212
248
 
213
- return result;
249
+ return [result, { status: "complete", request: req, response }];
214
250
  }
@@ -21,6 +21,7 @@ import * as errors from "../models/errors/index.js";
21
21
  import { SDKError } from "../models/errors/sdkerror.js";
22
22
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
23
  import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
24
25
  import { Result } from "../types/fp.js";
25
26
 
26
27
  /**
@@ -29,11 +30,11 @@ import { Result } from "../types/fp.js";
29
30
  * @remarks
30
31
  * Returns a list of messages, could paginate using the `page` query parameter
31
32
  */
32
- export async function messagesRetrieve(
33
+ export function messagesRetrieve(
33
34
  client: NovuCore,
34
35
  request: operations.MessagesControllerGetMessagesRequest,
35
36
  options?: RequestOptions,
36
- ): Promise<
37
+ ): APIPromise<
37
38
  Result<
38
39
  operations.MessagesControllerGetMessagesResponse,
39
40
  | errors.ErrorDto
@@ -48,6 +49,36 @@ export async function messagesRetrieve(
48
49
  | RequestTimeoutError
49
50
  | ConnectionError
50
51
  >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ request,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: NovuCore,
62
+ request: operations.MessagesControllerGetMessagesRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ operations.MessagesControllerGetMessagesResponse,
68
+ | errors.ErrorDto
69
+ | errors.ErrorDto
70
+ | errors.ValidationErrorDto
71
+ | errors.ErrorDto
72
+ | SDKError
73
+ | SDKValidationError
74
+ | UnexpectedClientError
75
+ | InvalidRequestError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | ConnectionError
79
+ >,
80
+ APICall,
81
+ ]
51
82
  > {
52
83
  const parsed = safeParse(
53
84
  request,
@@ -58,7 +89,7 @@ export async function messagesRetrieve(
58
89
  "Input validation failed",
59
90
  );
60
91
  if (!parsed.ok) {
61
- return parsed;
92
+ return [parsed, { status: "invalid" }];
62
93
  }
63
94
  const payload = parsed.value;
64
95
  const body = null;
@@ -121,7 +152,7 @@ export async function messagesRetrieve(
121
152
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
122
153
  }, options);
123
154
  if (!requestRes.ok) {
124
- return requestRes;
155
+ return [requestRes, { status: "invalid" }];
125
156
  }
126
157
  const req = requestRes.value;
127
158
 
@@ -148,7 +179,7 @@ export async function messagesRetrieve(
148
179
  retryCodes: context.retryCodes,
149
180
  });
150
181
  if (!doResult.ok) {
151
- return doResult;
182
+ return [doResult, { status: "request-error", request: req }];
152
183
  }
153
184
  const response = doResult.value;
154
185
 
@@ -189,8 +220,8 @@ export async function messagesRetrieve(
189
220
  M.fail("5XX"),
190
221
  )(response, { extraFields: responseFields });
191
222
  if (!result.ok) {
192
- return result;
223
+ return [result, { status: "complete", request: req, response }];
193
224
  }
194
225
 
195
- return result;
226
+ return [result, { status: "complete", request: req, response }];
196
227
  }
@@ -21,16 +21,17 @@ import * as errors from "../models/errors/index.js";
21
21
  import { SDKError } from "../models/errors/sdkerror.js";
22
22
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
23
  import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
24
25
  import { Result } from "../types/fp.js";
25
26
 
26
27
  /**
27
28
  * Get notifications
28
29
  */
29
- export async function notificationsList(
30
+ export function notificationsList(
30
31
  client: NovuCore,
31
32
  request: operations.NotificationsControllerListNotificationsRequest,
32
33
  options?: RequestOptions,
33
- ): Promise<
34
+ ): APIPromise<
34
35
  Result<
35
36
  operations.NotificationsControllerListNotificationsResponse,
36
37
  | errors.ErrorDto
@@ -45,6 +46,36 @@ export async function notificationsList(
45
46
  | RequestTimeoutError
46
47
  | ConnectionError
47
48
  >
49
+ > {
50
+ return new APIPromise($do(
51
+ client,
52
+ request,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ async function $do(
58
+ client: NovuCore,
59
+ request: operations.NotificationsControllerListNotificationsRequest,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ operations.NotificationsControllerListNotificationsResponse,
65
+ | errors.ErrorDto
66
+ | errors.ErrorDto
67
+ | errors.ValidationErrorDto
68
+ | errors.ErrorDto
69
+ | SDKError
70
+ | SDKValidationError
71
+ | UnexpectedClientError
72
+ | InvalidRequestError
73
+ | RequestAbortedError
74
+ | RequestTimeoutError
75
+ | ConnectionError
76
+ >,
77
+ APICall,
78
+ ]
48
79
  > {
49
80
  const parsed = safeParse(
50
81
  request,
@@ -54,7 +85,7 @@ export async function notificationsList(
54
85
  "Input validation failed",
55
86
  );
56
87
  if (!parsed.ok) {
57
- return parsed;
88
+ return [parsed, { status: "invalid" }];
58
89
  }
59
90
  const payload = parsed.value;
60
91
  const body = null;
@@ -66,6 +97,7 @@ export async function notificationsList(
66
97
  "before": payload.before,
67
98
  "channels": payload.channels,
68
99
  "emails": payload.emails,
100
+ "limit": payload.limit,
69
101
  "page": payload.page,
70
102
  "search": payload.search,
71
103
  "subscriberIds": payload.subscriberIds,
@@ -121,7 +153,7 @@ export async function notificationsList(
121
153
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
122
154
  }, options);
123
155
  if (!requestRes.ok) {
124
- return requestRes;
156
+ return [requestRes, { status: "invalid" }];
125
157
  }
126
158
  const req = requestRes.value;
127
159
 
@@ -148,7 +180,7 @@ export async function notificationsList(
148
180
  retryCodes: context.retryCodes,
149
181
  });
150
182
  if (!doResult.ok) {
151
- return doResult;
183
+ return [doResult, { status: "request-error", request: req }];
152
184
  }
153
185
  const response = doResult.value;
154
186
 
@@ -189,8 +221,8 @@ export async function notificationsList(
189
221
  M.fail("5XX"),
190
222
  )(response, { extraFields: responseFields });
191
223
  if (!result.ok) {
192
- return result;
224
+ return [result, { status: "complete", request: req, response }];
193
225
  }
194
226
 
195
- return result;
227
+ return [result, { status: "complete", request: req, response }];
196
228
  }
@@ -21,17 +21,18 @@ import * as errors from "../models/errors/index.js";
21
21
  import { SDKError } from "../models/errors/sdkerror.js";
22
22
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
23
  import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
24
25
  import { Result } from "../types/fp.js";
25
26
 
26
27
  /**
27
28
  * Get notification
28
29
  */
29
- export async function notificationsRetrieve(
30
+ export function notificationsRetrieve(
30
31
  client: NovuCore,
31
32
  notificationId: string,
32
33
  idempotencyKey?: string | undefined,
33
34
  options?: RequestOptions,
34
- ): Promise<
35
+ ): APIPromise<
35
36
  Result<
36
37
  operations.NotificationsControllerGetNotificationResponse,
37
38
  | errors.ErrorDto
@@ -46,6 +47,38 @@ export async function notificationsRetrieve(
46
47
  | RequestTimeoutError
47
48
  | ConnectionError
48
49
  >
50
+ > {
51
+ return new APIPromise($do(
52
+ client,
53
+ notificationId,
54
+ idempotencyKey,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: NovuCore,
61
+ notificationId: string,
62
+ idempotencyKey?: string | undefined,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ operations.NotificationsControllerGetNotificationResponse,
68
+ | errors.ErrorDto
69
+ | errors.ErrorDto
70
+ | errors.ValidationErrorDto
71
+ | errors.ErrorDto
72
+ | SDKError
73
+ | SDKValidationError
74
+ | UnexpectedClientError
75
+ | InvalidRequestError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | ConnectionError
79
+ >,
80
+ APICall,
81
+ ]
49
82
  > {
50
83
  const input: operations.NotificationsControllerGetNotificationRequest = {
51
84
  notificationId: notificationId,
@@ -60,7 +93,7 @@ export async function notificationsRetrieve(
60
93
  "Input validation failed",
61
94
  );
62
95
  if (!parsed.ok) {
63
- return parsed;
96
+ return [parsed, { status: "invalid" }];
64
97
  }
65
98
  const payload = parsed.value;
66
99
  const body = null;
@@ -121,7 +154,7 @@ export async function notificationsRetrieve(
121
154
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
122
155
  }, options);
123
156
  if (!requestRes.ok) {
124
- return requestRes;
157
+ return [requestRes, { status: "invalid" }];
125
158
  }
126
159
  const req = requestRes.value;
127
160
 
@@ -148,7 +181,7 @@ export async function notificationsRetrieve(
148
181
  retryCodes: context.retryCodes,
149
182
  });
150
183
  if (!doResult.ok) {
151
- return doResult;
184
+ return [doResult, { status: "request-error", request: req }];
152
185
  }
153
186
  const response = doResult.value;
154
187
 
@@ -189,8 +222,8 @@ export async function notificationsRetrieve(
189
222
  M.fail("5XX"),
190
223
  )(response, { extraFields: responseFields });
191
224
  if (!result.ok) {
192
- return result;
225
+ return [result, { status: "complete", request: req, response }];
193
226
  }
194
227
 
195
- return result;
228
+ return [result, { status: "complete", request: req, response }];
196
229
  }
@@ -21,17 +21,18 @@ import * as errors from "../models/errors/index.js";
21
21
  import { SDKError } from "../models/errors/sdkerror.js";
22
22
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
23
  import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
24
25
  import { Result } from "../types/fp.js";
25
26
 
26
27
  /**
27
28
  * Get notification graph statistics
28
29
  */
29
- export async function notificationsStatsGraph(
30
+ export function notificationsStatsGraph(
30
31
  client: NovuCore,
31
32
  days?: number | undefined,
32
33
  idempotencyKey?: string | undefined,
33
34
  options?: RequestOptions,
34
- ): Promise<
35
+ ): APIPromise<
35
36
  Result<
36
37
  operations.NotificationsControllerGetActivityGraphStatsResponse,
37
38
  | errors.ErrorDto
@@ -46,6 +47,38 @@ export async function notificationsStatsGraph(
46
47
  | RequestTimeoutError
47
48
  | ConnectionError
48
49
  >
50
+ > {
51
+ return new APIPromise($do(
52
+ client,
53
+ days,
54
+ idempotencyKey,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: NovuCore,
61
+ days?: number | undefined,
62
+ idempotencyKey?: string | undefined,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ operations.NotificationsControllerGetActivityGraphStatsResponse,
68
+ | errors.ErrorDto
69
+ | errors.ErrorDto
70
+ | errors.ValidationErrorDto
71
+ | errors.ErrorDto
72
+ | SDKError
73
+ | SDKValidationError
74
+ | UnexpectedClientError
75
+ | InvalidRequestError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | ConnectionError
79
+ >,
80
+ APICall,
81
+ ]
49
82
  > {
50
83
  const input: operations.NotificationsControllerGetActivityGraphStatsRequest =
51
84
  {
@@ -62,7 +95,7 @@ export async function notificationsStatsGraph(
62
95
  "Input validation failed",
63
96
  );
64
97
  if (!parsed.ok) {
65
- return parsed;
98
+ return [parsed, { status: "invalid" }];
66
99
  }
67
100
  const payload = parsed.value;
68
101
  const body = null;
@@ -121,7 +154,7 @@ export async function notificationsStatsGraph(
121
154
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
122
155
  }, options);
123
156
  if (!requestRes.ok) {
124
- return requestRes;
157
+ return [requestRes, { status: "invalid" }];
125
158
  }
126
159
  const req = requestRes.value;
127
160
 
@@ -148,7 +181,7 @@ export async function notificationsStatsGraph(
148
181
  retryCodes: context.retryCodes,
149
182
  });
150
183
  if (!doResult.ok) {
151
- return doResult;
184
+ return [doResult, { status: "request-error", request: req }];
152
185
  }
153
186
  const response = doResult.value;
154
187
 
@@ -190,8 +223,8 @@ export async function notificationsStatsGraph(
190
223
  M.fail("5XX"),
191
224
  )(response, { extraFields: responseFields });
192
225
  if (!result.ok) {
193
- return result;
226
+ return [result, { status: "complete", request: req, response }];
194
227
  }
195
228
 
196
- return result;
229
+ return [result, { status: "complete", request: req, response }];
197
230
  }
@@ -21,16 +21,17 @@ import * as errors from "../models/errors/index.js";
21
21
  import { SDKError } from "../models/errors/sdkerror.js";
22
22
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
23
  import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
24
25
  import { Result } from "../types/fp.js";
25
26
 
26
27
  /**
27
28
  * Get notification statistics
28
29
  */
29
- export async function notificationsStatsRetrieve(
30
+ export function notificationsStatsRetrieve(
30
31
  client: NovuCore,
31
32
  idempotencyKey?: string | undefined,
32
33
  options?: RequestOptions,
33
- ): Promise<
34
+ ): APIPromise<
34
35
  Result<
35
36
  operations.NotificationsControllerGetActivityStatsResponse,
36
37
  | errors.ErrorDto
@@ -45,6 +46,36 @@ export async function notificationsStatsRetrieve(
45
46
  | RequestTimeoutError
46
47
  | ConnectionError
47
48
  >
49
+ > {
50
+ return new APIPromise($do(
51
+ client,
52
+ idempotencyKey,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ async function $do(
58
+ client: NovuCore,
59
+ idempotencyKey?: string | undefined,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ operations.NotificationsControllerGetActivityStatsResponse,
65
+ | errors.ErrorDto
66
+ | errors.ErrorDto
67
+ | errors.ValidationErrorDto
68
+ | errors.ErrorDto
69
+ | SDKError
70
+ | SDKValidationError
71
+ | UnexpectedClientError
72
+ | InvalidRequestError
73
+ | RequestAbortedError
74
+ | RequestTimeoutError
75
+ | ConnectionError
76
+ >,
77
+ APICall,
78
+ ]
48
79
  > {
49
80
  const input: operations.NotificationsControllerGetActivityStatsRequest = {
50
81
  idempotencyKey: idempotencyKey,
@@ -58,7 +89,7 @@ export async function notificationsStatsRetrieve(
58
89
  "Input validation failed",
59
90
  );
60
91
  if (!parsed.ok) {
61
- return parsed;
92
+ return [parsed, { status: "invalid" }];
62
93
  }
63
94
  const payload = parsed.value;
64
95
  const body = null;
@@ -112,7 +143,7 @@ export async function notificationsStatsRetrieve(
112
143
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
113
144
  }, options);
114
145
  if (!requestRes.ok) {
115
- return requestRes;
146
+ return [requestRes, { status: "invalid" }];
116
147
  }
117
148
  const req = requestRes.value;
118
149
 
@@ -139,7 +170,7 @@ export async function notificationsStatsRetrieve(
139
170
  retryCodes: context.retryCodes,
140
171
  });
141
172
  if (!doResult.ok) {
142
- return doResult;
173
+ return [doResult, { status: "request-error", request: req }];
143
174
  }
144
175
  const response = doResult.value;
145
176
 
@@ -180,8 +211,8 @@ export async function notificationsStatsRetrieve(
180
211
  M.fail("5XX"),
181
212
  )(response, { extraFields: responseFields });
182
213
  if (!result.ok) {
183
- return result;
214
+ return [result, { status: "complete", request: req, response }];
184
215
  }
185
216
 
186
- return result;
217
+ return [result, { status: "complete", request: req, response }];
187
218
  }
@@ -21,16 +21,17 @@ import * as errors from "../models/errors/index.js";
21
21
  import { SDKError } from "../models/errors/sdkerror.js";
22
22
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
23
  import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
24
25
  import { Result } from "../types/fp.js";
25
26
 
26
27
  /**
27
28
  * Handle chat oauth
28
29
  */
29
- export async function subscribersAuthenticationChatAccessOauth(
30
+ export function subscribersAuthenticationChatAccessOauth(
30
31
  client: NovuCore,
31
32
  request: operations.SubscribersV1ControllerChatAccessOauthRequest,
32
33
  options?: RequestOptions,
33
- ): Promise<
34
+ ): APIPromise<
34
35
  Result<
35
36
  operations.SubscribersV1ControllerChatAccessOauthResponse | undefined,
36
37
  | errors.ErrorDto
@@ -45,6 +46,36 @@ export async function subscribersAuthenticationChatAccessOauth(
45
46
  | RequestTimeoutError
46
47
  | ConnectionError
47
48
  >
49
+ > {
50
+ return new APIPromise($do(
51
+ client,
52
+ request,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ async function $do(
58
+ client: NovuCore,
59
+ request: operations.SubscribersV1ControllerChatAccessOauthRequest,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ operations.SubscribersV1ControllerChatAccessOauthResponse | undefined,
65
+ | errors.ErrorDto
66
+ | errors.ErrorDto
67
+ | errors.ValidationErrorDto
68
+ | errors.ErrorDto
69
+ | SDKError
70
+ | SDKValidationError
71
+ | UnexpectedClientError
72
+ | InvalidRequestError
73
+ | RequestAbortedError
74
+ | RequestTimeoutError
75
+ | ConnectionError
76
+ >,
77
+ APICall,
78
+ ]
48
79
  > {
49
80
  const parsed = safeParse(
50
81
  request,
@@ -54,7 +85,7 @@ export async function subscribersAuthenticationChatAccessOauth(
54
85
  "Input validation failed",
55
86
  );
56
87
  if (!parsed.ok) {
57
- return parsed;
88
+ return [parsed, { status: "invalid" }];
58
89
  }
59
90
  const payload = parsed.value;
60
91
  const body = null;
@@ -128,7 +159,7 @@ export async function subscribersAuthenticationChatAccessOauth(
128
159
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
129
160
  }, options);
130
161
  if (!requestRes.ok) {
131
- return requestRes;
162
+ return [requestRes, { status: "invalid" }];
132
163
  }
133
164
  const req = requestRes.value;
134
165
 
@@ -155,7 +186,7 @@ export async function subscribersAuthenticationChatAccessOauth(
155
186
  retryCodes: context.retryCodes,
156
187
  });
157
188
  if (!doResult.ok) {
158
- return doResult;
189
+ return [doResult, { status: "request-error", request: req }];
159
190
  }
160
191
  const response = doResult.value;
161
192
 
@@ -196,8 +227,8 @@ export async function subscribersAuthenticationChatAccessOauth(
196
227
  M.fail("5XX"),
197
228
  )(response, { extraFields: responseFields });
198
229
  if (!result.ok) {
199
- return result;
230
+ return [result, { status: "complete", request: req, response }];
200
231
  }
201
232
 
202
- return result;
233
+ return [result, { status: "complete", request: req, response }];
203
234
  }