@novu/api 0.0.1-alpha.121 → 0.0.1-alpha.128

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 (58) hide show
  1. package/docs/sdks/subscribers/README.md +8 -2
  2. package/funcs/subscribersCreateBulk.d.ts +1 -1
  3. package/funcs/subscribersCreateBulk.d.ts.map +1 -1
  4. package/funcs/subscribersCreateBulk.js +2 -3
  5. package/funcs/subscribersCreateBulk.js.map +1 -1
  6. package/lib/config.d.ts +2 -2
  7. package/lib/config.js +2 -2
  8. package/models/components/bulkcreatesubscriberresponsedto.d.ts +45 -0
  9. package/models/components/bulkcreatesubscriberresponsedto.d.ts.map +1 -0
  10. package/models/components/bulkcreatesubscriberresponsedto.js +66 -0
  11. package/models/components/bulkcreatesubscriberresponsedto.js.map +1 -0
  12. package/models/components/bulksubscribercreatedto.d.ts +3 -2
  13. package/models/components/bulksubscribercreatedto.d.ts.map +1 -1
  14. package/models/components/bulksubscribercreatedto.js +3 -2
  15. package/models/components/bulksubscribercreatedto.js.map +1 -1
  16. package/models/components/createdsubscriberdto.d.ts +32 -0
  17. package/models/components/createdsubscriberdto.d.ts.map +1 -0
  18. package/models/components/createdsubscriberdto.js +59 -0
  19. package/models/components/createdsubscriberdto.js.map +1 -0
  20. package/models/components/failedoperationdto.d.ts +37 -0
  21. package/models/components/failedoperationdto.d.ts.map +1 -0
  22. package/models/components/failedoperationdto.js +61 -0
  23. package/models/components/failedoperationdto.js.map +1 -0
  24. package/models/components/index.d.ts +4 -0
  25. package/models/components/index.d.ts.map +1 -1
  26. package/models/components/index.js +4 -0
  27. package/models/components/index.js.map +1 -1
  28. package/models/components/updatedsubscriberdto.d.ts +32 -0
  29. package/models/components/updatedsubscriberdto.d.ts.map +1 -0
  30. package/models/components/updatedsubscriberdto.js +59 -0
  31. package/models/components/updatedsubscriberdto.js.map +1 -0
  32. package/models/operations/subscriberscontrollerbulkcreatesubscribers.d.ts +3 -0
  33. package/models/operations/subscriberscontrollerbulkcreatesubscribers.d.ts.map +1 -1
  34. package/models/operations/subscriberscontrollerbulkcreatesubscribers.js +5 -0
  35. package/models/operations/subscriberscontrollerbulkcreatesubscribers.js.map +1 -1
  36. package/models/operations/subscriberscontrollerchatoauthcallback.d.ts +23 -2
  37. package/models/operations/subscriberscontrollerchatoauthcallback.d.ts.map +1 -1
  38. package/models/operations/subscriberscontrollerchatoauthcallback.js +26 -3
  39. package/models/operations/subscriberscontrollerchatoauthcallback.js.map +1 -1
  40. package/package.json +1 -1
  41. package/sdk/authentication.d.ts +1 -1
  42. package/sdk/authentication.d.ts.map +1 -1
  43. package/sdk/authentication.js.map +1 -1
  44. package/sdk/subscribers.d.ts +1 -1
  45. package/sdk/subscribers.d.ts.map +1 -1
  46. package/sdk/subscribers.js.map +1 -1
  47. package/src/funcs/subscribersCreateBulk.ts +6 -6
  48. package/src/lib/config.ts +2 -2
  49. package/src/models/components/bulkcreatesubscriberresponsedto.ts +103 -0
  50. package/src/models/components/bulksubscribercreatedto.ts +10 -4
  51. package/src/models/components/createdsubscriberdto.ts +69 -0
  52. package/src/models/components/failedoperationdto.ts +76 -0
  53. package/src/models/components/index.ts +4 -0
  54. package/src/models/components/updatedsubscriberdto.ts +69 -0
  55. package/src/models/operations/subscriberscontrollerbulkcreatesubscribers.ts +7 -0
  56. package/src/models/operations/subscriberscontrollerchatoauthcallback.ts +72 -4
  57. package/src/sdk/authentication.ts +1 -3
  58. package/src/sdk/subscribers.ts +1 -3
