@novu/api 3.12.0-rc.0 → 3.12.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 (123) hide show
  1. package/README.md +25 -23
  2. package/_speakeasy/.github/action-inputs-config.json +53 -0
  3. package/_speakeasy/.github/action-security-config.json +88 -0
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/channelConnectionsCreate.d.ts +1 -1
  6. package/funcs/channelConnectionsCreate.js +1 -1
  7. package/funcs/channelConnectionsDelete.d.ts +1 -1
  8. package/funcs/channelConnectionsDelete.js +1 -1
  9. package/funcs/channelConnectionsList.d.ts +2 -2
  10. package/funcs/channelConnectionsList.js +2 -2
  11. package/funcs/channelConnectionsRetrieve.d.ts +1 -1
  12. package/funcs/channelConnectionsRetrieve.js +1 -1
  13. package/funcs/channelConnectionsUpdate.d.ts +1 -1
  14. package/funcs/channelConnectionsUpdate.js +1 -1
  15. package/funcs/channelEndpointsCreate.d.ts +1 -1
  16. package/funcs/channelEndpointsCreate.js +1 -1
  17. package/funcs/channelEndpointsDelete.d.ts +1 -1
  18. package/funcs/channelEndpointsDelete.js +1 -1
  19. package/funcs/channelEndpointsList.d.ts +2 -2
  20. package/funcs/channelEndpointsList.js +2 -2
  21. package/funcs/channelEndpointsRetrieve.d.ts +1 -1
  22. package/funcs/channelEndpointsRetrieve.js +1 -1
  23. package/funcs/channelEndpointsUpdate.d.ts +1 -1
  24. package/funcs/channelEndpointsUpdate.js +1 -1
  25. package/funcs/notificationsList.js +1 -0
  26. package/funcs/notificationsList.js.map +1 -1
  27. package/funcs/topicsSubscriptionsGetSubscription.d.ts +18 -0
  28. package/funcs/topicsSubscriptionsGetSubscription.d.ts.map +1 -0
  29. package/funcs/topicsSubscriptionsGetSubscription.js +160 -0
  30. package/funcs/topicsSubscriptionsGetSubscription.js.map +1 -0
  31. package/funcs/topicsSubscriptionsUpdate.d.ts +1 -1
  32. package/funcs/topicsSubscriptionsUpdate.js +6 -3
  33. package/funcs/topicsSubscriptionsUpdate.js.map +1 -1
  34. package/funcs/trigger.d.ts +1 -1
  35. package/funcs/trigger.js +1 -1
  36. package/jsr.json +1 -1
  37. package/lib/config.d.ts +3 -3
  38. package/lib/config.js +3 -3
  39. package/lib/config.js.map +1 -1
  40. package/models/components/delaystepresponsedto.d.ts +1 -1
  41. package/models/components/delaystepresponsedto.d.ts.map +1 -1
  42. package/models/components/emailstepresponsedto.d.ts +3 -3
  43. package/models/components/emailstepresponsedto.d.ts.map +1 -1
  44. package/models/components/generatechatoauthurlrequestdto.d.ts +1 -1
  45. package/models/components/inappcontroldto.d.ts +1 -1
  46. package/models/components/inappstepresponsedto.d.ts +2 -2
  47. package/models/components/inappstepresponsedto.d.ts.map +1 -1
  48. package/models/components/notificationfeeditemdto.d.ts +4 -0
  49. package/models/components/notificationfeeditemdto.d.ts.map +1 -1
  50. package/models/components/notificationfeeditemdto.js +1 -0
  51. package/models/components/notificationfeeditemdto.js.map +1 -1
  52. package/models/components/redirectdto.d.ts +1 -1
  53. package/models/components/throttlestepresponsedto.d.ts +2 -2
  54. package/models/components/throttlestepresponsedto.d.ts.map +1 -1
  55. package/models/components/topicsubscriptionresponsedto.d.ts +4 -0
  56. package/models/components/topicsubscriptionresponsedto.d.ts.map +1 -1
  57. package/models/components/topicsubscriptionresponsedto.js +1 -0
  58. package/models/components/topicsubscriptionresponsedto.js.map +1 -1
  59. package/models/components/triggereventrequestdto.d.ts +2 -2
  60. package/models/components/workflowresponsedto.d.ts +2 -2
  61. package/models/components/workflowresponsedto.d.ts.map +1 -1
  62. package/models/operations/index.d.ts +1 -0
  63. package/models/operations/index.d.ts.map +1 -1
  64. package/models/operations/index.js +1 -0
  65. package/models/operations/index.js.map +1 -1
  66. package/models/operations/notificationscontrollerlistnotifications.d.ts +5 -0
  67. package/models/operations/notificationscontrollerlistnotifications.d.ts.map +1 -1
  68. package/models/operations/notificationscontrollerlistnotifications.js +1 -0
  69. package/models/operations/notificationscontrollerlistnotifications.js.map +1 -1
  70. package/models/operations/topicscontrollergettopicsubscription.d.ts +37 -0
  71. package/models/operations/topicscontrollergettopicsubscription.d.ts.map +1 -0
  72. package/models/operations/topicscontrollergettopicsubscription.js +72 -0
  73. package/models/operations/topicscontrollergettopicsubscription.js.map +1 -0
  74. package/models/operations/topicscontrollerupdatetopicsubscription.d.ts +2 -2
  75. package/models/operations/topicscontrollerupdatetopicsubscription.d.ts.map +1 -1
  76. package/models/operations/topicscontrollerupdatetopicsubscription.js +1 -1
  77. package/models/operations/topicscontrollerupdatetopicsubscription.js.map +1 -1
  78. package/package.json +1 -1
  79. package/sdk/channelconnections.d.ts +6 -6
  80. package/sdk/channelconnections.js +6 -6
  81. package/sdk/channelendpoints.d.ts +6 -6
  82. package/sdk/channelendpoints.js +6 -6
  83. package/sdk/sdk.d.ts +1 -1
  84. package/sdk/sdk.js +1 -1
  85. package/sdk/subscriptions.d.ts +8 -1
  86. package/sdk/subscriptions.d.ts.map +1 -1
  87. package/sdk/subscriptions.js +11 -1
  88. package/sdk/subscriptions.js.map +1 -1
  89. package/sources/json-development.json +848 -309
  90. package/src/funcs/channelConnectionsCreate.ts +1 -1
  91. package/src/funcs/channelConnectionsDelete.ts +1 -1
  92. package/src/funcs/channelConnectionsList.ts +2 -2
  93. package/src/funcs/channelConnectionsRetrieve.ts +1 -1
  94. package/src/funcs/channelConnectionsUpdate.ts +1 -1
  95. package/src/funcs/channelEndpointsCreate.ts +1 -1
  96. package/src/funcs/channelEndpointsDelete.ts +1 -1
  97. package/src/funcs/channelEndpointsList.ts +2 -2
  98. package/src/funcs/channelEndpointsRetrieve.ts +1 -1
  99. package/src/funcs/channelEndpointsUpdate.ts +1 -1
  100. package/src/funcs/notificationsList.ts +1 -0
  101. package/src/funcs/topicsSubscriptionsGetSubscription.ts +242 -0
  102. package/src/funcs/topicsSubscriptionsUpdate.ts +8 -9
  103. package/src/funcs/trigger.ts +1 -1
  104. package/src/lib/config.ts +3 -3
  105. package/src/models/components/delaystepresponsedto.ts +1 -1
  106. package/src/models/components/emailstepresponsedto.ts +3 -3
  107. package/src/models/components/generatechatoauthurlrequestdto.ts +1 -1
  108. package/src/models/components/inappcontroldto.ts +1 -1
  109. package/src/models/components/inappstepresponsedto.ts +2 -2
  110. package/src/models/components/notificationfeeditemdto.ts +5 -0
  111. package/src/models/components/redirectdto.ts +1 -1
  112. package/src/models/components/throttlestepresponsedto.ts +2 -2
  113. package/src/models/components/topicsubscriptionresponsedto.ts +5 -0
  114. package/src/models/components/triggereventrequestdto.ts +2 -2
  115. package/src/models/components/workflowresponsedto.ts +2 -2
  116. package/src/models/operations/index.ts +1 -0
  117. package/src/models/operations/notificationscontrollerlistnotifications.ts +6 -0
  118. package/src/models/operations/topicscontrollergettopicsubscription.ts +96 -0
  119. package/src/models/operations/topicscontrollerupdatetopicsubscription.ts +3 -3
  120. package/src/sdk/channelconnections.ts +6 -6
  121. package/src/sdk/channelendpoints.ts +6 -6
  122. package/src/sdk/sdk.ts +1 -1
  123. package/src/sdk/subscriptions.ts +23 -1
