@novu/api 0.0.1-alpha.145 → 0.0.1-alpha.147
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.
- package/docs/sdks/credentials/README.md +4 -4
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/channelcredentials.d.ts +10 -10
- package/models/components/channelcredentials.d.ts.map +1 -1
- package/models/components/channelcredentials.js +2 -2
- package/models/components/channelcredentials.js.map +1 -1
- package/models/components/channelpreference.d.ts +3 -43
- package/models/components/channelpreference.d.ts.map +1 -1
- package/models/components/channelpreference.js +4 -28
- package/models/components/channelpreference.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/channelcredentials.ts +12 -12
- package/src/models/components/channelpreference.ts +9 -41
|
@@ -26,7 +26,7 @@ async function run() {
|
|
|
26
26
|
const result = await novu.subscribers.credentials.update({
|
|
27
27
|
providerId: "pushpad",
|
|
28
28
|
credentials: {
|
|
29
|
-
webhookUrl: "https://
|
|
29
|
+
webhookUrl: "https://example.com/webhook",
|
|
30
30
|
},
|
|
31
31
|
}, "<id>");
|
|
32
32
|
|
|
@@ -55,7 +55,7 @@ async function run() {
|
|
|
55
55
|
const res = await subscribersCredentialsUpdate(novu, {
|
|
56
56
|
providerId: "pushpad",
|
|
57
57
|
credentials: {
|
|
58
|
-
webhookUrl: "https://
|
|
58
|
+
webhookUrl: "https://example.com/webhook",
|
|
59
59
|
},
|
|
60
60
|
}, "<id>");
|
|
61
61
|
|
|
@@ -113,7 +113,7 @@ async function run() {
|
|
|
113
113
|
const result = await novu.subscribers.credentials.append({
|
|
114
114
|
providerId: "zulip",
|
|
115
115
|
credentials: {
|
|
116
|
-
webhookUrl: "https://
|
|
116
|
+
webhookUrl: "https://example.com/webhook",
|
|
117
117
|
},
|
|
118
118
|
}, "<id>");
|
|
119
119
|
|
|
@@ -142,7 +142,7 @@ async function run() {
|
|
|
142
142
|
const res = await subscribersCredentialsAppend(novu, {
|
|
143
143
|
providerId: "zulip",
|
|
144
144
|
credentials: {
|
|
145
|
-
webhookUrl: "https://
|
|
145
|
+
webhookUrl: "https://example.com/webhook",
|
|
146
146
|
},
|
|
147
147
|
}, "<id>");
|
|
148
148
|
|
package/lib/config.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
27
27
|
export declare const SDK_METADATA: {
|
|
28
28
|
readonly language: "typescript";
|
|
29
29
|
readonly openapiDocVersion: "1.0";
|
|
30
|
-
readonly sdkVersion: "0.0.1-alpha.
|
|
30
|
+
readonly sdkVersion: "0.0.1-alpha.147";
|
|
31
31
|
readonly genVersion: "2.481.0";
|
|
32
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.
|
|
32
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.147 2.481.0 1.0 @novu/api";
|
|
33
33
|
};
|
|
34
34
|
//# sourceMappingURL=config.d.ts.map
|
package/lib/config.js
CHANGED
|
@@ -30,8 +30,8 @@ exports.serverURLFromOptions = serverURLFromOptions;
|
|
|
30
30
|
exports.SDK_METADATA = {
|
|
31
31
|
language: "typescript",
|
|
32
32
|
openapiDocVersion: "1.0",
|
|
33
|
-
sdkVersion: "0.0.1-alpha.
|
|
33
|
+
sdkVersion: "0.0.1-alpha.147",
|
|
34
34
|
genVersion: "2.481.0",
|
|
35
|
-
userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.
|
|
35
|
+
userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.147 2.481.0 1.0 @novu/api",
|
|
36
36
|
};
|
|
37
37
|
//# sourceMappingURL=config.js.map
|
|
@@ -3,35 +3,35 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
3
3
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
4
|
export type ChannelCredentials = {
|
|
5
5
|
/**
|
|
6
|
-
* Webhook
|
|
6
|
+
* Webhook URL used by chat app integrations. The webhook should be obtained from the chat app provider.
|
|
7
7
|
*/
|
|
8
|
-
webhookUrl
|
|
8
|
+
webhookUrl?: string | undefined;
|
|
9
9
|
/**
|
|
10
|
-
* Channel specification for Mattermost chat notifications
|
|
10
|
+
* Channel specification for Mattermost chat notifications.
|
|
11
11
|
*/
|
|
12
12
|
channel?: string | undefined;
|
|
13
13
|
/**
|
|
14
|
-
* Contains an array of the subscriber device tokens for a given provider. Used on Push integrations
|
|
14
|
+
* Contains an array of the subscriber device tokens for a given provider. Used on Push integrations.
|
|
15
15
|
*/
|
|
16
16
|
deviceTokens?: Array<string> | undefined;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Alert UID for Grafana on-call webhook payload.
|
|
19
19
|
*/
|
|
20
20
|
alertUid?: string | undefined;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Title to be used with Grafana on-call webhook.
|
|
23
23
|
*/
|
|
24
24
|
title?: string | undefined;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Image URL property for Grafana on-call webhook.
|
|
27
27
|
*/
|
|
28
28
|
imageUrl?: string | undefined;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* State property for Grafana on-call webhook.
|
|
31
31
|
*/
|
|
32
32
|
state?: string | undefined;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Link to upstream details property for Grafana on-call webhook.
|
|
35
35
|
*/
|
|
36
36
|
externalUrl?: string | undefined;
|
|
37
37
|
};
|
|
@@ -39,7 +39,7 @@ export type ChannelCredentials = {
|
|
|
39
39
|
export declare const ChannelCredentials$inboundSchema: z.ZodType<ChannelCredentials, z.ZodTypeDef, unknown>;
|
|
40
40
|
/** @internal */
|
|
41
41
|
export type ChannelCredentials$Outbound = {
|
|
42
|
-
webhookUrl
|
|
42
|
+
webhookUrl?: string | undefined;
|
|
43
43
|
channel?: string | undefined;
|
|
44
44
|
deviceTokens?: Array<string> | undefined;
|
|
45
45
|
alertUid?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelcredentials.d.ts","sourceRoot":"","sources":["../../src/models/components/channelcredentials.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"channelcredentials.d.ts","sourceRoot":"","sources":["../../src/models/components/channelcredentials.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CACtD,kBAAkB,EAClB,CAAC,CAAC,UAAU,EACZ,OAAO,CAUP,CAAC;AAEH,gBAAgB;AAChB,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,iCAAiC,EAAE,CAAC,CAAC,OAAO,CACvD,2BAA2B,EAC3B,CAAC,CAAC,UAAU,EACZ,kBAAkB,CAUlB,CAAC;AAEH;;;GAGG;AACH,yBAAiB,mBAAmB,CAAC;IACnC,kEAAkE;IAC3D,MAAM,aAAa,sDAAmC,CAAC;IAC9D,mEAAmE;IAC5D,MAAM,cAAc,0EAAoC,CAAC;IAChE,6DAA6D;IAC7D,KAAY,QAAQ,GAAG,2BAA2B,CAAC;CACpD;AAED,wBAAgB,wBAAwB,CACtC,kBAAkB,EAAE,kBAAkB,GACrC,MAAM,CAIR;AAED,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAMzD"}
|
|
@@ -31,7 +31,7 @@ const z = __importStar(require("zod"));
|
|
|
31
31
|
const schemas_js_1 = require("../../lib/schemas.js");
|
|
32
32
|
/** @internal */
|
|
33
33
|
exports.ChannelCredentials$inboundSchema = z.object({
|
|
34
|
-
webhookUrl: z.string(),
|
|
34
|
+
webhookUrl: z.string().optional(),
|
|
35
35
|
channel: z.string().optional(),
|
|
36
36
|
deviceTokens: z.array(z.string()).optional(),
|
|
37
37
|
alertUid: z.string().optional(),
|
|
@@ -42,7 +42,7 @@ exports.ChannelCredentials$inboundSchema = z.object({
|
|
|
42
42
|
});
|
|
43
43
|
/** @internal */
|
|
44
44
|
exports.ChannelCredentials$outboundSchema = z.object({
|
|
45
|
-
webhookUrl: z.string(),
|
|
45
|
+
webhookUrl: z.string().optional(),
|
|
46
46
|
channel: z.string().optional(),
|
|
47
47
|
deviceTokens: z.array(z.string()).optional(),
|
|
48
48
|
alertUid: z.string().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelcredentials.js","sourceRoot":"","sources":["../../src/models/components/channelcredentials.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,qDAAiD;AAuCjD,gBAAgB;AACH,QAAA,gCAAgC,GAIzC,CAAC,CAAC,MAAM,CAAC;IACX,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"channelcredentials.js","sourceRoot":"","sources":["../../src/models/components/channelcredentials.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,qDAAiD;AAuCjD,gBAAgB;AACH,QAAA,gCAAgC,GAIzC,CAAC,CAAC,MAAM,CAAC;IACX,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAcH,gBAAgB;AACH,QAAA,iCAAiC,GAI1C,CAAC,CAAC,MAAM,CAAC;IACX,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH;;;GAGG;AACH,IAAiB,mBAAmB,CAOnC;AAPD,WAAiB,mBAAmB;IAClC,kEAAkE;IACrD,iCAAa,GAAG,wCAAgC,CAAC;IAC9D,mEAAmE;IACtD,kCAAc,GAAG,yCAAiC,CAAC;AAGlE,CAAC,EAPgB,mBAAmB,mCAAnB,mBAAmB,QAOnC;AAED,SAAgB,wBAAwB,CACtC,kBAAsC;IAEtC,OAAO,IAAI,CAAC,SAAS,CACnB,yCAAiC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAC5D,CAAC;AACJ,CAAC;AAND,4DAMC;AAED,SAAgB,0BAA0B,CACxC,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,wCAAgC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC5D,gDAAgD,CACjD,CAAC;AACJ,CAAC;AARD,gEAQC"}
|
|
@@ -1,58 +1,18 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
5
|
-
|
|
6
|
-
* The type of channel that is enabled or not
|
|
7
|
-
*/
|
|
8
|
-
export declare const ChannelPreferenceType: {
|
|
9
|
-
readonly InApp: "in_app";
|
|
10
|
-
readonly Email: "email";
|
|
11
|
-
readonly Sms: "sms";
|
|
12
|
-
readonly Chat: "chat";
|
|
13
|
-
readonly Push: "push";
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* The type of channel that is enabled or not
|
|
17
|
-
*/
|
|
18
|
-
export type ChannelPreferenceType = ClosedEnum<typeof ChannelPreferenceType>;
|
|
4
|
+
import { ChannelTypeEnum } from "./channeltypeenum.js";
|
|
19
5
|
export type ChannelPreference = {
|
|
20
6
|
/**
|
|
21
|
-
*
|
|
7
|
+
* Channel type through which the message is sent
|
|
22
8
|
*/
|
|
23
|
-
type:
|
|
9
|
+
type: ChannelTypeEnum;
|
|
24
10
|
/**
|
|
25
11
|
* If channel is enabled or not
|
|
26
12
|
*/
|
|
27
13
|
enabled: boolean;
|
|
28
14
|
};
|
|
29
15
|
/** @internal */
|
|
30
|
-
export declare const ChannelPreferenceType$inboundSchema: z.ZodNativeEnum<typeof ChannelPreferenceType>;
|
|
31
|
-
/** @internal */
|
|
32
|
-
export declare const ChannelPreferenceType$outboundSchema: z.ZodNativeEnum<typeof ChannelPreferenceType>;
|
|
33
|
-
/**
|
|
34
|
-
* @internal
|
|
35
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
36
|
-
*/
|
|
37
|
-
export declare namespace ChannelPreferenceType$ {
|
|
38
|
-
/** @deprecated use `ChannelPreferenceType$inboundSchema` instead. */
|
|
39
|
-
const inboundSchema: z.ZodNativeEnum<{
|
|
40
|
-
readonly InApp: "in_app";
|
|
41
|
-
readonly Email: "email";
|
|
42
|
-
readonly Sms: "sms";
|
|
43
|
-
readonly Chat: "chat";
|
|
44
|
-
readonly Push: "push";
|
|
45
|
-
}>;
|
|
46
|
-
/** @deprecated use `ChannelPreferenceType$outboundSchema` instead. */
|
|
47
|
-
const outboundSchema: z.ZodNativeEnum<{
|
|
48
|
-
readonly InApp: "in_app";
|
|
49
|
-
readonly Email: "email";
|
|
50
|
-
readonly Sms: "sms";
|
|
51
|
-
readonly Chat: "chat";
|
|
52
|
-
readonly Push: "push";
|
|
53
|
-
}>;
|
|
54
|
-
}
|
|
55
|
-
/** @internal */
|
|
56
16
|
export declare const ChannelPreference$inboundSchema: z.ZodType<ChannelPreference, z.ZodTypeDef, unknown>;
|
|
57
17
|
/** @internal */
|
|
58
18
|
export type ChannelPreference$Outbound = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelpreference.d.ts","sourceRoot":"","sources":["../../src/models/components/channelpreference.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"channelpreference.d.ts","sourceRoot":"","sources":["../../src/models/components/channelpreference.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,eAAe,EAGhB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;IACtB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,OAAO,CAIP,CAAC;AAEH,gBAAgB;AAChB,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CACtD,0BAA0B,EAC1B,CAAC,CAAC,UAAU,EACZ,iBAAiB,CAIjB,CAAC;AAEH;;;GAGG;AACH,yBAAiB,kBAAkB,CAAC;IAClC,iEAAiE;IAC1D,MAAM,aAAa,qDAAkC,CAAC;IAC7D,kEAAkE;IAC3D,MAAM,cAAc,wEAAmC,CAAC;IAC/D,4DAA4D;IAC5D,KAAY,QAAQ,GAAG,0BAA0B,CAAC;CACnD;AAED,wBAAgB,uBAAuB,CACrC,iBAAiB,EAAE,iBAAiB,GACnC,MAAM,CAIR;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAMxD"}
|
|
@@ -26,42 +26,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.channelPreferenceFromJSON = exports.channelPreferenceToJSON = exports.ChannelPreference$ = exports.ChannelPreference$outboundSchema = exports.ChannelPreference$inboundSchema =
|
|
29
|
+
exports.channelPreferenceFromJSON = exports.channelPreferenceToJSON = exports.ChannelPreference$ = exports.ChannelPreference$outboundSchema = exports.ChannelPreference$inboundSchema = void 0;
|
|
30
30
|
const z = __importStar(require("zod"));
|
|
31
31
|
const schemas_js_1 = require("../../lib/schemas.js");
|
|
32
|
-
|
|
33
|
-
* The type of channel that is enabled or not
|
|
34
|
-
*/
|
|
35
|
-
exports.ChannelPreferenceType = {
|
|
36
|
-
InApp: "in_app",
|
|
37
|
-
Email: "email",
|
|
38
|
-
Sms: "sms",
|
|
39
|
-
Chat: "chat",
|
|
40
|
-
Push: "push",
|
|
41
|
-
};
|
|
42
|
-
/** @internal */
|
|
43
|
-
exports.ChannelPreferenceType$inboundSchema = z.nativeEnum(exports.ChannelPreferenceType);
|
|
44
|
-
/** @internal */
|
|
45
|
-
exports.ChannelPreferenceType$outboundSchema = exports.ChannelPreferenceType$inboundSchema;
|
|
46
|
-
/**
|
|
47
|
-
* @internal
|
|
48
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
49
|
-
*/
|
|
50
|
-
var ChannelPreferenceType$;
|
|
51
|
-
(function (ChannelPreferenceType$) {
|
|
52
|
-
/** @deprecated use `ChannelPreferenceType$inboundSchema` instead. */
|
|
53
|
-
ChannelPreferenceType$.inboundSchema = exports.ChannelPreferenceType$inboundSchema;
|
|
54
|
-
/** @deprecated use `ChannelPreferenceType$outboundSchema` instead. */
|
|
55
|
-
ChannelPreferenceType$.outboundSchema = exports.ChannelPreferenceType$outboundSchema;
|
|
56
|
-
})(ChannelPreferenceType$ || (exports.ChannelPreferenceType$ = ChannelPreferenceType$ = {}));
|
|
32
|
+
const channeltypeenum_js_1 = require("./channeltypeenum.js");
|
|
57
33
|
/** @internal */
|
|
58
34
|
exports.ChannelPreference$inboundSchema = z.object({
|
|
59
|
-
type:
|
|
35
|
+
type: channeltypeenum_js_1.ChannelTypeEnum$inboundSchema,
|
|
60
36
|
enabled: z.boolean(),
|
|
61
37
|
});
|
|
62
38
|
/** @internal */
|
|
63
39
|
exports.ChannelPreference$outboundSchema = z.object({
|
|
64
|
-
type:
|
|
40
|
+
type: channeltypeenum_js_1.ChannelTypeEnum$outboundSchema,
|
|
65
41
|
enabled: z.boolean(),
|
|
66
42
|
});
|
|
67
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelpreference.js","sourceRoot":"","sources":["../../src/models/components/channelpreference.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,qDAAiD;
|
|
1
|
+
{"version":3,"file":"channelpreference.js","sourceRoot":"","sources":["../../src/models/components/channelpreference.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,qDAAiD;AAGjD,6DAI8B;AAa9B,gBAAgB;AACH,QAAA,+BAA+B,GAIxC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,kDAA6B;IACnC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAQH,gBAAgB;AACH,QAAA,gCAAgC,GAIzC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,mDAA8B;IACpC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAEH;;;GAGG;AACH,IAAiB,kBAAkB,CAOlC;AAPD,WAAiB,kBAAkB;IACjC,iEAAiE;IACpD,gCAAa,GAAG,uCAA+B,CAAC;IAC7D,kEAAkE;IACrD,iCAAc,GAAG,wCAAgC,CAAC;AAGjE,CAAC,EAPgB,kBAAkB,kCAAlB,kBAAkB,QAOlC;AAED,SAAgB,uBAAuB,CACrC,iBAAoC;IAEpC,OAAO,IAAI,CAAC,SAAS,CACnB,wCAAgC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC1D,CAAC;AACJ,CAAC;AAND,0DAMC;AAED,SAAgB,yBAAyB,CACvC,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,uCAA+B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC3D,+CAA+C,CAChD,CAAC;AACJ,CAAC;AARD,8DAQC"}
|
package/package.json
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -55,7 +55,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
55
55
|
export const SDK_METADATA = {
|
|
56
56
|
language: "typescript",
|
|
57
57
|
openapiDocVersion: "1.0",
|
|
58
|
-
sdkVersion: "0.0.1-alpha.
|
|
58
|
+
sdkVersion: "0.0.1-alpha.147",
|
|
59
59
|
genVersion: "2.481.0",
|
|
60
|
-
userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.
|
|
60
|
+
userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.147 2.481.0 1.0 @novu/api",
|
|
61
61
|
} as const;
|
|
@@ -9,35 +9,35 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
9
9
|
|
|
10
10
|
export type ChannelCredentials = {
|
|
11
11
|
/**
|
|
12
|
-
* Webhook
|
|
12
|
+
* Webhook URL used by chat app integrations. The webhook should be obtained from the chat app provider.
|
|
13
13
|
*/
|
|
14
|
-
webhookUrl
|
|
14
|
+
webhookUrl?: string | undefined;
|
|
15
15
|
/**
|
|
16
|
-
* Channel specification for Mattermost chat notifications
|
|
16
|
+
* Channel specification for Mattermost chat notifications.
|
|
17
17
|
*/
|
|
18
18
|
channel?: string | undefined;
|
|
19
19
|
/**
|
|
20
|
-
* Contains an array of the subscriber device tokens for a given provider. Used on Push integrations
|
|
20
|
+
* Contains an array of the subscriber device tokens for a given provider. Used on Push integrations.
|
|
21
21
|
*/
|
|
22
22
|
deviceTokens?: Array<string> | undefined;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Alert UID for Grafana on-call webhook payload.
|
|
25
25
|
*/
|
|
26
26
|
alertUid?: string | undefined;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Title to be used with Grafana on-call webhook.
|
|
29
29
|
*/
|
|
30
30
|
title?: string | undefined;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Image URL property for Grafana on-call webhook.
|
|
33
33
|
*/
|
|
34
34
|
imageUrl?: string | undefined;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* State property for Grafana on-call webhook.
|
|
37
37
|
*/
|
|
38
38
|
state?: string | undefined;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Link to upstream details property for Grafana on-call webhook.
|
|
41
41
|
*/
|
|
42
42
|
externalUrl?: string | undefined;
|
|
43
43
|
};
|
|
@@ -48,7 +48,7 @@ export const ChannelCredentials$inboundSchema: z.ZodType<
|
|
|
48
48
|
z.ZodTypeDef,
|
|
49
49
|
unknown
|
|
50
50
|
> = z.object({
|
|
51
|
-
webhookUrl: z.string(),
|
|
51
|
+
webhookUrl: z.string().optional(),
|
|
52
52
|
channel: z.string().optional(),
|
|
53
53
|
deviceTokens: z.array(z.string()).optional(),
|
|
54
54
|
alertUid: z.string().optional(),
|
|
@@ -60,7 +60,7 @@ export const ChannelCredentials$inboundSchema: z.ZodType<
|
|
|
60
60
|
|
|
61
61
|
/** @internal */
|
|
62
62
|
export type ChannelCredentials$Outbound = {
|
|
63
|
-
webhookUrl
|
|
63
|
+
webhookUrl?: string | undefined;
|
|
64
64
|
channel?: string | undefined;
|
|
65
65
|
deviceTokens?: Array<string> | undefined;
|
|
66
66
|
alertUid?: string | undefined;
|
|
@@ -76,7 +76,7 @@ export const ChannelCredentials$outboundSchema: z.ZodType<
|
|
|
76
76
|
z.ZodTypeDef,
|
|
77
77
|
ChannelCredentials
|
|
78
78
|
> = z.object({
|
|
79
|
-
webhookUrl: z.string(),
|
|
79
|
+
webhookUrl: z.string().optional(),
|
|
80
80
|
channel: z.string().optional(),
|
|
81
81
|
deviceTokens: z.array(z.string()).optional(),
|
|
82
82
|
alertUid: z.string().optional(),
|
|
@@ -4,64 +4,32 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
InApp: "in_app",
|
|
16
|
-
Email: "email",
|
|
17
|
-
Sms: "sms",
|
|
18
|
-
Chat: "chat",
|
|
19
|
-
Push: "push",
|
|
20
|
-
} as const;
|
|
21
|
-
/**
|
|
22
|
-
* The type of channel that is enabled or not
|
|
23
|
-
*/
|
|
24
|
-
export type ChannelPreferenceType = ClosedEnum<typeof ChannelPreferenceType>;
|
|
9
|
+
import {
|
|
10
|
+
ChannelTypeEnum,
|
|
11
|
+
ChannelTypeEnum$inboundSchema,
|
|
12
|
+
ChannelTypeEnum$outboundSchema,
|
|
13
|
+
} from "./channeltypeenum.js";
|
|
25
14
|
|
|
26
15
|
export type ChannelPreference = {
|
|
27
16
|
/**
|
|
28
|
-
*
|
|
17
|
+
* Channel type through which the message is sent
|
|
29
18
|
*/
|
|
30
|
-
type:
|
|
19
|
+
type: ChannelTypeEnum;
|
|
31
20
|
/**
|
|
32
21
|
* If channel is enabled or not
|
|
33
22
|
*/
|
|
34
23
|
enabled: boolean;
|
|
35
24
|
};
|
|
36
25
|
|
|
37
|
-
/** @internal */
|
|
38
|
-
export const ChannelPreferenceType$inboundSchema: z.ZodNativeEnum<
|
|
39
|
-
typeof ChannelPreferenceType
|
|
40
|
-
> = z.nativeEnum(ChannelPreferenceType);
|
|
41
|
-
|
|
42
|
-
/** @internal */
|
|
43
|
-
export const ChannelPreferenceType$outboundSchema: z.ZodNativeEnum<
|
|
44
|
-
typeof ChannelPreferenceType
|
|
45
|
-
> = ChannelPreferenceType$inboundSchema;
|
|
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 ChannelPreferenceType$ {
|
|
52
|
-
/** @deprecated use `ChannelPreferenceType$inboundSchema` instead. */
|
|
53
|
-
export const inboundSchema = ChannelPreferenceType$inboundSchema;
|
|
54
|
-
/** @deprecated use `ChannelPreferenceType$outboundSchema` instead. */
|
|
55
|
-
export const outboundSchema = ChannelPreferenceType$outboundSchema;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
26
|
/** @internal */
|
|
59
27
|
export const ChannelPreference$inboundSchema: z.ZodType<
|
|
60
28
|
ChannelPreference,
|
|
61
29
|
z.ZodTypeDef,
|
|
62
30
|
unknown
|
|
63
31
|
> = z.object({
|
|
64
|
-
type:
|
|
32
|
+
type: ChannelTypeEnum$inboundSchema,
|
|
65
33
|
enabled: z.boolean(),
|
|
66
34
|
});
|
|
67
35
|
|
|
@@ -77,7 +45,7 @@ export const ChannelPreference$outboundSchema: z.ZodType<
|
|
|
77
45
|
z.ZodTypeDef,
|
|
78
46
|
ChannelPreference
|
|
79
47
|
> = z.object({
|
|
80
|
-
type:
|
|
48
|
+
type: ChannelTypeEnum$outboundSchema,
|
|
81
49
|
enabled: z.boolean(),
|
|
82
50
|
});
|
|
83
51
|
|