@@ -0,0 +1,76 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type FailedOperationDto = {
11
+ /**
12
+ * The error message associated with the failed operation.
13
+ */
14
+ message?: string | undefined;
15
+ /**
16
+ * The subscriber ID associated with the failed operation. This field is optional.
17
+ */
18
+ subscriberId?: string | undefined;
19
+ };
20
+
21
+ /** @internal */
22
+ export const FailedOperationDto$inboundSchema: z.ZodType<
23
+ FailedOperationDto,
24
+ z.ZodTypeDef,
25
+ unknown
26
+ > = z.object({
27
+ message: z.string().optional(),
28
+ subscriberId: z.string().optional(),
29
+ });
30
+
31
+ /** @internal */
32
+ export type FailedOperationDto$Outbound = {
33
+ message?: string | undefined;
34
+ subscriberId?: string | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const FailedOperationDto$outboundSchema: z.ZodType<
39
+ FailedOperationDto$Outbound,
40
+ z.ZodTypeDef,
41
+ FailedOperationDto
42
+ > = z.object({
43
+ message: z.string().optional(),
44
+ subscriberId: z.string().optional(),
45
+ });
46
+
47
+ /**
48
+ * @internal
49
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
50
+ */
51
+ export namespace FailedOperationDto$ {
52
+ /** @deprecated use `FailedOperationDto$inboundSchema` instead. */
53
+ export const inboundSchema = FailedOperationDto$inboundSchema;
54
+ /** @deprecated use `FailedOperationDto$outboundSchema` instead. */
55
+ export const outboundSchema = FailedOperationDto$outboundSchema;
56
+ /** @deprecated use `FailedOperationDto$Outbound` instead. */
57
+ export type Outbound = FailedOperationDto$Outbound;
58
+ }
59
+
60
+ export function failedOperationDtoToJSON(
61
+ failedOperationDto: FailedOperationDto,
62
+ ): string {
63
+ return JSON.stringify(
64
+ FailedOperationDto$outboundSchema.parse(failedOperationDto),
65
+ );
66
+ }
67
+
68
+ export function failedOperationDtoFromJSON(
69
+ jsonString: string,
70
+ ): SafeParseResult<FailedOperationDto, SDKValidationError> {
71
+ return safeParse(
72
+ jsonString,
73
+ (x) => FailedOperationDto$inboundSchema.parse(JSON.parse(x)),
74
+ `Failed to parse 'FailedOperationDto' from JSON`,
75
+ );
76
+ }
@@ -15,6 +15,7 @@ export * from "./actorfeeditemdto.js";
15
15
  export * from "./actortypeenum.js";
16
16
  export * from "./addsubscribersrequestdto.js";
17
17
  export * from "./assignsubscribertotopicdto.js";
18
+ export * from "./bulkcreatesubscriberresponsedto.js";
18
19
  export * from "./bulksubscribercreatedto.js";
19
20
  export * from "./bulktriggereventdto.js";
20
21
  export * from "./channelcredentials.js";
@@ -22,6 +23,7 @@ export * from "./channelcredentialsdto.js";
22
23
  export * from "./channelpreference.js";
23
24
  export * from "./channelsettings.js";
24
25
  export * from "./channeltypeenum.js";
26
+ export * from "./createdsubscriberdto.js";
25
27
  export * from "./createintegrationrequestdto.js";
26
28
  export * from "./createsubscriberrequestdto.js";
27
29
  export * from "./createtopicrequestdto.js";
@@ -37,6 +39,7 @@ export * from "./digesttimedmetadata.js";
37
39
  export * from "./emailblock.js";
38
40
  export * from "./emailblockstyles.js";
39
41
  export * from "./failedassignmentsdto.js";
42
+ export * from "./failedoperationdto.js";
40
43
  export * from "./feedresponsedto.js";
41
44
  export * from "./filtertopicsresponsedto.js";
42
45
  export * from "./getsubscriberpreferencesresponsedto.js";
@@ -82,6 +85,7 @@ export * from "./triggereventresponsedto.js";
82
85
  export * from "./triggereventtoallrequestdto.js";
83
86
  export * from "./triggerrecipientstypeenum.js";
84
87
  export * from "./unseencountresponse.js";
88
+ export * from "./updatedsubscriberdto.js";
85
89
  export * from "./updateintegrationrequestdto.js";
86
90
  export * from "./updatesubscriberchannelrequestdto.js";
87
91
  export * from "./updatesubscriberglobalpreferencesrequestdto.js";
@@ -0,0 +1,69 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type UpdatedSubscriberDto = {
11
+ /**
12
+ * The ID of the subscriber that was updated.
13
+ */
14
+ subscriberId: string;
15
+ };
16
+
17
+ /** @internal */
18
+ export const UpdatedSubscriberDto$inboundSchema: z.ZodType<
19
+ UpdatedSubscriberDto,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ subscriberId: z.string(),
24
+ });
25
+
26
+ /** @internal */
27
+ export type UpdatedSubscriberDto$Outbound = {
28
+ subscriberId: string;
29
+ };
30
+
31
+ /** @internal */
32
+ export const UpdatedSubscriberDto$outboundSchema: z.ZodType<
33
+ UpdatedSubscriberDto$Outbound,
34
+ z.ZodTypeDef,
35
+ UpdatedSubscriberDto
36
+ > = z.object({
37
+ subscriberId: z.string(),
38
+ });
39
+
40
+ /**
41
+ * @internal
42
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
43
+ */
44
+ export namespace UpdatedSubscriberDto$ {
45
+ /** @deprecated use `UpdatedSubscriberDto$inboundSchema` instead. */
46
+ export const inboundSchema = UpdatedSubscriberDto$inboundSchema;
47
+ /** @deprecated use `UpdatedSubscriberDto$outboundSchema` instead. */
48
+ export const outboundSchema = UpdatedSubscriberDto$outboundSchema;
49
+ /** @deprecated use `UpdatedSubscriberDto$Outbound` instead. */
50
+ export type Outbound = UpdatedSubscriberDto$Outbound;
51
+ }
52
+
53
+ export function updatedSubscriberDtoToJSON(
54
+ updatedSubscriberDto: UpdatedSubscriberDto,
55
+ ): string {
56
+ return JSON.stringify(
57
+ UpdatedSubscriberDto$outboundSchema.parse(updatedSubscriberDto),
58
+ );
59
+ }
60
+
61
+ export function updatedSubscriberDtoFromJSON(
62
+ jsonString: string,
63
+ ): SafeParseResult<UpdatedSubscriberDto, SDKValidationError> {
64
+ return safeParse(
65
+ jsonString,
66
+ (x) => UpdatedSubscriberDto$inboundSchema.parse(JSON.parse(x)),
67
+ `Failed to parse 'UpdatedSubscriberDto' from JSON`,
68
+ );
69
+ }
@@ -6,10 +6,12 @@ import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
9
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
11
 