@@ -0,0 +1,96 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type TopicsControllerGetTopicSubscriptionRequest = {
13
+ /**
14
+ * The key identifier of the topic
15
+ */
16
+ topicKey: string;
17
+ /**
18
+ * The unique identifier of the subscription
19
+ */
20
+ identifier: string;
21
+ /**
22
+ * A header for idempotency purposes
23
+ */
24
+ idempotencyKey?: string | undefined;
25
+ };
26
+
27
+ export type TopicsControllerGetTopicSubscriptionResponse = {
28
+ headers: { [k: string]: Array<string> };
29
+ result: components.SubscriptionResponseDto;
30
+ };
31
+
32
+ /** @internal */
33
+ export type TopicsControllerGetTopicSubscriptionRequest$Outbound = {
34
+ topicKey: string;
35
+ identifier: string;
36
+ "idempotency-key"?: string | undefined;
37
+ };
38
+
39
+ /** @internal */
40
+ export const TopicsControllerGetTopicSubscriptionRequest$outboundSchema:
41
+ z.ZodType<
42
+ TopicsControllerGetTopicSubscriptionRequest$Outbound,
43
+ z.ZodTypeDef,
44
+ TopicsControllerGetTopicSubscriptionRequest
45
+ > = z.object({
46
+ topicKey: z.string(),
47
+ identifier: z.string(),
48
+ idempotencyKey: z.string().optional(),
49
+ }).transform((v) => {
50
+ return remap$(v, {
51
+ idempotencyKey: "idempotency-key",
52
+ });
53
+ });
54
+
55
+ export function topicsControllerGetTopicSubscriptionRequestToJSON(
56
+ topicsControllerGetTopicSubscriptionRequest:
57
+ TopicsControllerGetTopicSubscriptionRequest,
58
+ ): string {
59
+ return JSON.stringify(
60
+ TopicsControllerGetTopicSubscriptionRequest$outboundSchema.parse(
61
+ topicsControllerGetTopicSubscriptionRequest,
62
+ ),
63
+ );
64
+ }
65
+
66
+ /** @internal */
67
+ export const TopicsControllerGetTopicSubscriptionResponse$inboundSchema:
68
+ z.ZodType<
69
+ TopicsControllerGetTopicSubscriptionResponse,
70
+ z.ZodTypeDef,
71
+ unknown
72
+ > = z.object({
73
+ Headers: z.record(z.array(z.string())).default({}),
74
+ Result: components.SubscriptionResponseDto$inboundSchema,
75
+ }).transform((v) => {
76
+ return remap$(v, {
77
+ "Headers": "headers",
78
+ "Result": "result",
79
+ });
80
+ });
81
+
82
+ export function topicsControllerGetTopicSubscriptionResponseFromJSON(
83
+ jsonString: string,
84
+ ): SafeParseResult<
85
+ TopicsControllerGetTopicSubscriptionResponse,
86
+ SDKValidationError
87
+ > {
88
+ return safeParse(
89
+ jsonString,
90
+ (x) =>
91
+ TopicsControllerGetTopicSubscriptionResponse$inboundSchema.parse(
92
+ JSON.parse(x),
93
+ ),
94
+ `Failed to parse 'TopicsControllerGetTopicSubscriptionResponse' from JSON`,
95
+ );
96
+ }
@@ -17,7 +17,7 @@ export type TopicsControllerUpdateTopicSubscriptionRequest = {
17
17
  /**
18
18
  * The unique identifier of the subscription
19
19
  */
20
- subscriptionIdOrIdentifier: string;
20
+ identifier: string;
21
21
  /**
22
22
  * A header for idempotency purposes
23
23
  */
@@ -34,7 +34,7 @@ export type TopicsControllerUpdateTopicSubscriptionResponse = {
34
34
  /** @internal */
35
35
  export type TopicsControllerUpdateTopicSubscriptionRequest$Outbound = {
36
36
  topicKey: string;
37
- subscriptionIdOrIdentifier: string;
37
+ identifier: string;
38
38
  "idempotency-key"?: string | undefined;
39
39
  UpdateTopicSubscriptionRequestDto:
40
40
  components.UpdateTopicSubscriptionRequestDto$Outbound;
@@ -48,7 +48,7 @@ export const TopicsControllerUpdateTopicSubscriptionRequest$outboundSchema:
48
48
  TopicsControllerUpdateTopicSubscriptionRequest
49
49
  > = z.object({
50
50
  topicKey: z.string(),
51
- subscriptionIdOrIdentifier: z.string(),
51
+ identifier: z.string(),
52
52
  idempotencyKey: z.string().optional(),
53
53
  updateTopicSubscriptionRequestDto:
54
54
  components.UpdateTopicSubscriptionRequestDto$outboundSchema,
@@ -14,10 +14,10 @@ import { unwrapAsync } from "../types/fp.js";
14
14
 
15
15
  export class ChannelConnections extends ClientSDK {
16
16
  /**
17
- * List channel connections
17
+ * List all channel connections
18
18
  *
19
19
  * @remarks
20
- * Retrieve all channel connections for a resource.
20
+ * List all channel connections for a resource.
21
21
  */
22
22
  async list(
23
23
  request:
@@ -34,7 +34,7 @@ export class ChannelConnections extends ClientSDK {
34
34
  }
35
35
 
36
36
  /**
37
- * Create channel connection for a resource and integration
37
+ * Create a channel connection
38
38
  *
39
39
  * @remarks
40
40
  * Create a new channel connection for a resource for given integration. Only one channel connection is allowed per resource and integration.
@@ -56,7 +56,7 @@ export class ChannelConnections extends ClientSDK {
56
56
  }
57
57
 
58
58
  /**
59
- * Retrieve channel connection by identifier
59
+ * Retrieve a channel connection
60
60
  *
61
61
  * @remarks
62
62
  * Retrieve a specific channel connection by its unique identifier.
@@ -77,7 +77,7 @@ export class ChannelConnections extends ClientSDK {
77
77
  }
78
78
 
79
79
  /**
80
- * Update channel connection
80
+ * Update a channel connection
81
81
  *
82
82
  * @remarks
83
83
  * Update an existing channel connection by its unique identifier.
@@ -101,7 +101,7 @@ export class ChannelConnections extends ClientSDK {
101
101
  }
102
102
 
103
103
  /**
104
- * Delete channel connection
104
+ * Delete a channel connection
105
105
  *
106
106
  * @remarks
107
107
  * Delete a specific channel connection by its unique identifier.
@@ -14,10 +14,10 @@ import { unwrapAsync } from "../types/fp.js";
14
14
 
15
15
  export class ChannelEndpoints extends ClientSDK {
16
16
  /**
17
- * List channel endpoints
17
+ * List all channel endpoints
18
18
  *
19
19
  * @remarks
20
- * Retrieve all channel endpoints for a resource based on query filters.
20
+ * List all channel endpoints for a resource based on query filters.
21
21
  */
22
22
  async list(
23
23
  request: operations.ChannelEndpointsControllerListChannelEndpointsRequest,
@@ -33,7 +33,7 @@ export class ChannelEndpoints extends ClientSDK {
33
33
  }
34
34
 
35
35
  /**
36
- * Create channel endpoint for a resource
36
+ * Create a channel endpoint
37
37
  *
38
38
  * @remarks
39
39
  * Create a new channel endpoint for a resource.
@@ -55,7 +55,7 @@ export class ChannelEndpoints extends ClientSDK {
55
55
  }
56
56
 
57
57
  /**
58
- * Retrieve channel endpoint by identifier
58
+ * Retrieve a channel endpoint
59
59
  *
60
60
  * @remarks
61
61
  * Retrieve a specific channel endpoint by its unique identifier.
@@ -74,7 +74,7 @@ export class ChannelEndpoints extends ClientSDK {
74
74
  }
75
75
 
76
76
  /**
77
- * Update channel endpoint
77
+ * Update a channel endpoint
78
78
  *
79
79
  * @remarks
80
80
  * Update an existing channel endpoint by its unique identifier.
@@ -97,7 +97,7 @@ export class ChannelEndpoints extends ClientSDK {
97
97
  }
98
98
 
99
99
  /**
100
- * Delete channel endpoint by identifier
100
+ * Delete a channel endpoint
101
101
  *
102
102
  * @remarks
103
103
  * Delete a specific channel endpoint by its unique identifier.
package/src/sdk/sdk.ts CHANGED
@@ -95,7 +95,7 @@ export class Novu extends ClientSDK {
95
95
  *
96
96
  * @remarks
97
97
  *
98
- * Trigger event is the main (and only) way to send notifications to subscribers. The trigger identifier is used to match the particular workflow associated with it. Additional information can be passed according the body interface below.
98
+ * Trigger event is the main (and only) way to send notifications to subscribers. The trigger identifier is used to match the particular workflow associated with it. Maximum number of recipients can be 100. Additional information can be passed according the body interface below.
99
99
  * To prevent duplicate triggers, you can optionally pass a **transactionId** in the request body. If the same **transactionId** is used again, the trigger will be ignored. The retention period depends on your billing tier.
100
100
  */
101
101
  async trigger(
@@ -4,6 +4,7 @@
4
4
 
5
5
  import { topicsSubscriptionsCreate } from "../funcs/topicsSubscriptionsCreate.js";
6
6
  import { topicsSubscriptionsDelete } from "../funcs/topicsSubscriptionsDelete.js";
7
+ import { topicsSubscriptionsGetSubscription } from "../funcs/topicsSubscriptionsGetSubscription.js";
7
8
  import { topicsSubscriptionsList } from "../funcs/topicsSubscriptionsList.js";
8
9
  import { topicsSubscriptionsUpdate } from "../funcs/topicsSubscriptionsUpdate.js";
9
10
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
@@ -75,11 +76,32 @@ export class Subscriptions extends ClientSDK {
75
76
  ));
76
77
  }
77
78
 
79
+ /**
80
+ * Get a topic subscription
81
+ *
82
+ * @remarks
83
+ * Get a subscription by its unique identifier for a topic.
84
+ */
85
+ async getSubscription(
86
+ topicKey: string,
87
+ identifier: string,
88
+ idempotencyKey?: string | undefined,
89
+ options?: RequestOptions,
90
+ ): Promise<operations.TopicsControllerGetTopicSubscriptionResponse> {
91
+ return unwrapAsync(topicsSubscriptionsGetSubscription(
92
+ this,
93
+ topicKey,
94
+ identifier,
95
+ idempotencyKey,
96
+ options,
97
+ ));
98
+ }
99
+
78
100
  /**
79
101
  * Update a topic subscription
80
102
  *
81
103
  * @remarks
82
- * Update a subscription by its unique identifier **subscriptionIdOrIdentifier** for a topic. You can update the preferences and name associated with the subscription.
104
+ * Update a subscription by its unique identifier for a topic. You can update the preferences and name associated with the subscription.
83
105
  */
84
106
  async update(
85
107
  request: operations.TopicsControllerUpdateTopicSubscriptionRequest,