@trycourier/courier 7.11.0 → 7.19.1
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/CHANGELOG.md +114 -0
- package/README.md +1 -0
- package/client.d.mts +10 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +10 -4
- package/client.d.ts.map +1 -1
- package/client.js +15 -1
- package/client.js.map +1 -1
- package/client.mjs +15 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/audiences.d.mts +5 -2
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +5 -2
- package/resources/audiences.d.ts.map +1 -1
- package/resources/brands.d.mts +35 -2
- package/resources/brands.d.mts.map +1 -1
- package/resources/brands.d.ts +35 -2
- package/resources/brands.d.ts.map +1 -1
- package/resources/brands.js +34 -1
- package/resources/brands.js.map +1 -1
- package/resources/brands.mjs +34 -1
- package/resources/brands.mjs.map +1 -1
- package/resources/digests/digests.d.mts +94 -0
- package/resources/digests/digests.d.mts.map +1 -0
- package/resources/digests/digests.d.ts +94 -0
- package/resources/digests/digests.d.ts.map +1 -0
- package/resources/digests/digests.js +17 -0
- package/resources/digests/digests.js.map +1 -0
- package/resources/digests/digests.mjs +12 -0
- package/resources/digests/digests.mjs.map +1 -0
- package/resources/digests/index.d.mts +3 -0
- package/resources/digests/index.d.mts.map +1 -0
- package/resources/digests/index.d.ts +3 -0
- package/resources/digests/index.d.ts.map +1 -0
- package/resources/digests/index.js +9 -0
- package/resources/digests/index.js.map +1 -0
- package/resources/digests/index.mjs +4 -0
- package/resources/digests/index.mjs.map +1 -0
- package/resources/digests/schedules.d.mts +32 -0
- package/resources/digests/schedules.d.mts.map +1 -0
- package/resources/digests/schedules.d.ts +32 -0
- package/resources/digests/schedules.d.ts.map +1 -0
- package/resources/digests/schedules.js +29 -0
- package/resources/digests/schedules.js.map +1 -0
- package/resources/digests/schedules.mjs +25 -0
- package/resources/digests/schedules.mjs.map +1 -0
- package/resources/digests.d.mts +2 -0
- package/resources/digests.d.mts.map +1 -0
- package/resources/digests.d.ts +2 -0
- package/resources/digests.d.ts.map +1 -0
- package/resources/digests.js +6 -0
- package/resources/digests.js.map +1 -0
- package/resources/digests.mjs +3 -0
- package/resources/digests.mjs.map +1 -0
- package/resources/index.d.mts +4 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/journeys/index.d.mts +2 -2
- package/resources/journeys/index.d.mts.map +1 -1
- package/resources/journeys/index.d.ts +2 -2
- package/resources/journeys/index.d.ts.map +1 -1
- package/resources/journeys/index.js.map +1 -1
- package/resources/journeys/index.mjs.map +1 -1
- package/resources/journeys/journeys.d.mts +198 -7
- package/resources/journeys/journeys.d.mts.map +1 -1
- package/resources/journeys/journeys.d.ts +198 -7
- package/resources/journeys/journeys.d.ts.map +1 -1
- package/resources/journeys/journeys.js +18 -0
- package/resources/journeys/journeys.js.map +1 -1
- package/resources/journeys/journeys.mjs +18 -0
- package/resources/journeys/journeys.mjs.map +1 -1
- package/resources/journeys/templates.d.mts +120 -1
- package/resources/journeys/templates.d.mts.map +1 -1
- package/resources/journeys/templates.d.ts +120 -1
- package/resources/journeys/templates.d.ts.map +1 -1
- package/resources/journeys/templates.js +71 -0
- package/resources/journeys/templates.js.map +1 -1
- package/resources/journeys/templates.mjs +71 -0
- package/resources/journeys/templates.mjs.map +1 -1
- package/resources/messages.d.mts +16 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +16 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +10 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +10 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/notifications/checks.d.mts +3 -3
- package/resources/notifications/checks.d.ts +3 -3
- package/resources/notifications/checks.js +3 -3
- package/resources/notifications/checks.mjs +3 -3
- package/resources/shared.d.mts +6 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +6 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/users/index.d.mts +1 -1
- package/resources/users/index.d.mts.map +1 -1
- package/resources/users/index.d.ts +1 -1
- package/resources/users/index.d.ts.map +1 -1
- package/resources/users/index.js.map +1 -1
- package/resources/users/index.mjs.map +1 -1
- package/resources/users/preferences.d.mts +211 -1
- package/resources/users/preferences.d.mts.map +1 -1
- package/resources/users/preferences.d.ts +211 -1
- package/resources/users/preferences.d.ts.map +1 -1
- package/resources/users/preferences.js +105 -0
- package/resources/users/preferences.js.map +1 -1
- package/resources/users/preferences.mjs +105 -0
- package/resources/users/preferences.mjs.map +1 -1
- package/resources/users/users.d.mts +2 -2
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts +2 -2
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.js.map +1 -1
- package/resources/users/users.mjs.map +1 -1
- package/resources/workspace-preferences/index.d.mts +3 -0
- package/resources/workspace-preferences/index.d.mts.map +1 -0
- package/resources/workspace-preferences/index.d.ts +3 -0
- package/resources/workspace-preferences/index.d.ts.map +1 -0
- package/resources/workspace-preferences/index.js +9 -0
- package/resources/workspace-preferences/index.js.map +1 -0
- package/resources/workspace-preferences/index.mjs +4 -0
- package/resources/workspace-preferences/index.mjs.map +1 -0
- package/resources/workspace-preferences/topics.d.mts +168 -0
- package/resources/workspace-preferences/topics.d.mts.map +1 -0
- package/resources/workspace-preferences/topics.d.ts +168 -0
- package/resources/workspace-preferences/topics.d.ts.map +1 -0
- package/resources/workspace-preferences/topics.js +103 -0
- package/resources/workspace-preferences/topics.js.map +1 -0
- package/resources/workspace-preferences/topics.mjs +99 -0
- package/resources/workspace-preferences/topics.mjs.map +1 -0
- package/resources/workspace-preferences/workspace-preferences.d.mts +410 -0
- package/resources/workspace-preferences/workspace-preferences.d.mts.map +1 -0
- package/resources/workspace-preferences/workspace-preferences.d.ts +410 -0
- package/resources/workspace-preferences/workspace-preferences.d.ts.map +1 -0
- package/resources/workspace-preferences/workspace-preferences.js +104 -0
- package/resources/workspace-preferences/workspace-preferences.js.map +1 -0
- package/resources/workspace-preferences/workspace-preferences.mjs +99 -0
- package/resources/workspace-preferences/workspace-preferences.mjs.map +1 -0
- package/resources/workspace-preferences.d.mts +2 -0
- package/resources/workspace-preferences.d.mts.map +1 -0
- package/resources/workspace-preferences.d.ts +2 -0
- package/resources/workspace-preferences.d.ts.map +1 -0
- package/resources/workspace-preferences.js +6 -0
- package/resources/workspace-preferences.js.map +1 -0
- package/resources/workspace-preferences.mjs +3 -0
- package/resources/workspace-preferences.mjs.map +1 -0
- package/src/client.ts +71 -1
- package/src/resources/audiences.ts +5 -2
- package/src/resources/brands.ts +36 -3
- package/src/resources/digests/digests.ts +120 -0
- package/src/resources/digests/index.ts +9 -0
- package/src/resources/digests/schedules.ts +51 -0
- package/src/resources/digests.ts +3 -0
- package/src/resources/index.ts +28 -0
- package/src/resources/journeys/index.ts +8 -0
- package/src/resources/journeys/journeys.ts +246 -4
- package/src/resources/journeys/templates.ts +168 -0
- package/src/resources/messages.ts +20 -0
- package/src/resources/notifications/checks.ts +3 -3
- package/src/resources/shared.ts +7 -0
- package/src/resources/users/index.ts +6 -0
- package/src/resources/users/preferences.ts +269 -0
- package/src/resources/users/users.ts +12 -0
- package/src/resources/workspace-preferences/index.ts +25 -0
- package/src/resources/workspace-preferences/topics.ts +229 -0
- package/src/resources/workspace-preferences/workspace-preferences.ts +534 -0
- package/src/resources/workspace-preferences.ts +3 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/client.ts
CHANGED
|
@@ -74,6 +74,7 @@ import {
|
|
|
74
74
|
MessageHistoryResponse,
|
|
75
75
|
MessageListParams,
|
|
76
76
|
MessageListResponse,
|
|
77
|
+
MessageResendResponse,
|
|
77
78
|
MessageRetrieveResponse,
|
|
78
79
|
Messages,
|
|
79
80
|
} from './resources/messages';
|
|
@@ -106,10 +107,19 @@ import {
|
|
|
106
107
|
Automations,
|
|
107
108
|
} from './resources/automations/automations';
|
|
108
109
|
import {
|
|
110
|
+
DigestCategory,
|
|
111
|
+
DigestInstance,
|
|
112
|
+
DigestInstanceListResponse,
|
|
113
|
+
Digests,
|
|
114
|
+
} from './resources/digests/digests';
|
|
115
|
+
import {
|
|
116
|
+
CancelJourneyRequest,
|
|
117
|
+
CancelJourneyResponse,
|
|
109
118
|
CreateJourneyRequest,
|
|
110
119
|
Journey,
|
|
111
120
|
JourneyAINode,
|
|
112
121
|
JourneyAPIInvokeTriggerNode,
|
|
122
|
+
JourneyCancelParams,
|
|
113
123
|
JourneyConditionAtom,
|
|
114
124
|
JourneyConditionGroup,
|
|
115
125
|
JourneyConditionNestedGroup,
|
|
@@ -118,6 +128,8 @@ import {
|
|
|
118
128
|
JourneyDelayDurationNode,
|
|
119
129
|
JourneyDelayUntilNode,
|
|
120
130
|
JourneyExitNode,
|
|
131
|
+
JourneyExperiment,
|
|
132
|
+
JourneyExperimentVariant,
|
|
121
133
|
JourneyFetchGetDeleteNode,
|
|
122
134
|
JourneyFetchPostPutNode,
|
|
123
135
|
JourneyInvokeParams,
|
|
@@ -227,6 +239,22 @@ import {
|
|
|
227
239
|
Tenants,
|
|
228
240
|
} from './resources/tenants/tenants';
|
|
229
241
|
import { Users } from './resources/users/users';
|
|
242
|
+
import {
|
|
243
|
+
PublishPreferencesRequest,
|
|
244
|
+
PublishPreferencesResponse,
|
|
245
|
+
WorkspacePreferenceCreateParams,
|
|
246
|
+
WorkspacePreferenceCreateRequest,
|
|
247
|
+
WorkspacePreferenceGetResponse,
|
|
248
|
+
WorkspacePreferenceListResponse,
|
|
249
|
+
WorkspacePreferencePublishParams,
|
|
250
|
+
WorkspacePreferenceReplaceParams,
|
|
251
|
+
WorkspacePreferenceReplaceRequest,
|
|
252
|
+
WorkspacePreferenceTopicCreateRequest,
|
|
253
|
+
WorkspacePreferenceTopicGetResponse,
|
|
254
|
+
WorkspacePreferenceTopicListResponse,
|
|
255
|
+
WorkspacePreferenceTopicReplaceRequest,
|
|
256
|
+
WorkspacePreferences,
|
|
257
|
+
} from './resources/workspace-preferences/workspace-preferences';
|
|
230
258
|
import { type Fetch } from './internal/builtin-types';
|
|
231
259
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
232
260
|
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
@@ -872,11 +900,19 @@ export class Courier {
|
|
|
872
900
|
return () => controller.abort();
|
|
873
901
|
}
|
|
874
902
|
|
|
875
|
-
private buildBody({ options
|
|
903
|
+
private buildBody({ options }: { options: FinalRequestOptions }): {
|
|
876
904
|
bodyHeaders: HeadersLike;
|
|
877
905
|
body: BodyInit | undefined;
|
|
878
906
|
} {
|
|
907
|
+
const { body, headers: rawHeaders } = options;
|
|
879
908
|
if (!body) {
|
|
909
|
+
// A resource method always passes a `body` key when its operation defines a
|
|
910
|
+
// request body, even if the caller omitted an optional body param. Keep the
|
|
911
|
+
// content-type for those, and only elide it for operations with no body at
|
|
912
|
+
// all (e.g. GET/DELETE).
|
|
913
|
+
if (body == null && 'body' in options) {
|
|
914
|
+
return this.#encoder({ body, headers: buildHeaders([rawHeaders]) });
|
|
915
|
+
}
|
|
880
916
|
return { bodyHeaders: undefined, body: undefined };
|
|
881
917
|
}
|
|
882
918
|
const headers = buildHeaders([rawHeaders]);
|
|
@@ -945,12 +981,14 @@ export class Courier {
|
|
|
945
981
|
journeys: API.Journeys = new API.Journeys(this);
|
|
946
982
|
brands: API.Brands = new API.Brands(this);
|
|
947
983
|
bulk: API.Bulk = new API.Bulk(this);
|
|
984
|
+
digests: API.Digests = new API.Digests(this);
|
|
948
985
|
inbound: API.Inbound = new API.Inbound(this);
|
|
949
986
|
lists: API.Lists = new API.Lists(this);
|
|
950
987
|
messages: API.Messages = new API.Messages(this);
|
|
951
988
|
requests: API.Requests = new API.Requests(this);
|
|
952
989
|
notifications: API.Notifications = new API.Notifications(this);
|
|
953
990
|
routingStrategies: API.RoutingStrategies = new API.RoutingStrategies(this);
|
|
991
|
+
workspacePreferences: API.WorkspacePreferences = new API.WorkspacePreferences(this);
|
|
954
992
|
profiles: API.Profiles = new API.Profiles(this);
|
|
955
993
|
tenants: API.Tenants = new API.Tenants(this);
|
|
956
994
|
translations: API.Translations = new API.Translations(this);
|
|
@@ -966,12 +1004,14 @@ Courier.Automations = Automations;
|
|
|
966
1004
|
Courier.Journeys = Journeys;
|
|
967
1005
|
Courier.Brands = Brands;
|
|
968
1006
|
Courier.Bulk = Bulk;
|
|
1007
|
+
Courier.Digests = Digests;
|
|
969
1008
|
Courier.Inbound = Inbound;
|
|
970
1009
|
Courier.Lists = Lists;
|
|
971
1010
|
Courier.Messages = Messages;
|
|
972
1011
|
Courier.Requests = Requests;
|
|
973
1012
|
Courier.Notifications = Notifications;
|
|
974
1013
|
Courier.RoutingStrategies = RoutingStrategies;
|
|
1014
|
+
Courier.WorkspacePreferences = WorkspacePreferences;
|
|
975
1015
|
Courier.Profiles = Profiles;
|
|
976
1016
|
Courier.Tenants = Tenants;
|
|
977
1017
|
Courier.Translations = Translations;
|
|
@@ -1030,6 +1070,8 @@ export declare namespace Courier {
|
|
|
1030
1070
|
|
|
1031
1071
|
export {
|
|
1032
1072
|
Journeys as Journeys,
|
|
1073
|
+
type CancelJourneyRequest as CancelJourneyRequest,
|
|
1074
|
+
type CancelJourneyResponse as CancelJourneyResponse,
|
|
1033
1075
|
type CreateJourneyRequest as CreateJourneyRequest,
|
|
1034
1076
|
type Journey as Journey,
|
|
1035
1077
|
type JourneyAINode as JourneyAINode,
|
|
@@ -1041,6 +1083,8 @@ export declare namespace Courier {
|
|
|
1041
1083
|
type JourneyDelayDurationNode as JourneyDelayDurationNode,
|
|
1042
1084
|
type JourneyDelayUntilNode as JourneyDelayUntilNode,
|
|
1043
1085
|
type JourneyExitNode as JourneyExitNode,
|
|
1086
|
+
type JourneyExperiment as JourneyExperiment,
|
|
1087
|
+
type JourneyExperimentVariant as JourneyExperimentVariant,
|
|
1044
1088
|
type JourneyFetchGetDeleteNode as JourneyFetchGetDeleteNode,
|
|
1045
1089
|
type JourneyFetchPostPutNode as JourneyFetchPostPutNode,
|
|
1046
1090
|
type JourneyMergeStrategy as JourneyMergeStrategy,
|
|
@@ -1066,6 +1110,7 @@ export declare namespace Courier {
|
|
|
1066
1110
|
type JourneyCreateParams as JourneyCreateParams,
|
|
1067
1111
|
type JourneyRetrieveParams as JourneyRetrieveParams,
|
|
1068
1112
|
type JourneyListParams as JourneyListParams,
|
|
1113
|
+
type JourneyCancelParams as JourneyCancelParams,
|
|
1069
1114
|
type JourneyInvokeParams as JourneyInvokeParams,
|
|
1070
1115
|
type JourneyPublishParams as JourneyPublishParams,
|
|
1071
1116
|
type JourneyReplaceParams as JourneyReplaceParams,
|
|
@@ -1105,6 +1150,13 @@ export declare namespace Courier {
|
|
|
1105
1150
|
type BulkListUsersParams as BulkListUsersParams,
|
|
1106
1151
|
};
|
|
1107
1152
|
|
|
1153
|
+
export {
|
|
1154
|
+
Digests as Digests,
|
|
1155
|
+
type DigestCategory as DigestCategory,
|
|
1156
|
+
type DigestInstance as DigestInstance,
|
|
1157
|
+
type DigestInstanceListResponse as DigestInstanceListResponse,
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1108
1160
|
export {
|
|
1109
1161
|
Inbound as Inbound,
|
|
1110
1162
|
type InboundTrackEventResponse as InboundTrackEventResponse,
|
|
@@ -1128,6 +1180,7 @@ export declare namespace Courier {
|
|
|
1128
1180
|
type MessageListResponse as MessageListResponse,
|
|
1129
1181
|
type MessageContentResponse as MessageContentResponse,
|
|
1130
1182
|
type MessageHistoryResponse as MessageHistoryResponse,
|
|
1183
|
+
type MessageResendResponse as MessageResendResponse,
|
|
1131
1184
|
type MessageListParams as MessageListParams,
|
|
1132
1185
|
type MessageHistoryParams as MessageHistoryParams,
|
|
1133
1186
|
};
|
|
@@ -1182,6 +1235,23 @@ export declare namespace Courier {
|
|
|
1182
1235
|
type RoutingStrategyReplaceParams as RoutingStrategyReplaceParams,
|
|
1183
1236
|
};
|
|
1184
1237
|
|
|
1238
|
+
export {
|
|
1239
|
+
WorkspacePreferences as WorkspacePreferences,
|
|
1240
|
+
type PublishPreferencesRequest as PublishPreferencesRequest,
|
|
1241
|
+
type PublishPreferencesResponse as PublishPreferencesResponse,
|
|
1242
|
+
type WorkspacePreferenceCreateRequest as WorkspacePreferenceCreateRequest,
|
|
1243
|
+
type WorkspacePreferenceGetResponse as WorkspacePreferenceGetResponse,
|
|
1244
|
+
type WorkspacePreferenceListResponse as WorkspacePreferenceListResponse,
|
|
1245
|
+
type WorkspacePreferenceReplaceRequest as WorkspacePreferenceReplaceRequest,
|
|
1246
|
+
type WorkspacePreferenceTopicCreateRequest as WorkspacePreferenceTopicCreateRequest,
|
|
1247
|
+
type WorkspacePreferenceTopicGetResponse as WorkspacePreferenceTopicGetResponse,
|
|
1248
|
+
type WorkspacePreferenceTopicListResponse as WorkspacePreferenceTopicListResponse,
|
|
1249
|
+
type WorkspacePreferenceTopicReplaceRequest as WorkspacePreferenceTopicReplaceRequest,
|
|
1250
|
+
type WorkspacePreferenceCreateParams as WorkspacePreferenceCreateParams,
|
|
1251
|
+
type WorkspacePreferencePublishParams as WorkspacePreferencePublishParams,
|
|
1252
|
+
type WorkspacePreferenceReplaceParams as WorkspacePreferenceReplaceParams,
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1185
1255
|
export {
|
|
1186
1256
|
Profiles as Profiles,
|
|
1187
1257
|
type SubscribeToListsRequestItem as SubscribeToListsRequestItem,
|
|
@@ -84,7 +84,8 @@ export interface Audience {
|
|
|
84
84
|
filter?: Shared.AudienceFilterConfig | null;
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
* The logical operator (AND/OR)
|
|
87
|
+
* The logical operator (AND/OR) combining the top-level `filter.filters`.
|
|
88
|
+
* Convenience alias for `filter.operator`.
|
|
88
89
|
*/
|
|
89
90
|
operator?: 'AND' | 'OR';
|
|
90
91
|
}
|
|
@@ -136,7 +137,9 @@ export interface AudienceUpdateParams {
|
|
|
136
137
|
name?: string | null;
|
|
137
138
|
|
|
138
139
|
/**
|
|
139
|
-
* The logical operator (AND/OR)
|
|
140
|
+
* The logical operator (AND/OR) combining the top-level `filter.filters`.
|
|
141
|
+
* Convenience alias for `filter.operator`: if set, it is applied to the top-level
|
|
142
|
+
* filter group. Prefer setting `operator` directly inside `filter`.
|
|
140
143
|
*/
|
|
141
144
|
operator?: 'AND' | 'OR' | null;
|
|
142
145
|
}
|
package/src/resources/brands.ts
CHANGED
|
@@ -10,7 +10,18 @@ import { path } from '../internal/utils/path';
|
|
|
10
10
|
|
|
11
11
|
export class Brands extends APIResource {
|
|
12
12
|
/**
|
|
13
|
-
* Create a new brand
|
|
13
|
+
* Create a new brand. Requires `name` and `settings` (with at least
|
|
14
|
+
* `colors.primary` and `colors.secondary`).
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const brand = await client.brands.create({
|
|
19
|
+
* name: 'My Brand',
|
|
20
|
+
* settings: {
|
|
21
|
+
* colors: { primary: '#9D3789', secondary: '#FFFFFF' },
|
|
22
|
+
* },
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
14
25
|
*/
|
|
15
26
|
create(body: BrandCreateParams, options?: RequestOptions): APIPromise<Brand> {
|
|
16
27
|
return this._client.post('/brands', { body, ...options });
|
|
@@ -18,6 +29,11 @@ export class Brands extends APIResource {
|
|
|
18
29
|
|
|
19
30
|
/**
|
|
20
31
|
* Fetch a specific brand by brand ID.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const brand = await client.brands.retrieve('brand_id');
|
|
36
|
+
* ```
|
|
21
37
|
*/
|
|
22
38
|
retrieve(brandID: string, options?: RequestOptions): APIPromise<Brand> {
|
|
23
39
|
return this._client.get(path`/brands/${brandID}`, options);
|
|
@@ -25,6 +41,13 @@ export class Brands extends APIResource {
|
|
|
25
41
|
|
|
26
42
|
/**
|
|
27
43
|
* Replace an existing brand with the supplied values.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const brand = await client.brands.update('brand_id', {
|
|
48
|
+
* name: 'name',
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
28
51
|
*/
|
|
29
52
|
update(brandID: string, body: BrandUpdateParams, options?: RequestOptions): APIPromise<Brand> {
|
|
30
53
|
return this._client.put(path`/brands/${brandID}`, { body, ...options });
|
|
@@ -32,6 +55,11 @@ export class Brands extends APIResource {
|
|
|
32
55
|
|
|
33
56
|
/**
|
|
34
57
|
* Get the list of brands.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const brands = await client.brands.list();
|
|
62
|
+
* ```
|
|
35
63
|
*/
|
|
36
64
|
list(
|
|
37
65
|
query: BrandListParams | null | undefined = {},
|
|
@@ -42,6 +70,11 @@ export class Brands extends APIResource {
|
|
|
42
70
|
|
|
43
71
|
/**
|
|
44
72
|
* Delete a brand by brand ID.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* await client.brands.delete('brand_id');
|
|
77
|
+
* ```
|
|
45
78
|
*/
|
|
46
79
|
delete(brandID: string, options?: RequestOptions): APIPromise<void> {
|
|
47
80
|
return this._client.delete(path`/brands/${brandID}`, {
|
|
@@ -194,9 +227,9 @@ export interface BrandListResponse {
|
|
|
194
227
|
export interface BrandCreateParams {
|
|
195
228
|
name: string;
|
|
196
229
|
|
|
197
|
-
|
|
230
|
+
settings: BrandSettings;
|
|
198
231
|
|
|
199
|
-
|
|
232
|
+
id?: string | null;
|
|
200
233
|
|
|
201
234
|
snippets?: BrandSnippets | null;
|
|
202
235
|
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as SchedulesAPI from './schedules';
|
|
5
|
+
import { ScheduleListInstancesParams, Schedules } from './schedules';
|
|
6
|
+
|
|
7
|
+
export class Digests extends APIResource {
|
|
8
|
+
schedules: SchedulesAPI.Schedules = new SchedulesAPI.Schedules(this._client);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface DigestCategory {
|
|
12
|
+
/**
|
|
13
|
+
* The key that identifies the category within the digest.
|
|
14
|
+
*/
|
|
15
|
+
category_key: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Which events to keep when the number of events exceeds the retention limit for
|
|
19
|
+
* the category.
|
|
20
|
+
*/
|
|
21
|
+
retain: 'first' | 'last' | 'highest' | 'lowest' | 'none';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The data key used to order events when `retain` is `highest` or `lowest`.
|
|
25
|
+
*/
|
|
26
|
+
sort_key?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface DigestInstance {
|
|
30
|
+
/**
|
|
31
|
+
* A unique identifier for the digest instance.
|
|
32
|
+
*/
|
|
33
|
+
digest_instance_id: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The total number of events received for this instance.
|
|
37
|
+
*/
|
|
38
|
+
event_count: number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The status of the digest instance. `IN_PROGRESS` instances are still
|
|
42
|
+
* accumulating events; `COMPLETED` instances have been released.
|
|
43
|
+
*/
|
|
44
|
+
status: 'IN_PROGRESS' | 'COMPLETED';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The ID of the user this digest instance belongs to.
|
|
48
|
+
*/
|
|
49
|
+
user_id: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The categories configured for the digest.
|
|
53
|
+
*/
|
|
54
|
+
categories?: Array<DigestCategory>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A map of category key to the number of events received for that category.
|
|
58
|
+
*/
|
|
59
|
+
category_key_counts?: { [key: string]: number };
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* An ISO 8601 timestamp of when the digest instance was created.
|
|
63
|
+
*/
|
|
64
|
+
created_at?: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Whether the digest instance has been disabled.
|
|
68
|
+
*/
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The ID of the tenant this digest instance belongs to, if any.
|
|
73
|
+
*/
|
|
74
|
+
tenant_id?: string | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface DigestInstanceListResponse {
|
|
78
|
+
/**
|
|
79
|
+
* Whether there are more digest instances to fetch using the cursor.
|
|
80
|
+
*/
|
|
81
|
+
has_more: boolean;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The digest instances for this page of results.
|
|
85
|
+
*/
|
|
86
|
+
items: Array<DigestInstance>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Always `list` for a paginated list response.
|
|
90
|
+
*/
|
|
91
|
+
type: 'list';
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* A cursor token for fetching the next page of results, or null when there are
|
|
95
|
+
* none.
|
|
96
|
+
*/
|
|
97
|
+
cursor?: string | null;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The path to fetch the next page of results, or null when there are none.
|
|
101
|
+
*/
|
|
102
|
+
next_url?: string | null;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The path of the current request.
|
|
106
|
+
*/
|
|
107
|
+
url?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
Digests.Schedules = Schedules;
|
|
111
|
+
|
|
112
|
+
export declare namespace Digests {
|
|
113
|
+
export {
|
|
114
|
+
type DigestCategory as DigestCategory,
|
|
115
|
+
type DigestInstance as DigestInstance,
|
|
116
|
+
type DigestInstanceListResponse as DigestInstanceListResponse,
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { Schedules as Schedules, type ScheduleListInstancesParams as ScheduleListInstancesParams };
|
|
120
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Digests,
|
|
5
|
+
type DigestCategory,
|
|
6
|
+
type DigestInstance,
|
|
7
|
+
type DigestInstanceListResponse,
|
|
8
|
+
} from './digests';
|
|
9
|
+
export { Schedules, type ScheduleListInstancesParams } from './schedules';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as DigestsAPI from './digests';
|
|
5
|
+
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { buildHeaders } from '../../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
8
|
+
import { path } from '../../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class Schedules extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* List the digest instances for a schedule. Each instance represents the events
|
|
13
|
+
* accumulated for a single user against the schedule, and can be used to monitor
|
|
14
|
+
* digest accumulation before the digest is released.
|
|
15
|
+
*/
|
|
16
|
+
listInstances(
|
|
17
|
+
scheduleID: string,
|
|
18
|
+
query: ScheduleListInstancesParams | null | undefined = {},
|
|
19
|
+
options?: RequestOptions,
|
|
20
|
+
): APIPromise<DigestsAPI.DigestInstanceListResponse> {
|
|
21
|
+
return this._client.get(path`/digests/schedules/${scheduleID}/instances`, { query, ...options });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Send a digest now instead of waiting for its scheduled time, so your users get
|
|
26
|
+
* what they have collected so far right away.
|
|
27
|
+
*/
|
|
28
|
+
release(scheduleID: string, options?: RequestOptions): APIPromise<void> {
|
|
29
|
+
return this._client.post(path`/digests/schedules/${scheduleID}/trigger`, {
|
|
30
|
+
...options,
|
|
31
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ScheduleListInstancesParams {
|
|
37
|
+
/**
|
|
38
|
+
* A cursor token from a previous response, used to fetch the next page of results.
|
|
39
|
+
*/
|
|
40
|
+
cursor?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The maximum number of digest instances to return. Defaults to 20, with a maximum
|
|
44
|
+
* of 100.
|
|
45
|
+
*/
|
|
46
|
+
limit?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export declare namespace Schedules {
|
|
50
|
+
export { type ScheduleListInstancesParams as ScheduleListInstancesParams };
|
|
51
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -57,9 +57,17 @@ export {
|
|
|
57
57
|
type BulkCreateJobParams,
|
|
58
58
|
type BulkListUsersParams,
|
|
59
59
|
} from './bulk';
|
|
60
|
+
export {
|
|
61
|
+
Digests,
|
|
62
|
+
type DigestCategory,
|
|
63
|
+
type DigestInstance,
|
|
64
|
+
type DigestInstanceListResponse,
|
|
65
|
+
} from './digests/digests';
|
|
60
66
|
export { Inbound, type InboundTrackEventResponse, type InboundTrackEventParams } from './inbound';
|
|
61
67
|
export {
|
|
62
68
|
Journeys,
|
|
69
|
+
type CancelJourneyRequest,
|
|
70
|
+
type CancelJourneyResponse,
|
|
63
71
|
type CreateJourneyRequest,
|
|
64
72
|
type Journey,
|
|
65
73
|
type JourneyAINode,
|
|
@@ -71,6 +79,8 @@ export {
|
|
|
71
79
|
type JourneyDelayDurationNode,
|
|
72
80
|
type JourneyDelayUntilNode,
|
|
73
81
|
type JourneyExitNode,
|
|
82
|
+
type JourneyExperiment,
|
|
83
|
+
type JourneyExperimentVariant,
|
|
74
84
|
type JourneyFetchGetDeleteNode,
|
|
75
85
|
type JourneyFetchPostPutNode,
|
|
76
86
|
type JourneyMergeStrategy,
|
|
@@ -96,6 +106,7 @@ export {
|
|
|
96
106
|
type JourneyCreateParams,
|
|
97
107
|
type JourneyRetrieveParams,
|
|
98
108
|
type JourneyListParams,
|
|
109
|
+
type JourneyCancelParams,
|
|
99
110
|
type JourneyInvokeParams,
|
|
100
111
|
type JourneyPublishParams,
|
|
101
112
|
type JourneyReplaceParams,
|
|
@@ -116,6 +127,7 @@ export {
|
|
|
116
127
|
type MessageListResponse,
|
|
117
128
|
type MessageContentResponse,
|
|
118
129
|
type MessageHistoryResponse,
|
|
130
|
+
type MessageResendResponse,
|
|
119
131
|
type MessageListParams,
|
|
120
132
|
type MessageHistoryParams,
|
|
121
133
|
} from './messages';
|
|
@@ -211,3 +223,19 @@ export {
|
|
|
211
223
|
type TranslationUpdateParams,
|
|
212
224
|
} from './translations';
|
|
213
225
|
export { Users } from './users/users';
|
|
226
|
+
export {
|
|
227
|
+
WorkspacePreferences,
|
|
228
|
+
type PublishPreferencesRequest,
|
|
229
|
+
type PublishPreferencesResponse,
|
|
230
|
+
type WorkspacePreferenceCreateRequest,
|
|
231
|
+
type WorkspacePreferenceGetResponse,
|
|
232
|
+
type WorkspacePreferenceListResponse,
|
|
233
|
+
type WorkspacePreferenceReplaceRequest,
|
|
234
|
+
type WorkspacePreferenceTopicCreateRequest,
|
|
235
|
+
type WorkspacePreferenceTopicGetResponse,
|
|
236
|
+
type WorkspacePreferenceTopicListResponse,
|
|
237
|
+
type WorkspacePreferenceTopicReplaceRequest,
|
|
238
|
+
type WorkspacePreferenceCreateParams,
|
|
239
|
+
type WorkspacePreferencePublishParams,
|
|
240
|
+
type WorkspacePreferenceReplaceParams,
|
|
241
|
+
} from './workspace-preferences/workspace-preferences';
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
export {
|
|
4
4
|
Journeys,
|
|
5
|
+
type CancelJourneyRequest,
|
|
6
|
+
type CancelJourneyResponse,
|
|
5
7
|
type CreateJourneyRequest,
|
|
6
8
|
type Journey,
|
|
7
9
|
type JourneyAINode,
|
|
@@ -13,6 +15,8 @@ export {
|
|
|
13
15
|
type JourneyDelayDurationNode,
|
|
14
16
|
type JourneyDelayUntilNode,
|
|
15
17
|
type JourneyExitNode,
|
|
18
|
+
type JourneyExperiment,
|
|
19
|
+
type JourneyExperimentVariant,
|
|
16
20
|
type JourneyFetchGetDeleteNode,
|
|
17
21
|
type JourneyFetchPostPutNode,
|
|
18
22
|
type JourneyMergeStrategy,
|
|
@@ -38,6 +42,7 @@ export {
|
|
|
38
42
|
type JourneyCreateParams,
|
|
39
43
|
type JourneyRetrieveParams,
|
|
40
44
|
type JourneyListParams,
|
|
45
|
+
type JourneyCancelParams,
|
|
41
46
|
type JourneyInvokeParams,
|
|
42
47
|
type JourneyPublishParams,
|
|
43
48
|
type JourneyReplaceParams,
|
|
@@ -50,5 +55,8 @@ export {
|
|
|
50
55
|
type TemplateArchiveParams,
|
|
51
56
|
type TemplateListVersionsParams,
|
|
52
57
|
type TemplatePublishParams,
|
|
58
|
+
type TemplatePutContentParams,
|
|
59
|
+
type TemplatePutLocaleParams,
|
|
53
60
|
type TemplateReplaceParams,
|
|
61
|
+
type TemplateRetrieveContentParams,
|
|
54
62
|
} from './templates';
|