11
12
  export type SubscribersControllerBulkCreateSubscribersResponse = {
12
13
  headers: { [k: string]: Array<string> };
14
+ result: components.BulkCreateSubscriberResponseDto;
13
15
  };
14
16
 
15
17
  /** @internal */
@@ -20,15 +22,18 @@ export const SubscribersControllerBulkCreateSubscribersResponse$inboundSchema:
20
22
  unknown
21
23
  > = z.object({
22
24
  Headers: z.record(z.array(z.string())),
25
+ Result: components.BulkCreateSubscriberResponseDto$inboundSchema,
23
26
  }).transform((v) => {
24
27
  return remap$(v, {
25
28
  "Headers": "headers",
29
+ "Result": "result",
26
30
  });
27
31
  });
28
32
 
29
33
  /** @internal */
30
34
  export type SubscribersControllerBulkCreateSubscribersResponse$Outbound = {
31
35
  Headers: { [k: string]: Array<string> };
36
+ Result: components.BulkCreateSubscriberResponseDto$Outbound;
32
37
  };
33
38
 
34
39
  /** @internal */
@@ -39,9 +44,11 @@ export const SubscribersControllerBulkCreateSubscribersResponse$outboundSchema:
39
44
  SubscribersControllerBulkCreateSubscribersResponse
40
45
  > = z.object({
41
46
  headers: z.record(z.array(z.string())),
47
+ result: components.BulkCreateSubscriberResponseDto$outboundSchema,
42
48
  }).transform((v) => {
43
49
  return remap$(v, {
44
50
  headers: "Headers",
51
+ result: "Result",
45
52
  });
46
53
  });
47
54
 
@@ -29,9 +29,13 @@ export type SubscribersControllerChatOauthCallbackRequest = {
29
29
  code: string;
30
30
  };
31
31
 
32
+ export type SubscribersControllerChatOauthCallbackResponseResult =
33
+ | string
34
+ | string;
35
+
32
36
  export type SubscribersControllerChatOauthCallbackResponse = {
33
37
  headers: { [k: string]: Array<string> };
34
- result: string;
38
+ result: string | string;
35
39
  };
36
40
 
37
41
  /** @internal */
@@ -116,6 +120,70 @@ export function subscribersControllerChatOauthCallbackRequestFromJSON(
116
120
  );
117
121
  }
118
122
 
