@novu/api 0.0.1-alpha.83 → 0.0.1-alpha.88

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 (203) hide show
  1. package/README.md +0 -30
  2. package/hooks/novu-custom-hook.js +1 -1
  3. package/hooks/novu-custom-hook.js.map +1 -1
  4. package/lib/config.d.ts +3 -3
  5. package/lib/config.js +3 -3
  6. package/lib/config.js.map +1 -1
  7. package/models/components/index.d.ts +0 -7
  8. package/models/components/index.d.ts.map +1 -1
  9. package/models/components/index.js +0 -7
  10. package/models/components/index.js.map +1 -1
  11. package/models/components/integrationresponsedto.d.ts +8 -8
  12. package/models/components/integrationresponsedto.d.ts.map +1 -1
  13. package/models/components/integrationresponsedto.js +14 -13
  14. package/models/components/integrationresponsedto.js.map +1 -1
  15. package/models/components/notificationfeeditemdto.d.ts +4 -4
  16. package/models/components/notificationfeeditemdto.d.ts.map +1 -1
  17. package/models/components/notificationfeeditemdto.js +2 -2
  18. package/models/components/notificationfeeditemdto.js.map +1 -1
  19. package/models/components/stepfilter.d.ts +8 -8
  20. package/models/components/stepfilter.d.ts.map +1 -1
  21. package/models/components/stepfilter.js +13 -13
  22. package/models/components/stepfilter.js.map +1 -1
  23. package/models/components/topicpayloaddto.d.ts +27 -2
  24. package/models/components/topicpayloaddto.d.ts.map +1 -1
  25. package/models/components/topicpayloaddto.js +22 -4
  26. package/models/components/topicpayloaddto.js.map +1 -1
  27. package/models/components/triggereventrequestdto.d.ts +28 -4
  28. package/models/components/triggereventrequestdto.d.ts.map +1 -1
  29. package/models/components/triggereventrequestdto.js +57 -5
  30. package/models/components/triggereventrequestdto.js.map +1 -1
  31. package/models/components/triggereventresponsedto.d.ts +8 -8
  32. package/models/components/triggereventresponsedto.d.ts.map +1 -1
  33. package/models/components/triggereventresponsedto.js +14 -13
  34. package/models/components/triggereventresponsedto.js.map +1 -1
  35. package/models/operations/index.d.ts +0 -9
  36. package/models/operations/index.d.ts.map +1 -1
  37. package/models/operations/index.js +0 -9
  38. package/models/operations/index.js.map +1 -1
  39. package/package.json +1 -1
  40. package/sdk/sdk.d.ts +0 -9
  41. package/sdk/sdk.d.ts.map +1 -1
  42. package/sdk/sdk.js +0 -15
  43. package/sdk/sdk.js.map +1 -1
  44. package/src/hooks/novu-custom-hook.ts +1 -1
  45. package/src/lib/config.ts +3 -3
  46. package/src/models/components/index.ts +0 -7
  47. package/src/models/components/integrationresponsedto.ts +14 -18
  48. package/src/models/components/notificationfeeditemdto.ts +4 -4
  49. package/src/models/components/stepfilter.ts +16 -15
  50. package/src/models/components/topicpayloaddto.ts +30 -8
  51. package/src/models/components/triggereventrequestdto.ts +109 -17
  52. package/src/models/components/triggereventresponsedto.ts +14 -18
  53. package/src/models/operations/index.ts +0 -9
  54. package/src/sdk/sdk.ts +0 -18
  55. package/docs/sdks/apikeys/README.md +0 -79
  56. package/docs/sdks/environments/README.md +0 -154
  57. package/docs/sdks/executiondetails/README.md +0 -84
  58. package/docs/sdks/workflowgroups/README.md +0 -382
  59. package/funcs/environmentsApiKeysList.d.ts +0 -12
  60. package/funcs/environmentsApiKeysList.d.ts.map +0 -1
  61. package/funcs/environmentsApiKeysList.js +0 -97
  62. package/funcs/environmentsApiKeysList.js.map +0 -1
  63. package/funcs/environmentsList.d.ts +0 -12
  64. package/funcs/environmentsList.d.ts.map +0 -1
  65. package/funcs/environmentsList.js +0 -97
  66. package/funcs/environmentsList.js.map +0 -1
  67. package/funcs/environmentsRetrieve.d.ts +0 -12
  68. package/funcs/environmentsRetrieve.d.ts.map +0 -1
  69. package/funcs/environmentsRetrieve.js +0 -97
  70. package/funcs/environmentsRetrieve.js.map +0 -1
  71. package/funcs/executionDetailsRetrieve.d.ts +0 -12
  72. package/funcs/executionDetailsRetrieve.d.ts.map +0 -1
  73. package/funcs/executionDetailsRetrieve.js +0 -117
  74. package/funcs/executionDetailsRetrieve.js.map +0 -1
  75. package/funcs/workflowGroupsCreate.d.ts +0 -16
  76. package/funcs/workflowGroupsCreate.d.ts.map +0 -1
  77. package/funcs/workflowGroupsCreate.js +0 -111
  78. package/funcs/workflowGroupsCreate.js.map +0 -1
  79. package/funcs/workflowGroupsDelete.d.ts +0 -15
  80. package/funcs/workflowGroupsDelete.d.ts.map +0 -1
  81. package/funcs/workflowGroupsDelete.js +0 -120
  82. package/funcs/workflowGroupsDelete.js.map +0 -1
  83. package/funcs/workflowGroupsList.d.ts +0 -15
  84. package/funcs/workflowGroupsList.d.ts.map +0 -1
  85. package/funcs/workflowGroupsList.js +0 -100
  86. package/funcs/workflowGroupsList.js.map +0 -1
  87. package/funcs/workflowGroupsRetrieve.d.ts +0 -15
  88. package/funcs/workflowGroupsRetrieve.d.ts.map +0 -1
  89. package/funcs/workflowGroupsRetrieve.js +0 -120
  90. package/funcs/workflowGroupsRetrieve.js.map +0 -1
  91. package/funcs/workflowGroupsUpdate.d.ts +0 -16
  92. package/funcs/workflowGroupsUpdate.d.ts.map +0 -1
  93. package/funcs/workflowGroupsUpdate.js +0 -124
  94. package/funcs/workflowGroupsUpdate.js.map +0 -1
  95. package/models/components/apikey.d.ts +0 -31
  96. package/models/components/apikey.d.ts.map +0 -1
  97. package/models/components/apikey.js +0 -71
  98. package/models/components/apikey.js.map +0 -1
  99. package/models/components/createnotificationgrouprequestdto.d.ts +0 -29
  100. package/models/components/createnotificationgrouprequestdto.d.ts.map +0 -1
  101. package/models/components/createnotificationgrouprequestdto.js +0 -59
  102. package/models/components/createnotificationgrouprequestdto.js.map +0 -1
  103. package/models/components/deletenotificationgroupresponsedto.d.ts +0 -66
  104. package/models/components/deletenotificationgroupresponsedto.d.ts.map +0 -1
  105. package/models/components/deletenotificationgroupresponsedto.js +0 -83
  106. package/models/components/deletenotificationgroupresponsedto.js.map +0 -1
  107. package/models/components/environmentresponsedto.d.ts +0 -41
  108. package/models/components/environmentresponsedto.d.ts.map +0 -1
  109. package/models/components/environmentresponsedto.js +0 -84
  110. package/models/components/environmentresponsedto.js.map +0 -1
  111. package/models/components/executiondetailsresponsedto.d.ts +0 -176
  112. package/models/components/executiondetailsresponsedto.d.ts.map +0 -1
  113. package/models/components/executiondetailsresponsedto.js +0 -187
  114. package/models/components/executiondetailsresponsedto.js.map +0 -1
  115. package/models/components/notificationgroupresponsedto.d.ts +0 -37
  116. package/models/components/notificationgroupresponsedto.d.ts.map +0 -1
  117. package/models/components/notificationgroupresponsedto.js +0 -82
  118. package/models/components/notificationgroupresponsedto.js.map +0 -1
  119. package/models/components/triggerrecipientstypeenum.d.ts +0 -28
  120. package/models/components/triggerrecipientstypeenum.d.ts.map +0 -1
  121. package/models/components/triggerrecipientstypeenum.js +0 -50
  122. package/models/components/triggerrecipientstypeenum.js.map +0 -1
  123. package/models/operations/environmentscontrollerv1getcurrentenvironment.d.ts +0 -36
  124. package/models/operations/environmentscontrollerv1getcurrentenvironment.d.ts.map +0 -1
  125. package/models/operations/environmentscontrollerv1getcurrentenvironment.js +0 -73
  126. package/models/operations/environmentscontrollerv1getcurrentenvironment.js.map +0 -1
  127. package/models/operations/environmentscontrollerv1listmyenvironments.d.ts +0 -36
  128. package/models/operations/environmentscontrollerv1listmyenvironments.d.ts.map +0 -1
  129. package/models/operations/environmentscontrollerv1listmyenvironments.js +0 -73
  130. package/models/operations/environmentscontrollerv1listmyenvironments.js.map +0 -1
  131. package/models/operations/environmentscontrollerv1listorganizationapikeys.d.ts +0 -36
  132. package/models/operations/environmentscontrollerv1listorganizationapikeys.d.ts.map +0 -1
  133. package/models/operations/environmentscontrollerv1listorganizationapikeys.js +0 -75
  134. package/models/operations/environmentscontrollerv1listorganizationapikeys.js.map +0 -1
  135. package/models/operations/executiondetailscontrollergetexecutiondetailsfornotification.d.ts +0 -63
  136. package/models/operations/executiondetailscontrollergetexecutiondetailsfornotification.d.ts.map +0 -1
  137. package/models/operations/executiondetailscontrollergetexecutiondetailsfornotification.js +0 -106
  138. package/models/operations/executiondetailscontrollergetexecutiondetailsfornotification.js.map +0 -1
  139. package/models/operations/notificationgroupscontrollercreatenotificationgroup.d.ts +0 -36
  140. package/models/operations/notificationgroupscontrollercreatenotificationgroup.d.ts.map +0 -1
  141. package/models/operations/notificationgroupscontrollercreatenotificationgroup.js +0 -75
  142. package/models/operations/notificationgroupscontrollercreatenotificationgroup.js.map +0 -1
  143. package/models/operations/notificationgroupscontrollerdeletenotificationgroup.d.ts +0 -61
  144. package/models/operations/notificationgroupscontrollerdeletenotificationgroup.d.ts.map +0 -1
  145. package/models/operations/notificationgroupscontrollerdeletenotificationgroup.js +0 -104
  146. package/models/operations/notificationgroupscontrollerdeletenotificationgroup.js.map +0 -1
  147. package/models/operations/notificationgroupscontrollergetnotificationgroup.d.ts +0 -61
  148. package/models/operations/notificationgroupscontrollergetnotificationgroup.d.ts.map +0 -1
  149. package/models/operations/notificationgroupscontrollergetnotificationgroup.js +0 -104
  150. package/models/operations/notificationgroupscontrollergetnotificationgroup.js.map +0 -1
  151. package/models/operations/notificationgroupscontrollerlistnotificationgroups.d.ts +0 -36
  152. package/models/operations/notificationgroupscontrollerlistnotificationgroups.d.ts.map +0 -1
  153. package/models/operations/notificationgroupscontrollerlistnotificationgroups.js +0 -75
  154. package/models/operations/notificationgroupscontrollerlistnotificationgroups.js.map +0 -1
  155. package/models/operations/notificationgroupscontrollerupdatenotificationgroup.d.ts +0 -63
  156. package/models/operations/notificationgroupscontrollerupdatenotificationgroup.d.ts.map +0 -1
  157. package/models/operations/notificationgroupscontrollerupdatenotificationgroup.js +0 -114
  158. package/models/operations/notificationgroupscontrollerupdatenotificationgroup.js.map +0 -1
  159. package/sdk/apikeys.d.ts +0 -9
  160. package/sdk/apikeys.d.ts.map +0 -1
  161. package/sdk/apikeys.js +0 -19
  162. package/sdk/apikeys.js.map +0 -1
  163. package/sdk/environments.d.ts +0 -16
  164. package/sdk/environments.d.ts.map +0 -1
  165. package/sdk/environments.js +0 -31
  166. package/sdk/environments.js.map +0 -1
  167. package/sdk/executiondetails.d.ts +0 -9
  168. package/sdk/executiondetails.d.ts.map +0 -1
  169. package/sdk/executiondetails.js +0 -19
  170. package/sdk/executiondetails.js.map +0 -1
  171. package/sdk/workflowgroups.d.ts +0 -41
  172. package/sdk/workflowgroups.d.ts.map +0 -1
  173. package/sdk/workflowgroups.js +0 -62
  174. package/sdk/workflowgroups.js.map +0 -1
  175. package/src/funcs/environmentsApiKeysList.ts +0 -124
  176. package/src/funcs/environmentsList.ts +0 -124
  177. package/src/funcs/environmentsRetrieve.ts +0 -124
  178. package/src/funcs/executionDetailsRetrieve.ts +0 -157
  179. package/src/funcs/workflowGroupsCreate.ts +0 -145
  180. package/src/funcs/workflowGroupsDelete.ts +0 -157
  181. package/src/funcs/workflowGroupsList.ts +0 -127
  182. package/src/funcs/workflowGroupsRetrieve.ts +0 -157
  183. package/src/funcs/workflowGroupsUpdate.ts +0 -164
  184. package/src/models/components/apikey.ts +0 -72
  185. package/src/models/components/createnotificationgrouprequestdto.ts +0 -69
  186. package/src/models/components/deletenotificationgroupresponsedto.ts +0 -117
  187. package/src/models/components/environmentresponsedto.ts +0 -103
  188. package/src/models/components/executiondetailsresponsedto.ts +0 -244
  189. package/src/models/components/notificationgroupresponsedto.ts +0 -99
  190. package/src/models/components/triggerrecipientstypeenum.ts +0 -35
  191. package/src/models/operations/environmentscontrollerv1getcurrentenvironment.ts +0 -96
  192. package/src/models/operations/environmentscontrollerv1listmyenvironments.ts +0 -96
  193. package/src/models/operations/environmentscontrollerv1listorganizationapikeys.ts +0 -94
  194. package/src/models/operations/executiondetailscontrollergetexecutiondetailsfornotification.ts +0 -176
  195. package/src/models/operations/notificationgroupscontrollercreatenotificationgroup.ts +0 -95
  196. package/src/models/operations/notificationgroupscontrollerdeletenotificationgroup.ts +0 -166
  197. package/src/models/operations/notificationgroupscontrollergetnotificationgroup.ts +0 -165
  198. package/src/models/operations/notificationgroupscontrollerlistnotificationgroups.ts +0 -95
  199. package/src/models/operations/notificationgroupscontrollerupdatenotificationgroup.ts +0 -182
  200. package/src/sdk/apikeys.ts +0 -24
  201. package/src/sdk/environments.ts +0 -41
  202. package/src/sdk/executiondetails.ts +0 -28
  203. package/src/sdk/workflowgroups.ts +0 -111
