@trycourier/courier 6.2.1 → 6.2.3
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/Client.d.ts +71 -10
- package/Client.js +72 -11
- package/api/client/requests/SendMessageRequest.d.ts +71 -10
- package/api/resources/audiences/client/Client.js +5 -5
- package/api/resources/auditEvents/client/Client.js +2 -2
- package/api/resources/authTokens/client/Client.js +1 -1
- package/api/resources/automations/client/Client.js +2 -2
- package/api/resources/brands/client/Client.d.ts +38 -4
- package/api/resources/brands/client/Client.js +43 -9
- package/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +13 -2
- package/api/resources/bulk/client/Client.d.ts +91 -3
- package/api/resources/bulk/client/Client.js +96 -8
- package/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +70 -1
- package/api/resources/inbound/client/Client.js +1 -1
- package/api/resources/lists/client/Client.d.ts +8 -96
- package/api/resources/lists/client/Client.js +18 -106
- package/api/resources/lists/client/requests/AddSubscribersToList.d.ts +2 -24
- package/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +2 -24
- package/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +2 -24
- package/api/resources/messages/client/Client.js +6 -6
- package/api/resources/notifications/client/Client.d.ts +2 -1
- package/api/resources/notifications/client/Client.js +12 -8
- package/api/resources/notifications/client/requests/NotificationListParams.d.ts +6 -1
- package/api/resources/notifications/types/Notification.d.ts +1 -0
- package/api/resources/profiles/client/Client.d.ts +7 -1
- package/api/resources/profiles/client/Client.js +14 -8
- package/api/resources/profiles/types/Pagerduty.d.ts +9 -0
- package/api/resources/profiles/types/UserProfile.d.ts +1 -1
- package/api/resources/profiles/types/UserProfileFirebaseToken.d.ts +4 -0
- package/api/resources/profiles/types/WebhookAuthMode.d.ts +9 -0
- package/api/resources/profiles/types/WebhookAuthMode.js +11 -0
- package/api/resources/profiles/types/WebhookAuthentication.d.ts +14 -0
- package/api/resources/profiles/types/WebhookAuthentication.js +5 -0
- package/api/resources/profiles/types/WebhookMethod.d.ts +8 -0
- package/api/resources/profiles/types/WebhookMethod.js +10 -0
- package/api/resources/profiles/types/WebhookProfile.d.ts +16 -0
- package/api/resources/profiles/types/WebhookProfile.js +5 -0
- package/api/resources/profiles/types/WebhookProfileType.d.ts +8 -0
- package/api/resources/profiles/types/WebhookProfileType.js +10 -0
- package/api/resources/profiles/types/index.d.ts +7 -0
- package/api/resources/profiles/types/index.js +7 -0
- package/api/resources/send/types/BaseMessage.d.ts +1 -0
- package/api/resources/send/types/Channel.d.ts +1 -1
- package/api/resources/send/types/MessagePreferences.d.ts +7 -0
- package/api/resources/send/types/MessagePreferences.js +5 -0
- package/api/resources/send/types/PagerdutyRecipient.d.ts +7 -0
- package/api/resources/send/types/PagerdutyRecipient.js +5 -0
- package/api/resources/send/types/Recipient.d.ts +1 -1
- package/api/resources/send/types/WebhookRecipient.d.ts +7 -0
- package/api/resources/send/types/WebhookRecipient.js +5 -0
- package/api/resources/send/types/index.d.ts +3 -2
- package/api/resources/send/types/index.js +3 -2
- package/api/resources/templates/client/Client.js +1 -1
- package/api/resources/tenants/client/Client.d.ts +6 -1
- package/api/resources/tenants/client/Client.js +13 -8
- package/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +6 -1
- package/api/resources/translations/client/Client.js +2 -2
- package/api/resources/users/resources/preferences/client/Client.d.ts +10 -4
- package/api/resources/users/resources/preferences/client/Client.js +43 -8
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts +15 -0
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.js +5 -0
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.d.ts +15 -0
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.js +5 -0
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +4 -0
- package/api/resources/users/resources/preferences/client/requests/index.d.ts +2 -0
- package/api/resources/users/resources/tenants/client/Client.js +5 -5
- package/api/resources/users/resources/tokens/client/Client.d.ts +5 -1
- package/api/resources/users/resources/tokens/client/Client.js +11 -7
- package/dist/Client.d.ts +71 -10
- package/dist/Client.js +72 -11
- package/dist/api/client/requests/SendMessageRequest.d.ts +71 -10
- package/dist/api/resources/audiences/client/Client.js +5 -5
- package/dist/api/resources/auditEvents/client/Client.js +2 -2
- package/dist/api/resources/authTokens/client/Client.js +1 -1
- package/dist/api/resources/automations/client/Client.js +2 -2
- package/dist/api/resources/brands/client/Client.d.ts +38 -4
- package/dist/api/resources/brands/client/Client.js +43 -9
- package/dist/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +13 -2
- package/dist/api/resources/bulk/client/Client.d.ts +91 -3
- package/dist/api/resources/bulk/client/Client.js +96 -8
- package/dist/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +70 -1
- package/dist/api/resources/inbound/client/Client.js +1 -1
- package/dist/api/resources/lists/client/Client.d.ts +8 -96
- package/dist/api/resources/lists/client/Client.js +18 -106
- package/dist/api/resources/lists/client/requests/AddSubscribersToList.d.ts +2 -24
- package/dist/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +2 -24
- package/dist/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +2 -24
- package/dist/api/resources/messages/client/Client.js +6 -6
- package/dist/api/resources/notifications/client/Client.d.ts +2 -1
- package/dist/api/resources/notifications/client/Client.js +12 -8
- package/dist/api/resources/notifications/client/requests/NotificationListParams.d.ts +6 -1
- package/dist/api/resources/notifications/types/Notification.d.ts +1 -0
- package/dist/api/resources/profiles/client/Client.d.ts +7 -1
- package/dist/api/resources/profiles/client/Client.js +14 -8
- package/dist/api/resources/profiles/types/Pagerduty.d.ts +9 -0
- package/dist/api/resources/profiles/types/Pagerduty.js +5 -0
- package/dist/api/resources/profiles/types/UserProfile.d.ts +1 -1
- package/dist/api/resources/profiles/types/UserProfileFirebaseToken.d.ts +4 -0
- package/dist/api/resources/profiles/types/UserProfileFirebaseToken.js +5 -0
- package/dist/api/resources/profiles/types/WebhookAuthMode.d.ts +9 -0
- package/dist/api/resources/profiles/types/WebhookAuthMode.js +11 -0
- package/dist/api/resources/profiles/types/WebhookAuthentication.d.ts +14 -0
- package/dist/api/resources/profiles/types/WebhookAuthentication.js +5 -0
- package/dist/api/resources/profiles/types/WebhookMethod.d.ts +8 -0
- package/dist/api/resources/profiles/types/WebhookMethod.js +10 -0
- package/dist/api/resources/profiles/types/WebhookProfile.d.ts +16 -0
- package/dist/api/resources/profiles/types/WebhookProfile.js +5 -0
- package/dist/api/resources/profiles/types/WebhookProfileType.d.ts +8 -0
- package/dist/api/resources/profiles/types/WebhookProfileType.js +10 -0
- package/dist/api/resources/profiles/types/index.d.ts +7 -0
- package/dist/api/resources/profiles/types/index.js +7 -0
- package/dist/api/resources/send/types/BaseMessage.d.ts +1 -0
- package/dist/api/resources/send/types/Channel.d.ts +1 -1
- package/dist/api/resources/send/types/MessagePreferences.d.ts +7 -0
- package/dist/api/resources/send/types/MessagePreferences.js +5 -0
- package/dist/api/resources/send/types/PagerdutyRecipient.d.ts +7 -0
- package/dist/api/resources/send/types/PagerdutyRecipient.js +5 -0
- package/dist/api/resources/send/types/Recipient.d.ts +1 -1
- package/dist/api/resources/send/types/WebhookRecipient.d.ts +7 -0
- package/dist/api/resources/send/types/WebhookRecipient.js +5 -0
- package/dist/api/resources/send/types/index.d.ts +3 -2
- package/dist/api/resources/send/types/index.js +3 -2
- package/dist/api/resources/templates/client/Client.js +1 -1
- package/dist/api/resources/tenants/client/Client.d.ts +6 -1
- package/dist/api/resources/tenants/client/Client.js +13 -8
- package/dist/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +6 -1
- package/dist/api/resources/translations/client/Client.js +2 -2
- package/dist/api/resources/users/resources/preferences/client/Client.d.ts +10 -4
- package/dist/api/resources/users/resources/preferences/client/Client.js +43 -8
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts +15 -0
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.js +5 -0
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.d.ts +15 -0
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.js +5 -0
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +4 -0
- package/dist/api/resources/users/resources/preferences/client/requests/index.d.ts +2 -0
- package/dist/api/resources/users/resources/tenants/client/Client.js +5 -5
- package/dist/api/resources/users/resources/tokens/client/Client.d.ts +5 -1
- package/dist/api/resources/users/resources/tokens/client/Client.js +11 -7
- package/package.json +1 -1
- package/api/resources/send/types/MessageChannelEmailOverride.d.ts +0 -16
- package/api/resources/send/types/Override.d.ts +0 -8
- package/api/resources/send/types/Override.js +0 -10
- package/dist/api/resources/send/types/MessageChannelEmailOverride.d.ts +0 -16
- package/dist/api/resources/send/types/Override.d.ts +0 -8
- package/dist/api/resources/send/types/Override.js +0 -10
- /package/api/resources/{send/types/MessageChannelEmailOverride.js → profiles/types/Pagerduty.js} +0 -0
- /package/{dist/api/resources/send/types/MessageChannelEmailOverride.js → api/resources/profiles/types/UserProfileFirebaseToken.js} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Courier from "../../../index";
|
|
5
|
+
export interface WebhookAuthentication {
|
|
6
|
+
/** The authentication mode to use. Defaults to 'none' if not specified. */
|
|
7
|
+
mode: Courier.WebhookAuthMode;
|
|
8
|
+
/** Username for basic authentication. */
|
|
9
|
+
username?: string;
|
|
10
|
+
/** Password for basic authentication. */
|
|
11
|
+
password?: string;
|
|
12
|
+
/** Token for bearer authentication. */
|
|
13
|
+
token?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Courier from "../../../index";
|
|
5
|
+
export interface WebhookProfile {
|
|
6
|
+
/** The URL to send the webhook request to. */
|
|
7
|
+
url: string;
|
|
8
|
+
/** The HTTP method to use for the webhook request. Defaults to POST if not specified. */
|
|
9
|
+
method?: Courier.WebhookMethod;
|
|
10
|
+
/** Custom headers to include in the webhook request. */
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
/** Authentication configuration for the webhook request. */
|
|
13
|
+
authentication?: Courier.WebhookAuthentication;
|
|
14
|
+
/** Specifies what profile information is included in the request payload. Defaults to 'limited' if not specified. */
|
|
15
|
+
profile?: Courier.WebhookProfileType;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WebhookProfileType = void 0;
|
|
7
|
+
exports.WebhookProfileType = {
|
|
8
|
+
Limited: "limited",
|
|
9
|
+
Expanded: "expanded",
|
|
10
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./Address";
|
|
2
2
|
export * from "./UserProfile";
|
|
3
|
+
export * from "./UserProfileFirebaseToken";
|
|
3
4
|
export * from "./AirshipProfile";
|
|
4
5
|
export * from "./AirshipProfileAudience";
|
|
5
6
|
export * from "./DeviceType";
|
|
@@ -14,6 +15,7 @@ export * from "./MultipleTokens";
|
|
|
14
15
|
export * from "./Intercom";
|
|
15
16
|
export * from "./IntercomRecipient";
|
|
16
17
|
export * from "./Slack";
|
|
18
|
+
export * from "./Pagerduty";
|
|
17
19
|
export * from "./SlackBaseProperties";
|
|
18
20
|
export * from "./SendToSlackChannel";
|
|
19
21
|
export * from "./SendToSlackEmail";
|
|
@@ -35,3 +37,8 @@ export * from "./SubscribeToListsResponse";
|
|
|
35
37
|
export * from "./DeleteListSubscriptionResponse";
|
|
36
38
|
export * from "./GetListSubscriptionsList";
|
|
37
39
|
export * from "./GetListSubscriptionsResponse";
|
|
40
|
+
export * from "./WebhookProfile";
|
|
41
|
+
export * from "./WebhookMethod";
|
|
42
|
+
export * from "./WebhookAuthentication";
|
|
43
|
+
export * from "./WebhookAuthMode";
|
|
44
|
+
export * from "./WebhookProfileType";
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Address"), exports);
|
|
18
18
|
__exportStar(require("./UserProfile"), exports);
|
|
19
|
+
__exportStar(require("./UserProfileFirebaseToken"), exports);
|
|
19
20
|
__exportStar(require("./AirshipProfile"), exports);
|
|
20
21
|
__exportStar(require("./AirshipProfileAudience"), exports);
|
|
21
22
|
__exportStar(require("./DeviceType"), exports);
|
|
@@ -30,6 +31,7 @@ __exportStar(require("./MultipleTokens"), exports);
|
|
|
30
31
|
__exportStar(require("./Intercom"), exports);
|
|
31
32
|
__exportStar(require("./IntercomRecipient"), exports);
|
|
32
33
|
__exportStar(require("./Slack"), exports);
|
|
34
|
+
__exportStar(require("./Pagerduty"), exports);
|
|
33
35
|
__exportStar(require("./SlackBaseProperties"), exports);
|
|
34
36
|
__exportStar(require("./SendToSlackChannel"), exports);
|
|
35
37
|
__exportStar(require("./SendToSlackEmail"), exports);
|
|
@@ -51,3 +53,8 @@ __exportStar(require("./SubscribeToListsResponse"), exports);
|
|
|
51
53
|
__exportStar(require("./DeleteListSubscriptionResponse"), exports);
|
|
52
54
|
__exportStar(require("./GetListSubscriptionsList"), exports);
|
|
53
55
|
__exportStar(require("./GetListSubscriptionsResponse"), exports);
|
|
56
|
+
__exportStar(require("./WebhookProfile"), exports);
|
|
57
|
+
__exportStar(require("./WebhookMethod"), exports);
|
|
58
|
+
__exportStar(require("./WebhookAuthentication"), exports);
|
|
59
|
+
__exportStar(require("./WebhookAuthMode"), exports);
|
|
60
|
+
__exportStar(require("./WebhookProfileType"), exports);
|
|
@@ -15,6 +15,7 @@ export interface BaseMessage {
|
|
|
15
15
|
context?: Courier.MessageContext;
|
|
16
16
|
/** Metadata such as utm tracking attached with the notification through this channel. */
|
|
17
17
|
metadata?: Courier.MessageMetadata;
|
|
18
|
+
preferences?: Courier.MessagePreferences;
|
|
18
19
|
/** An object whose keys are valid provider identifiers which map to an object. */
|
|
19
20
|
providers?: Courier.MessageProviders;
|
|
20
21
|
routing?: Courier.Routing;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface MessagePreferences {
|
|
5
|
+
/** The ID of the subscription topic you want to apply to the message. If this is a templated message, it will override the subscription topic if already associated */
|
|
6
|
+
subscription_topic_id: string;
|
|
7
|
+
}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Courier from "../../../index";
|
|
5
|
-
export declare type Recipient = Courier.AudienceRecipient | Courier.ListRecipient | Courier.ListPatternRecipient | Courier.UserRecipient | Courier.SlackRecipient | Courier.MsTeamsRecipient | Courier.RecipientData;
|
|
5
|
+
export declare type Recipient = Courier.AudienceRecipient | Courier.ListRecipient | Courier.ListPatternRecipient | Courier.UserRecipient | Courier.SlackRecipient | Courier.MsTeamsRecipient | Courier.RecipientData | Courier.PagerdutyRecipient | Courier.WebhookRecipient;
|
|
@@ -5,6 +5,8 @@ export * from "./BaseMessageSendTo";
|
|
|
5
5
|
export * from "./BaseMessage";
|
|
6
6
|
export * from "./MessageRecipient";
|
|
7
7
|
export * from "./Recipient";
|
|
8
|
+
export * from "./WebhookRecipient";
|
|
9
|
+
export * from "./PagerdutyRecipient";
|
|
8
10
|
export * from "./SlackRecipient";
|
|
9
11
|
export * from "./MsTeamsRecipient";
|
|
10
12
|
export * from "./AudienceRecipient";
|
|
@@ -33,8 +35,6 @@ export * from "./Timeout";
|
|
|
33
35
|
export * from "./Criteria";
|
|
34
36
|
export * from "./RoutingMethod";
|
|
35
37
|
export * from "./Timeouts";
|
|
36
|
-
export * from "./Override";
|
|
37
|
-
export * from "./MessageChannelEmailOverride";
|
|
38
38
|
export * from "./Attachment";
|
|
39
39
|
export * from "./MessageMetadata";
|
|
40
40
|
export * from "./Utm";
|
|
@@ -80,6 +80,7 @@ export * from "./Preferences";
|
|
|
80
80
|
export * from "./RoutingStrategyProvider";
|
|
81
81
|
export * from "./Metadata";
|
|
82
82
|
export * from "./RoutingStrategyChannel";
|
|
83
|
+
export * from "./MessagePreferences";
|
|
83
84
|
export * from "./MessageProviders";
|
|
84
85
|
export * from "./MessageProvidersType";
|
|
85
86
|
export * from "./RoutingChannel";
|
|
@@ -21,6 +21,8 @@ __exportStar(require("./BaseMessageSendTo"), exports);
|
|
|
21
21
|
__exportStar(require("./BaseMessage"), exports);
|
|
22
22
|
__exportStar(require("./MessageRecipient"), exports);
|
|
23
23
|
__exportStar(require("./Recipient"), exports);
|
|
24
|
+
__exportStar(require("./WebhookRecipient"), exports);
|
|
25
|
+
__exportStar(require("./PagerdutyRecipient"), exports);
|
|
24
26
|
__exportStar(require("./SlackRecipient"), exports);
|
|
25
27
|
__exportStar(require("./MsTeamsRecipient"), exports);
|
|
26
28
|
__exportStar(require("./AudienceRecipient"), exports);
|
|
@@ -49,8 +51,6 @@ __exportStar(require("./Timeout"), exports);
|
|
|
49
51
|
__exportStar(require("./Criteria"), exports);
|
|
50
52
|
__exportStar(require("./RoutingMethod"), exports);
|
|
51
53
|
__exportStar(require("./Timeouts"), exports);
|
|
52
|
-
__exportStar(require("./Override"), exports);
|
|
53
|
-
__exportStar(require("./MessageChannelEmailOverride"), exports);
|
|
54
54
|
__exportStar(require("./Attachment"), exports);
|
|
55
55
|
__exportStar(require("./MessageMetadata"), exports);
|
|
56
56
|
__exportStar(require("./Utm"), exports);
|
|
@@ -96,6 +96,7 @@ __exportStar(require("./Preferences"), exports);
|
|
|
96
96
|
__exportStar(require("./RoutingStrategyProvider"), exports);
|
|
97
97
|
__exportStar(require("./Metadata"), exports);
|
|
98
98
|
__exportStar(require("./RoutingStrategyChannel"), exports);
|
|
99
|
+
__exportStar(require("./MessagePreferences"), exports);
|
|
99
100
|
__exportStar(require("./MessageProviders"), exports);
|
|
100
101
|
__exportStar(require("./MessageProvidersType"), exports);
|
|
101
102
|
__exportStar(require("./RoutingChannel"), exports);
|
|
@@ -73,7 +73,7 @@ class Templates {
|
|
|
73
73
|
Authorization: yield this._getAuthorizationHeader(),
|
|
74
74
|
"X-Fern-Language": "JavaScript",
|
|
75
75
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
76
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
76
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
77
77
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
78
78
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
79
79
|
},
|
|
@@ -30,7 +30,12 @@ export declare class Tenants {
|
|
|
30
30
|
* name: "string",
|
|
31
31
|
* parent_tenant_id: "string",
|
|
32
32
|
* default_preferences: {
|
|
33
|
-
* items: [{
|
|
33
|
+
* items: [{
|
|
34
|
+
* id: "string",
|
|
35
|
+
* status: Courier.SubscriptionTopicStatus.OptedOut,
|
|
36
|
+
* has_custom_routing: undefined,
|
|
37
|
+
* custom_routing: undefined
|
|
38
|
+
* }]
|
|
34
39
|
* },
|
|
35
40
|
* properties: {
|
|
36
41
|
* "string": {
|
|
@@ -60,7 +60,12 @@ class Tenants {
|
|
|
60
60
|
* name: "string",
|
|
61
61
|
* parent_tenant_id: "string",
|
|
62
62
|
* default_preferences: {
|
|
63
|
-
* items: [{
|
|
63
|
+
* items: [{
|
|
64
|
+
* id: "string",
|
|
65
|
+
* status: Courier.SubscriptionTopicStatus.OptedOut,
|
|
66
|
+
* has_custom_routing: undefined,
|
|
67
|
+
* custom_routing: undefined
|
|
68
|
+
* }]
|
|
64
69
|
* },
|
|
65
70
|
* properties: {
|
|
66
71
|
* "string": {
|
|
@@ -85,7 +90,7 @@ class Tenants {
|
|
|
85
90
|
Authorization: yield this._getAuthorizationHeader(),
|
|
86
91
|
"X-Fern-Language": "JavaScript",
|
|
87
92
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
88
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
93
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
89
94
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
90
95
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
91
96
|
},
|
|
@@ -142,7 +147,7 @@ class Tenants {
|
|
|
142
147
|
Authorization: yield this._getAuthorizationHeader(),
|
|
143
148
|
"X-Fern-Language": "JavaScript",
|
|
144
149
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
145
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
150
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
146
151
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
147
152
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
148
153
|
},
|
|
@@ -211,7 +216,7 @@ class Tenants {
|
|
|
211
216
|
Authorization: yield this._getAuthorizationHeader(),
|
|
212
217
|
"X-Fern-Language": "JavaScript",
|
|
213
218
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
214
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
219
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
215
220
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
216
221
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
217
222
|
},
|
|
@@ -261,7 +266,7 @@ class Tenants {
|
|
|
261
266
|
Authorization: yield this._getAuthorizationHeader(),
|
|
262
267
|
"X-Fern-Language": "JavaScript",
|
|
263
268
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
264
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
269
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
265
270
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
266
271
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
267
272
|
},
|
|
@@ -324,7 +329,7 @@ class Tenants {
|
|
|
324
329
|
Authorization: yield this._getAuthorizationHeader(),
|
|
325
330
|
"X-Fern-Language": "JavaScript",
|
|
326
331
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
327
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
332
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
328
333
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
329
334
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
330
335
|
},
|
|
@@ -385,7 +390,7 @@ class Tenants {
|
|
|
385
390
|
Authorization: yield this._getAuthorizationHeader(),
|
|
386
391
|
"X-Fern-Language": "JavaScript",
|
|
387
392
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
388
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
393
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
389
394
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
390
395
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
391
396
|
},
|
|
@@ -436,7 +441,7 @@ class Tenants {
|
|
|
436
441
|
Authorization: yield this._getAuthorizationHeader(),
|
|
437
442
|
"X-Fern-Language": "JavaScript",
|
|
438
443
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
439
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
444
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
440
445
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
441
446
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
442
447
|
},
|
|
@@ -8,7 +8,12 @@ import * as Courier from "../../../../index";
|
|
|
8
8
|
* name: "string",
|
|
9
9
|
* parent_tenant_id: "string",
|
|
10
10
|
* default_preferences: {
|
|
11
|
-
* items: [{
|
|
11
|
+
* items: [{
|
|
12
|
+
* id: "string",
|
|
13
|
+
* status: Courier.SubscriptionTopicStatus.OptedOut,
|
|
14
|
+
* has_custom_routing: undefined,
|
|
15
|
+
* custom_routing: undefined
|
|
16
|
+
* }]
|
|
12
17
|
* },
|
|
13
18
|
* properties: {
|
|
14
19
|
* "string": {
|
|
@@ -70,7 +70,7 @@ class Translations {
|
|
|
70
70
|
Authorization: yield this._getAuthorizationHeader(),
|
|
71
71
|
"X-Fern-Language": "JavaScript",
|
|
72
72
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
73
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
73
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
74
74
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
75
75
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
76
76
|
},
|
|
@@ -130,7 +130,7 @@ class Translations {
|
|
|
130
130
|
Authorization: yield this._getAuthorizationHeader(),
|
|
131
131
|
"X-Fern-Language": "JavaScript",
|
|
132
132
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
133
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
133
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
134
134
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
135
135
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
136
136
|
},
|
|
@@ -22,27 +22,33 @@ export declare class Preferences {
|
|
|
22
22
|
* Fetch all user preferences.
|
|
23
23
|
*
|
|
24
24
|
* @param {string} userId - A unique identifier associated with the user whose preferences you wish to retrieve.
|
|
25
|
+
* @param {Courier.users.UserPreferencesParams} request
|
|
25
26
|
* @param {Preferences.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
27
|
*
|
|
27
28
|
* @throws {@link Courier.BadRequestError}
|
|
28
29
|
*
|
|
29
30
|
* @example
|
|
30
|
-
* await courier.users.preferences.list("string"
|
|
31
|
+
* await courier.users.preferences.list("string", {
|
|
32
|
+
* tenant_id: "string"
|
|
33
|
+
* })
|
|
31
34
|
*/
|
|
32
|
-
list(userId: string, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesListResponse>;
|
|
35
|
+
list(userId: string, request?: Courier.users.UserPreferencesParams, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesListResponse>;
|
|
33
36
|
/**
|
|
34
37
|
* Fetch user preferences for a specific subscription topic.
|
|
35
38
|
*
|
|
36
39
|
* @param {string} userId - A unique identifier associated with the user whose preferences you wish to retrieve.
|
|
37
40
|
* @param {string} topicId - A unique identifier associated with a subscription topic.
|
|
41
|
+
* @param {Courier.users.UserPreferencesTopicParams} request
|
|
38
42
|
* @param {Preferences.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
43
|
*
|
|
40
44
|
* @throws {@link Courier.NotFoundError}
|
|
41
45
|
*
|
|
42
46
|
* @example
|
|
43
|
-
* await courier.users.preferences.get("string", "string"
|
|
47
|
+
* await courier.users.preferences.get("string", "string", {
|
|
48
|
+
* tenant_id: "string"
|
|
49
|
+
* })
|
|
44
50
|
*/
|
|
45
|
-
get(userId: string, topicId: string, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesGetResponse>;
|
|
51
|
+
get(userId: string, topicId: string, request?: Courier.users.UserPreferencesTopicParams, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesGetResponse>;
|
|
46
52
|
/**
|
|
47
53
|
* Update or Create user preferences for a specific subscription topic.
|
|
48
54
|
*
|
|
@@ -34,6 +34,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
34
34
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
38
|
+
var t = {};
|
|
39
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
40
|
+
t[p] = s[p];
|
|
41
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
42
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
43
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
44
|
+
t[p[i]] = s[p[i]];
|
|
45
|
+
}
|
|
46
|
+
return t;
|
|
47
|
+
};
|
|
37
48
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
49
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
50
|
};
|
|
@@ -52,16 +63,24 @@ class Preferences {
|
|
|
52
63
|
* Fetch all user preferences.
|
|
53
64
|
*
|
|
54
65
|
* @param {string} userId - A unique identifier associated with the user whose preferences you wish to retrieve.
|
|
66
|
+
* @param {Courier.users.UserPreferencesParams} request
|
|
55
67
|
* @param {Preferences.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
68
|
*
|
|
57
69
|
* @throws {@link Courier.BadRequestError}
|
|
58
70
|
*
|
|
59
71
|
* @example
|
|
60
|
-
* await courier.users.preferences.list("string"
|
|
72
|
+
* await courier.users.preferences.list("string", {
|
|
73
|
+
* tenant_id: "string"
|
|
74
|
+
* })
|
|
61
75
|
*/
|
|
62
|
-
list(userId, requestOptions) {
|
|
76
|
+
list(userId, request = {}, requestOptions) {
|
|
63
77
|
var _a, _b;
|
|
64
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const { tenant_id: tenantId } = request;
|
|
80
|
+
const _queryParams = {};
|
|
81
|
+
if (tenantId != null) {
|
|
82
|
+
_queryParams["tenant_id"] = tenantId;
|
|
83
|
+
}
|
|
65
84
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
66
85
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/preferences`),
|
|
67
86
|
method: "GET",
|
|
@@ -69,11 +88,12 @@ class Preferences {
|
|
|
69
88
|
Authorization: yield this._getAuthorizationHeader(),
|
|
70
89
|
"X-Fern-Language": "JavaScript",
|
|
71
90
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
72
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
91
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
73
92
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
74
93
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
75
94
|
},
|
|
76
95
|
contentType: "application/json",
|
|
96
|
+
queryParameters: _queryParams,
|
|
77
97
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
78
98
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
79
99
|
});
|
|
@@ -111,16 +131,24 @@ class Preferences {
|
|
|
111
131
|
*
|
|
112
132
|
* @param {string} userId - A unique identifier associated with the user whose preferences you wish to retrieve.
|
|
113
133
|
* @param {string} topicId - A unique identifier associated with a subscription topic.
|
|
134
|
+
* @param {Courier.users.UserPreferencesTopicParams} request
|
|
114
135
|
* @param {Preferences.RequestOptions} requestOptions - Request-specific configuration.
|
|
115
136
|
*
|
|
116
137
|
* @throws {@link Courier.NotFoundError}
|
|
117
138
|
*
|
|
118
139
|
* @example
|
|
119
|
-
* await courier.users.preferences.get("string", "string"
|
|
140
|
+
* await courier.users.preferences.get("string", "string", {
|
|
141
|
+
* tenant_id: "string"
|
|
142
|
+
* })
|
|
120
143
|
*/
|
|
121
|
-
get(userId, topicId, requestOptions) {
|
|
144
|
+
get(userId, topicId, request = {}, requestOptions) {
|
|
122
145
|
var _a, _b;
|
|
123
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const { tenant_id: tenantId } = request;
|
|
148
|
+
const _queryParams = {};
|
|
149
|
+
if (tenantId != null) {
|
|
150
|
+
_queryParams["tenant_id"] = tenantId;
|
|
151
|
+
}
|
|
124
152
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
125
153
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/preferences/${encodeURIComponent(topicId)}`),
|
|
126
154
|
method: "GET",
|
|
@@ -128,11 +156,12 @@ class Preferences {
|
|
|
128
156
|
Authorization: yield this._getAuthorizationHeader(),
|
|
129
157
|
"X-Fern-Language": "JavaScript",
|
|
130
158
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
131
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
159
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
132
160
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
133
161
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
134
162
|
},
|
|
135
163
|
contentType: "application/json",
|
|
164
|
+
queryParameters: _queryParams,
|
|
136
165
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
137
166
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
138
167
|
});
|
|
@@ -187,6 +216,11 @@ class Preferences {
|
|
|
187
216
|
update(userId, topicId, request, requestOptions) {
|
|
188
217
|
var _a, _b;
|
|
189
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
const { tenant_id: tenantId } = request, _body = __rest(request, ["tenant_id"]);
|
|
220
|
+
const _queryParams = {};
|
|
221
|
+
if (tenantId != null) {
|
|
222
|
+
_queryParams["tenant_id"] = tenantId;
|
|
223
|
+
}
|
|
190
224
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
191
225
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/preferences/${encodeURIComponent(topicId)}`),
|
|
192
226
|
method: "PUT",
|
|
@@ -194,12 +228,13 @@ class Preferences {
|
|
|
194
228
|
Authorization: yield this._getAuthorizationHeader(),
|
|
195
229
|
"X-Fern-Language": "JavaScript",
|
|
196
230
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
197
|
-
"X-Fern-SDK-Version": "v6.2.
|
|
231
|
+
"X-Fern-SDK-Version": "v6.2.3",
|
|
198
232
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
199
233
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
200
234
|
},
|
|
201
235
|
contentType: "application/json",
|
|
202
|
-
|
|
236
|
+
queryParameters: _queryParams,
|
|
237
|
+
body: _body,
|
|
203
238
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
204
239
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
205
240
|
});
|
package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* tenant_id: "string"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface UserPreferencesParams {
|
|
11
|
+
/**
|
|
12
|
+
* Query the preferences of a user for this specific tenant context.
|
|
13
|
+
*/
|
|
14
|
+
tenant_id?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* tenant_id: "string"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface UserPreferencesTopicParams {
|
|
11
|
+
/**
|
|
12
|
+
* Query the preferences of a user for this specific tenant context.
|
|
13
|
+
*/
|
|
14
|
+
tenant_id?: string;
|
|
15
|
+
}
|
|
@@ -13,5 +13,9 @@ import * as Courier from "../../../../../../index";
|
|
|
13
13
|
* }
|
|
14
14
|
*/
|
|
15
15
|
export interface UserPreferencesUpdateParams {
|
|
16
|
+
/**
|
|
17
|
+
* Update the preferences of a user for this specific tenant context.
|
|
18
|
+
*/
|
|
19
|
+
tenant_id?: string;
|
|
16
20
|
topic: Courier.users.TopicPreferenceUpdate;
|
|
17
21
|
}
|