123
+ /** @internal */
124
+ export const SubscribersControllerChatOauthCallbackResponseResult$inboundSchema:
125
+ z.ZodType<
126
+ SubscribersControllerChatOauthCallbackResponseResult,
127
+ z.ZodTypeDef,
128
+ unknown
129
+ > = z.union([z.string(), z.string()]);
130
+
131
+ /** @internal */
132
+ export type SubscribersControllerChatOauthCallbackResponseResult$Outbound =
133
+ | string
134
+ | string;
135
+
136
+ /** @internal */
137
+ export const SubscribersControllerChatOauthCallbackResponseResult$outboundSchema:
138
+ z.ZodType<
139
+ SubscribersControllerChatOauthCallbackResponseResult$Outbound,
140
+ z.ZodTypeDef,
141
+ SubscribersControllerChatOauthCallbackResponseResult
142
+ > = z.union([z.string(), z.string()]);
143
+
144
+ /**
145
+ * @internal
146
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
147
+ */
148
+ export namespace SubscribersControllerChatOauthCallbackResponseResult$ {
149
+ /** @deprecated use `SubscribersControllerChatOauthCallbackResponseResult$inboundSchema` instead. */
150
+ export const inboundSchema =
151
+ SubscribersControllerChatOauthCallbackResponseResult$inboundSchema;
152
+ /** @deprecated use `SubscribersControllerChatOauthCallbackResponseResult$outboundSchema` instead. */
153
+ export const outboundSchema =
154
+ SubscribersControllerChatOauthCallbackResponseResult$outboundSchema;
155
+ /** @deprecated use `SubscribersControllerChatOauthCallbackResponseResult$Outbound` instead. */
156
+ export type Outbound =
157
+ SubscribersControllerChatOauthCallbackResponseResult$Outbound;
158
+ }
159
+
160
+ export function subscribersControllerChatOauthCallbackResponseResultToJSON(
161
+ subscribersControllerChatOauthCallbackResponseResult:
162
+ SubscribersControllerChatOauthCallbackResponseResult,
163
+ ): string {
164
+ return JSON.stringify(
165
+ SubscribersControllerChatOauthCallbackResponseResult$outboundSchema.parse(
166
+ subscribersControllerChatOauthCallbackResponseResult,
167
+ ),
168
+ );
169
+ }
170
+
171
+ export function subscribersControllerChatOauthCallbackResponseResultFromJSON(
172
+ jsonString: string,
173
+ ): SafeParseResult<
174
+ SubscribersControllerChatOauthCallbackResponseResult,
175
+ SDKValidationError
176
+ > {
177
+ return safeParse(
178
+ jsonString,
179
+ (x) =>
180
+ SubscribersControllerChatOauthCallbackResponseResult$inboundSchema.parse(
181
+ JSON.parse(x),
182
+ ),
183
+ `Failed to parse 'SubscribersControllerChatOauthCallbackResponseResult' from JSON`,
184
+ );
185
+ }
186
+
119
187
  /** @internal */
120
188
  export const SubscribersControllerChatOauthCallbackResponse$inboundSchema:
121
189
  z.ZodType<
@@ -124,7 +192,7 @@ export const SubscribersControllerChatOauthCallbackResponse$inboundSchema:
124
192
  unknown
125
193
  > = z.object({
126
194
  Headers: z.record(z.array(z.string())),
127
- Result: z.string(),
195
+ Result: z.union([z.string(), z.string()]),
128
196
  }).transform((v) => {
129
197
  return remap$(v, {
130
198
  "Headers": "headers",
@@ -135,7 +203,7 @@ export const SubscribersControllerChatOauthCallbackResponse$inboundSchema:
135
203
  /** @internal */
136
204
  export type SubscribersControllerChatOauthCallbackResponse$Outbound = {
137
205
  Headers: { [k: string]: Array<string> };
138
- Result: string;
206
+ Result: string | string;
139
207
  };
140
208
 
141
209
  /** @internal */
@@ -146,7 +214,7 @@ export const SubscribersControllerChatOauthCallbackResponse$outboundSchema:
146
214
  SubscribersControllerChatOauthCallbackResponse
147
215
  > = z.object({
148
216
  headers: z.record(z.array(z.string())),
149
- result: z.string(),
217
+ result: z.union([z.string(), z.string()]),
150
218
  }).transform((v) => {
151
219
  return remap$(v, {
152
220
  headers: "Headers",
@@ -15,9 +15,7 @@ export class Authentication extends ClientSDK {
15
15
  async chatAccessOauthCallBack(
16
16
  request: operations.SubscribersControllerChatOauthCallbackRequest,
17
17
  options?: RequestOptions,
18
- ): Promise<
19
- operations.SubscribersControllerChatOauthCallbackResponse | undefined
20
- > {
18
+ ): Promise<operations.SubscribersControllerChatOauthCallbackResponse> {
21
19
  return unwrapAsync(subscribersAuthenticationChatAccessOauthCallBack(
22
20
  this,
23
21
  request,
@@ -158,9 +158,7 @@ export class Subscribers extends ClientSDK {
158
158
  async createBulk(
159
159
  request: components.BulkSubscriberCreateDto,
160
160
  options?: RequestOptions,
161
- ): Promise<
162
- operations.SubscribersControllerBulkCreateSubscribersResponse | undefined
163
- > {
161
+ ): Promise<operations.SubscribersControllerBulkCreateSubscribersResponse> {
164
162
  return unwrapAsync(subscribersCreateBulk(
165
163
  this,
166
164
  request,