@@ -1,157 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { NovuCore } from "../core.js";
6
- import { encodeFormQuery } from "../lib/encodings.js";
7
- import * as M from "../lib/matchers.js";
8
- import { safeParse } from "../lib/schemas.js";
9
- import { RequestOptions } from "../lib/sdks.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import {
13
- ConnectionError,
14
- InvalidRequestError,
15
- RequestAbortedError,
16
- RequestTimeoutError,
17
- UnexpectedClientError,
18
- } from "../models/errors/httpclienterrors.js";
19
- import { SDKError } from "../models/errors/sdkerror.js";
20
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
- import * as operations from "../models/operations/index.js";
22
- import { Result } from "../types/fp.js";
23
-
24
- /**
25
- * Get execution details
26
- */
27
- export async function executionDetailsRetrieve(
28
- client: NovuCore,
29
- notificationId: string,
30
- subscriberId: string,
31
- options?: RequestOptions,
32
- ): Promise<
33
- Result<
34
- operations.ExecutionDetailsControllerGetExecutionDetailsForNotificationResponse,
35
- | SDKError
36
- | SDKValidationError
37
- | UnexpectedClientError
38
- | InvalidRequestError
39
- | RequestAbortedError
40
- | RequestTimeoutError
41
- | ConnectionError
42
- >
43
- > {
44
- const input:
45
- operations.ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest =
46
- {
47
- notificationId: notificationId,
48
- subscriberId: subscriberId,
49
- };
50
-
51
- const parsed = safeParse(
52
- input,
53
- (value) =>
54
- operations
55
- .ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$outboundSchema
56
- .parse(value),
57
- "Input validation failed",
58
- );
59
- if (!parsed.ok) {
60
- return parsed;
61
- }
62
- const payload = parsed.value;
63
- const body = null;
64
-
65
- const path = pathToFunc("/v1/execution-details")();
66
-
67
- const query = encodeFormQuery({
68
- "notificationId": payload.notificationId,
69
- "subscriberId": payload.subscriberId,
70
- });
71
-
72
- const headers = new Headers({
73
- Accept: "application/json",
74
- });
75
-
76
- const secConfig = await extractSecurity(client._options.apiKey);
77
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
78
- const requestSecurity = resolveGlobalSecurity(securityInput);
79
-
80
- const context = {
81
- operationID:
82
- "ExecutionDetailsController_getExecutionDetailsForNotification",
83
- oAuth2Scopes: [],
84
-
85
- resolvedSecurity: requestSecurity,
86
-
87
- securitySource: client._options.apiKey,
88
- retryConfig: options?.retries
89
- || client._options.retryConfig
90
- || {
91
- strategy: "backoff",
92
- backoff: {
93
- initialInterval: 500,
94
- maxInterval: 30000,
95
- exponent: 1.5,
96
- maxElapsedTime: 3600000,
97
- },
98
- retryConnectionErrors: true,
99
- }
100
- || { strategy: "none" },
101
- retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
102
- };
103
-
104
- const requestRes = client._createRequest(context, {
105
- security: requestSecurity,
106
- method: "GET",
107
- path: path,
108
- headers: headers,
109
- query: query,
110
- body: body,
111
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
112
- }, options);
113
- if (!requestRes.ok) {
114
- return requestRes;
115
- }
116
- const req = requestRes.value;
117
-
118
- const doResult = await client._do(req, {
119
- context,
120
- errorCodes: ["409", "429", "4XX", "503", "5XX"],
121
- retryConfig: context.retryConfig,
122
- retryCodes: context.retryCodes,
123
- });
124
- if (!doResult.ok) {
125
- return doResult;
126
- }
127
- const response = doResult.value;
128
-
129
- const responseFields = {
130
- HttpMeta: { Response: response, Request: req },
131
- };
132
-
133
- const [result] = await M.match<
134
- operations.ExecutionDetailsControllerGetExecutionDetailsForNotificationResponse,
135
- | SDKError
136
- | SDKValidationError
137
- | UnexpectedClientError
138
- | InvalidRequestError
139
- | RequestAbortedError
140
- | RequestTimeoutError
141
- | ConnectionError
142
- >(
143
- M.json(
144
- 200,
145
- operations
146
- .ExecutionDetailsControllerGetExecutionDetailsForNotificationResponse$inboundSchema,
147
- { hdrs: true, key: "Result" },
148
- ),
149
- M.fail([409, 429, 503]),
150
- M.fail(["4XX", "5XX"]),
151
- )(response, { extraFields: responseFields });
152
- if (!result.ok) {
153
- return result;
154
- }
155
-
156
- return result;
157
- }
@@ -1,145 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { NovuCore } from "../core.js";
6
- import { encodeJSON } from "../lib/encodings.js";
7
- import * as M from "../lib/matchers.js";
8
- import { safeParse } from "../lib/schemas.js";
9
- import { RequestOptions } from "../lib/sdks.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import * as components from "../models/components/index.js";
13
- import {
14
- ConnectionError,
15
- InvalidRequestError,
16
- RequestAbortedError,
17
- RequestTimeoutError,
18
- UnexpectedClientError,
19
- } from "../models/errors/httpclienterrors.js";
20
- import { SDKError } from "../models/errors/sdkerror.js";
21
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
- import * as operations from "../models/operations/index.js";
23
- import { Result } from "../types/fp.js";
24
-
25
- /**
26
- * Create workflow group
27
- *
28
- * @remarks
29
- * workflow group was previously named notification group
30
- */
31
- export async function workflowGroupsCreate(
32
- client: NovuCore,
33
- request: components.CreateNotificationGroupRequestDto,
34
- options?: RequestOptions,
35
- ): Promise<
36
- Result<
37
- operations.NotificationGroupsControllerCreateNotificationGroupResponse,
38
- | SDKError
39
- | SDKValidationError
40
- | UnexpectedClientError
41
- | InvalidRequestError
42
- | RequestAbortedError
43
- | RequestTimeoutError
44
- | ConnectionError
45
- >
46
- > {
47
- const parsed = safeParse(
48
- request,
49
- (value) =>
50
- components.CreateNotificationGroupRequestDto$outboundSchema.parse(value),
51
- "Input validation failed",
52
- );
53
- if (!parsed.ok) {
54
- return parsed;
55
- }
56
- const payload = parsed.value;
57
- const body = encodeJSON("body", payload, { explode: true });
58
-
59
- const path = pathToFunc("/v1/notification-groups")();
60
-
61
- const headers = new Headers({
62
- "Content-Type": "application/json",
63
- Accept: "application/json",
64
- });
65
-
66
- const secConfig = await extractSecurity(client._options.apiKey);
67
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
68
- const requestSecurity = resolveGlobalSecurity(securityInput);
69
-
70
- const context = {
71
- operationID: "NotificationGroupsController_createNotificationGroup",
72
- oAuth2Scopes: [],
73
-
74
- resolvedSecurity: requestSecurity,
75
-
76
- securitySource: client._options.apiKey,
77
- retryConfig: options?.retries
78
- || client._options.retryConfig
79
- || {
80
- strategy: "backoff",
81
- backoff: {
82
- initialInterval: 500,
83
- maxInterval: 30000,
84
- exponent: 1.5,
85
- maxElapsedTime: 3600000,
86
- },
87
- retryConnectionErrors: true,
88
- }
89
- || { strategy: "none" },
90
- retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
91
- };
92
-
93
- const requestRes = client._createRequest(context, {
94
- security: requestSecurity,
95
- method: "POST",
96
- path: path,
97
- headers: headers,
98
- body: body,
99
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
100
- }, options);
101
- if (!requestRes.ok) {
102
- return requestRes;
103
- }
104
- const req = requestRes.value;
105
-
106
- const doResult = await client._do(req, {
107
- context,
108
- errorCodes: ["409", "429", "4XX", "503", "5XX"],
109
- retryConfig: context.retryConfig,
110
- retryCodes: context.retryCodes,
111
- });
112
- if (!doResult.ok) {
113
- return doResult;
114
- }
115
- const response = doResult.value;
116
-
117
- const responseFields = {
118
- HttpMeta: { Response: response, Request: req },
119
- };
120
-
121
- const [result] = await M.match<
122
- operations.NotificationGroupsControllerCreateNotificationGroupResponse,
123
- | SDKError
124
- | SDKValidationError
125
- | UnexpectedClientError
126
- | InvalidRequestError
127
- | RequestAbortedError
128
- | RequestTimeoutError
129
- | ConnectionError
130
- >(
131
- M.json(
132
- 201,
133
- operations
134
- .NotificationGroupsControllerCreateNotificationGroupResponse$inboundSchema,
135
- { hdrs: true, key: "Result" },
136
- ),
137
- M.fail([409, 429, 503]),
138
- M.fail(["4XX", "5XX"]),
139
- )(response, { extraFields: responseFields });
140
- if (!result.ok) {
141
- return result;
142
- }
143
-
144
- return result;
145
- }
@@ -1,157 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { NovuCore } from "../core.js";
6
- import { encodeSimple } from "../lib/encodings.js";
7
- import * as M from "../lib/matchers.js";
8
- import { safeParse } from "../lib/schemas.js";
9
- import { RequestOptions } from "../lib/sdks.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import {
13
- ConnectionError,
14
- InvalidRequestError,
15
- RequestAbortedError,
16
- RequestTimeoutError,
17
- UnexpectedClientError,
18
- } from "../models/errors/httpclienterrors.js";
19
- import { SDKError } from "../models/errors/sdkerror.js";
20
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
- import * as operations from "../models/operations/index.js";
22
- import { Result } from "../types/fp.js";
23
-
24
- /**
25
- * Delete workflow group
26
- *
27
- * @remarks
28
- * workflow group was previously named notification group
29
- */
30
- export async function workflowGroupsDelete(
31
- client: NovuCore,
32
- id: string,
33
- options?: RequestOptions,
34
- ): Promise<
35
- Result<
36
- operations.NotificationGroupsControllerDeleteNotificationGroupResponse,
37
- | SDKError
38
- | SDKValidationError
39
- | UnexpectedClientError
40
- | InvalidRequestError
41
- | RequestAbortedError
42
- | RequestTimeoutError
43
- | ConnectionError
44
- >
45
- > {
46
- const input:
47
- operations.NotificationGroupsControllerDeleteNotificationGroupRequest = {
48
- id: id,
49
- };
50
-
51
- const parsed = safeParse(
52
- input,
53
- (value) =>
54
- operations
55
- .NotificationGroupsControllerDeleteNotificationGroupRequest$outboundSchema
56
- .parse(value),
57
- "Input validation failed",
58
- );
59
- if (!parsed.ok) {
60
- return parsed;
61
- }
62
- const payload = parsed.value;
63
- const body = null;
64
-
65
- const pathParams = {
66
- id: encodeSimple("id", payload.id, {
67
- explode: false,
68
- charEncoding: "percent",
69
- }),
70
- };
71
-
72
- const path = pathToFunc("/v1/notification-groups/{id}")(pathParams);
73
-
74
- const headers = new Headers({
75
- Accept: "application/json",
76
- });
77
-
78
- const secConfig = await extractSecurity(client._options.apiKey);
79
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
80
- const requestSecurity = resolveGlobalSecurity(securityInput);
81
-
82
- const context = {
83
- operationID: "NotificationGroupsController_deleteNotificationGroup",
84
- oAuth2Scopes: [],
85
-
86
- resolvedSecurity: requestSecurity,
87
-
88
- securitySource: client._options.apiKey,
89
- retryConfig: options?.retries
90
- || client._options.retryConfig
91
- || {
92
- strategy: "backoff",
93
- backoff: {
94
- initialInterval: 500,
95
- maxInterval: 30000,
96
- exponent: 1.5,
97
- maxElapsedTime: 3600000,
98
- },
99
- retryConnectionErrors: true,
100
- }
101
- || { strategy: "none" },
102
- retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
103
- };
104
-
105
- const requestRes = client._createRequest(context, {
106
- security: requestSecurity,
107
- method: "DELETE",
108
- path: path,
109
- headers: headers,
110
- body: body,
111
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
112
- }, options);
113
- if (!requestRes.ok) {
114
- return requestRes;
115
- }
116
- const req = requestRes.value;
117
-
118
- const doResult = await client._do(req, {
119
- context,
120
- errorCodes: ["409", "429", "4XX", "503", "5XX"],
121
- retryConfig: context.retryConfig,
122
- retryCodes: context.retryCodes,
123
- });
124
- if (!doResult.ok) {
125
- return doResult;
126
- }
127
- const response = doResult.value;
128
-
129
- const responseFields = {
130
- HttpMeta: { Response: response, Request: req },
131
- };
132
-
133
- const [result] = await M.match<
134
- operations.NotificationGroupsControllerDeleteNotificationGroupResponse,
135
- | SDKError
136
- | SDKValidationError
137
- | UnexpectedClientError
138
- | InvalidRequestError
139
- | RequestAbortedError
140
- | RequestTimeoutError
141
- | ConnectionError
142
- >(
143
- M.json(
144
- 200,
145
- operations
146
- .NotificationGroupsControllerDeleteNotificationGroupResponse$inboundSchema,
147
- { hdrs: true, key: "Result" },
148
- ),
149
- M.fail([409, 429, 503]),
150
- M.fail(["4XX", "5XX"]),
151
- )(response, { extraFields: responseFields });
152
- if (!result.ok) {
153
- return result;
154
- }
155
-
156
- return result;
157
- }
@@ -1,127 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { NovuCore } from "../core.js";
6
- import * as M from "../lib/matchers.js";
7
- import { RequestOptions } from "../lib/sdks.js";
8
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
9
- import { pathToFunc } from "../lib/url.js";
10
- import {
11
- ConnectionError,
12
- InvalidRequestError,
13
- RequestAbortedError,
14
- RequestTimeoutError,
15
- UnexpectedClientError,
16
- } from "../models/errors/httpclienterrors.js";
17
- import { SDKError } from "../models/errors/sdkerror.js";
18
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
19
- import * as operations from "../models/operations/index.js";
20
- import { Result } from "../types/fp.js";
21
-
22
- /**
23
- * Get workflow groups
24
- *
25
- * @remarks
26
- * workflow group was previously named notification group
27
- */
28
- export async function workflowGroupsList(
29
- client: NovuCore,
30
- options?: RequestOptions,
31
- ): Promise<
32
- Result<
33
- operations.NotificationGroupsControllerListNotificationGroupsResponse,
34
- | SDKError
35
- | SDKValidationError
36
- | UnexpectedClientError
37
- | InvalidRequestError
38
- | RequestAbortedError
39
- | RequestTimeoutError
40
- | ConnectionError
41
- >
42
- > {
43
- const path = pathToFunc("/v1/notification-groups")();
44
-
45
- const headers = new Headers({
46
- Accept: "application/json",
47
- });
48
-
49
- const secConfig = await extractSecurity(client._options.apiKey);
50
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
51
- const requestSecurity = resolveGlobalSecurity(securityInput);
52
-
53
- const context = {
54
- operationID: "NotificationGroupsController_listNotificationGroups",
55
- oAuth2Scopes: [],
56
-
57
- resolvedSecurity: requestSecurity,
58
-
59
- securitySource: client._options.apiKey,
60
- retryConfig: options?.retries
61
- || client._options.retryConfig
62
- || {
63
- strategy: "backoff",
64
- backoff: {
65
- initialInterval: 500,
66
- maxInterval: 30000,
67
- exponent: 1.5,
68
- maxElapsedTime: 3600000,
69
- },
70
- retryConnectionErrors: true,
71
- }
72
- || { strategy: "none" },
73
- retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
74
- };
75
-
76
- const requestRes = client._createRequest(context, {
77
- security: requestSecurity,
78
- method: "GET",
79
- path: path,
80
- headers: headers,
81
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
82
- }, options);
83
- if (!requestRes.ok) {
84
- return requestRes;
85
- }
86
- const req = requestRes.value;
87
-
88
- const doResult = await client._do(req, {
89
- context,
90
- errorCodes: ["409", "429", "4XX", "503", "5XX"],
91
- retryConfig: context.retryConfig,
92
- retryCodes: context.retryCodes,
93
- });
94
- if (!doResult.ok) {
95
- return doResult;
96
- }
97
- const response = doResult.value;
98
-
99
- const responseFields = {
100
- HttpMeta: { Response: response, Request: req },
101
- };
102
-
103
- const [result] = await M.match<
104
- operations.NotificationGroupsControllerListNotificationGroupsResponse,
105
- | SDKError
106
- | SDKValidationError
107
- | UnexpectedClientError
108
- | InvalidRequestError
109
- | RequestAbortedError
110
- | RequestTimeoutError
111
- | ConnectionError
112
- >(
113
- M.json(
114
- 200,
115
- operations
116
- .NotificationGroupsControllerListNotificationGroupsResponse$inboundSchema,
117
- { hdrs: true, key: "Result" },
118
- ),
119
- M.fail([409, 429, 503]),
120
- M.fail(["4XX", "5XX"]),
121
- )(response, { extraFields: responseFields });
122
- if (!result.ok) {
123
- return result;
124
- }
125
-
126
- return result;
127
- }