@outseta/api-client 0.3.29 → 0.3.31

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/dist/index.js CHANGED
@@ -1088,6 +1088,62 @@ var campaignSendTestCampaignEmail = async (campaignSendTestCampaignEmailBody, op
1088
1088
  body: JSON.stringify(campaignSendTestCampaignEmailBody)
1089
1089
  });
1090
1090
  };
1091
+ var getEmailListGetAllEmailListsUrl = (params) => {
1092
+ const normalizedParams = new URLSearchParams;
1093
+ Object.entries(params || {}).forEach(([key, value]) => {
1094
+ if (value !== undefined) {
1095
+ normalizedParams.append(key, value === null ? "null" : value.toString());
1096
+ }
1097
+ });
1098
+ const stringifiedParams = normalizedParams.toString();
1099
+ return stringifiedParams.length > 0 ? `/api/v1/email/lists?${stringifiedParams}` : `/api/v1/email/lists`;
1100
+ };
1101
+ var emailListGetAllEmailLists = async (params, options) => {
1102
+ return customFetch(getEmailListGetAllEmailListsUrl(params), {
1103
+ ...options,
1104
+ method: "GET"
1105
+ });
1106
+ };
1107
+ var getEmailListAddEmailListUrl = () => {
1108
+ return `/api/v1/email/lists`;
1109
+ };
1110
+ var emailListAddEmailList = async (emailListAddEmailListBody, options) => {
1111
+ return customFetch(getEmailListAddEmailListUrl(), {
1112
+ ...options,
1113
+ method: "POST",
1114
+ headers: { "Content-Type": "application/json", ...options?.headers },
1115
+ body: JSON.stringify(emailListAddEmailListBody)
1116
+ });
1117
+ };
1118
+ var getEmailListGetEmailListUrl = (emailListUid) => {
1119
+ return `/api/v1/email/lists/${emailListUid}`;
1120
+ };
1121
+ var emailListGetEmailList = async (emailListUid, options) => {
1122
+ return customFetch(getEmailListGetEmailListUrl(emailListUid), {
1123
+ ...options,
1124
+ method: "GET"
1125
+ });
1126
+ };
1127
+ var getEmailListUpdateEmailListUrl = (emailListUid) => {
1128
+ return `/api/v1/email/lists/${emailListUid}`;
1129
+ };
1130
+ var emailListUpdateEmailList = async (emailListUid, emailListUpdateEmailListBody, options) => {
1131
+ return customFetch(getEmailListUpdateEmailListUrl(emailListUid), {
1132
+ ...options,
1133
+ method: "PUT",
1134
+ headers: { "Content-Type": "application/json", ...options?.headers },
1135
+ body: JSON.stringify(emailListUpdateEmailListBody)
1136
+ });
1137
+ };
1138
+ var getEmailListDeleteEmailListUrl = (emailListUid) => {
1139
+ return `/api/v1/email/lists/${emailListUid}`;
1140
+ };
1141
+ var emailListDeleteEmailList = async (emailListUid, options) => {
1142
+ return customFetch(getEmailListDeleteEmailListUrl(emailListUid), {
1143
+ ...options,
1144
+ method: "DELETE"
1145
+ });
1146
+ };
1091
1147
  var getEmailListGetAllSubscriptionsUrl = (emailListUid, params) => {
1092
1148
  const normalizedParams = new URLSearchParams;
1093
1149
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -1956,9 +2012,14 @@ export {
1956
2012
  getInvoiceGetAllInvoicesUrl,
1957
2013
  getInvoiceDeleteInvoiceUrl,
1958
2014
  getInvoiceAddInvoiceUrl,
2015
+ getEmailListUpdateEmailListUrl,
2016
+ getEmailListGetEmailListUrl,
1959
2017
  getEmailListGetAllSubscriptionsUrl,
2018
+ getEmailListGetAllEmailListsUrl,
1960
2019
  getEmailListDeleteSubscriptionUrl,
2020
+ getEmailListDeleteEmailListUrl,
1961
2021
  getEmailListAddSubscriptionUrl,
2022
+ getEmailListAddEmailListUrl,
1962
2023
  getDripCampaignUpdateDripCampaignUrl,
1963
2024
  getDripCampaignUpdateDripCampaignMessageUrl,
1964
2025
  getDripCampaignSendTestCampaignEmailUrl,
@@ -2012,9 +2073,14 @@ export {
2012
2073
  getAccountCancelAccountUrl,
2013
2074
  getAccountAddPersonToAccountUrl,
2014
2075
  getAccountAddAccountUrl,
2076
+ emailListUpdateEmailList,
2077
+ emailListGetEmailList,
2015
2078
  emailListGetAllSubscriptions,
2079
+ emailListGetAllEmailLists,
2016
2080
  emailListDeleteSubscription,
2081
+ emailListDeleteEmailList,
2017
2082
  emailListAddSubscription,
2083
+ emailListAddEmailList,
2018
2084
  dripCampaignUpdateDripCampaignMessage,
2019
2085
  dripCampaignUpdateDripCampaign,
2020
2086
  dripCampaignSendTestCampaignEmail,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outseta/api-client",
3
- "version": "0.3.29",
3
+ "version": "0.3.31",
4
4
  "description": "Generated API client for the Outseta REST API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,10 +15,15 @@ import type {
15
15
  DripCampaignSendTestCampaignEmailBody,
16
16
  DripCampaignUpdateDripCampaignBody,
17
17
  DripCampaignUpdateDripCampaignMessageBody,
18
+ EmailList,
19
+ EmailListAddEmailListBody,
18
20
  EmailListAddSubscriptionBody,
21
+ EmailListGetAllEmailLists200,
22
+ EmailListGetAllEmailListsParams,
19
23
  EmailListGetAllSubscriptions200,
20
24
  EmailListGetAllSubscriptionsParams,
21
- EmailListPerson
25
+ EmailListPerson,
26
+ EmailListUpdateEmailListBody
22
27
  } from '.././models';
23
28
 
24
29
  import { customFetch } from '../../client';
@@ -1033,6 +1038,261 @@ export const campaignSendTestCampaignEmail = async (campaignSendTestCampaignEmai
1033
1038
  );}
1034
1039
 
1035
1040
 
1041
+ /**
1042
+ * @summary Retrieve all email lists.
1043
+ */
1044
+ export type emailListGetAllEmailListsResponse200 = {
1045
+ data: EmailListGetAllEmailLists200
1046
+ status: 200
1047
+ }
1048
+
1049
+ export type emailListGetAllEmailListsResponse401 = {
1050
+ data: void
1051
+ status: 401
1052
+ }
1053
+
1054
+ export type emailListGetAllEmailListsResponseSuccess = (emailListGetAllEmailListsResponse200) & {
1055
+ headers: Headers;
1056
+ };
1057
+ export type emailListGetAllEmailListsResponseError = (emailListGetAllEmailListsResponse401) & {
1058
+ headers: Headers;
1059
+ };
1060
+
1061
+ export type emailListGetAllEmailListsResponse = (emailListGetAllEmailListsResponseSuccess | emailListGetAllEmailListsResponseError)
1062
+
1063
+ export const getEmailListGetAllEmailListsUrl = (params?: EmailListGetAllEmailListsParams,) => {
1064
+ const normalizedParams = new URLSearchParams();
1065
+
1066
+ Object.entries(params || {}).forEach(([key, value]) => {
1067
+
1068
+ if (value !== undefined) {
1069
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1070
+ }
1071
+ });
1072
+
1073
+ const stringifiedParams = normalizedParams.toString();
1074
+
1075
+ return stringifiedParams.length > 0 ? `/api/v1/email/lists?${stringifiedParams}` : `/api/v1/email/lists`
1076
+ }
1077
+
1078
+ export const emailListGetAllEmailLists = async (params?: EmailListGetAllEmailListsParams, options?: RequestInit): Promise<emailListGetAllEmailListsResponse> => {
1079
+
1080
+ return customFetch<emailListGetAllEmailListsResponse>(getEmailListGetAllEmailListsUrl(params),
1081
+ {
1082
+ ...options,
1083
+ method: 'GET'
1084
+
1085
+
1086
+ }
1087
+ );}
1088
+
1089
+
1090
+ /**
1091
+ * Name is required and must be unique. Set RequiresDoubleOptIn to true to require new
1092
+ subscribers to confirm their subscription. WelcomeSubject and WelcomeBody configure an
1093
+ optional welcome email; use WelcomeFromName and WelcomeFromEmail to set its sender.
1094
+ * @summary Create an email list.
1095
+ */
1096
+ export type emailListAddEmailListResponse200 = {
1097
+ data: EmailList
1098
+ status: 200
1099
+ }
1100
+
1101
+ export type emailListAddEmailListResponse401 = {
1102
+ data: void
1103
+ status: 401
1104
+ }
1105
+
1106
+ export type emailListAddEmailListResponseSuccess = (emailListAddEmailListResponse200) & {
1107
+ headers: Headers;
1108
+ };
1109
+ export type emailListAddEmailListResponseError = (emailListAddEmailListResponse401) & {
1110
+ headers: Headers;
1111
+ };
1112
+
1113
+ export type emailListAddEmailListResponse = (emailListAddEmailListResponseSuccess | emailListAddEmailListResponseError)
1114
+
1115
+ export const getEmailListAddEmailListUrl = () => {
1116
+
1117
+
1118
+
1119
+
1120
+ return `/api/v1/email/lists`
1121
+ }
1122
+
1123
+ export const emailListAddEmailList = async (emailListAddEmailListBody: NonReadonly<EmailListAddEmailListBody>, options?: RequestInit): Promise<emailListAddEmailListResponse> => {
1124
+
1125
+ return customFetch<emailListAddEmailListResponse>(getEmailListAddEmailListUrl(),
1126
+ {
1127
+ ...options,
1128
+ method: 'POST',
1129
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1130
+ body: JSON.stringify(
1131
+ emailListAddEmailListBody,)
1132
+ }
1133
+ );}
1134
+
1135
+
1136
+ /**
1137
+ * @summary Retrieve an email list.
1138
+ */
1139
+ export type emailListGetEmailListResponse200 = {
1140
+ data: EmailList
1141
+ status: 200
1142
+ }
1143
+
1144
+ export type emailListGetEmailListResponse400 = {
1145
+ data: void
1146
+ status: 400
1147
+ }
1148
+
1149
+ export type emailListGetEmailListResponse401 = {
1150
+ data: void
1151
+ status: 401
1152
+ }
1153
+
1154
+ export type emailListGetEmailListResponse404 = {
1155
+ data: void
1156
+ status: 404
1157
+ }
1158
+
1159
+ export type emailListGetEmailListResponseSuccess = (emailListGetEmailListResponse200) & {
1160
+ headers: Headers;
1161
+ };
1162
+ export type emailListGetEmailListResponseError = (emailListGetEmailListResponse400 | emailListGetEmailListResponse401 | emailListGetEmailListResponse404) & {
1163
+ headers: Headers;
1164
+ };
1165
+
1166
+ export type emailListGetEmailListResponse = (emailListGetEmailListResponseSuccess | emailListGetEmailListResponseError)
1167
+
1168
+ export const getEmailListGetEmailListUrl = (emailListUid: string | null,) => {
1169
+
1170
+
1171
+
1172
+
1173
+ return `/api/v1/email/lists/${emailListUid}`
1174
+ }
1175
+
1176
+ export const emailListGetEmailList = async (emailListUid: string | null, options?: RequestInit): Promise<emailListGetEmailListResponse> => {
1177
+
1178
+ return customFetch<emailListGetEmailListResponse>(getEmailListGetEmailListUrl(emailListUid),
1179
+ {
1180
+ ...options,
1181
+ method: 'GET'
1182
+
1183
+
1184
+ }
1185
+ );}
1186
+
1187
+
1188
+ /**
1189
+ * The Uid may be omitted from the request body. If supplied, it must match the Uid in the URL.
1190
+ * @summary Update an email list.
1191
+ */
1192
+ export type emailListUpdateEmailListResponse200 = {
1193
+ data: EmailList
1194
+ status: 200
1195
+ }
1196
+
1197
+ export type emailListUpdateEmailListResponse400 = {
1198
+ data: void
1199
+ status: 400
1200
+ }
1201
+
1202
+ export type emailListUpdateEmailListResponse401 = {
1203
+ data: void
1204
+ status: 401
1205
+ }
1206
+
1207
+ export type emailListUpdateEmailListResponse404 = {
1208
+ data: void
1209
+ status: 404
1210
+ }
1211
+
1212
+ export type emailListUpdateEmailListResponseSuccess = (emailListUpdateEmailListResponse200) & {
1213
+ headers: Headers;
1214
+ };
1215
+ export type emailListUpdateEmailListResponseError = (emailListUpdateEmailListResponse400 | emailListUpdateEmailListResponse401 | emailListUpdateEmailListResponse404) & {
1216
+ headers: Headers;
1217
+ };
1218
+
1219
+ export type emailListUpdateEmailListResponse = (emailListUpdateEmailListResponseSuccess | emailListUpdateEmailListResponseError)
1220
+
1221
+ export const getEmailListUpdateEmailListUrl = (emailListUid: string | null,) => {
1222
+
1223
+
1224
+
1225
+
1226
+ return `/api/v1/email/lists/${emailListUid}`
1227
+ }
1228
+
1229
+ export const emailListUpdateEmailList = async (emailListUid: string | null,
1230
+ emailListUpdateEmailListBody: NonReadonly<EmailListUpdateEmailListBody>, options?: RequestInit): Promise<emailListUpdateEmailListResponse> => {
1231
+
1232
+ return customFetch<emailListUpdateEmailListResponse>(getEmailListUpdateEmailListUrl(emailListUid),
1233
+ {
1234
+ ...options,
1235
+ method: 'PUT',
1236
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1237
+ body: JSON.stringify(
1238
+ emailListUpdateEmailListBody,)
1239
+ }
1240
+ );}
1241
+
1242
+
1243
+ /**
1244
+ * Deleting a list also removes all of its subscriptions.
1245
+ * @summary Delete an email list.
1246
+ */
1247
+ export type emailListDeleteEmailListResponse200 = {
1248
+ data: Blob
1249
+ status: 200
1250
+ }
1251
+
1252
+ export type emailListDeleteEmailListResponse400 = {
1253
+ data: void
1254
+ status: 400
1255
+ }
1256
+
1257
+ export type emailListDeleteEmailListResponse401 = {
1258
+ data: void
1259
+ status: 401
1260
+ }
1261
+
1262
+ export type emailListDeleteEmailListResponse404 = {
1263
+ data: void
1264
+ status: 404
1265
+ }
1266
+
1267
+ export type emailListDeleteEmailListResponseSuccess = (emailListDeleteEmailListResponse200) & {
1268
+ headers: Headers;
1269
+ };
1270
+ export type emailListDeleteEmailListResponseError = (emailListDeleteEmailListResponse400 | emailListDeleteEmailListResponse401 | emailListDeleteEmailListResponse404) & {
1271
+ headers: Headers;
1272
+ };
1273
+
1274
+ export type emailListDeleteEmailListResponse = (emailListDeleteEmailListResponseSuccess | emailListDeleteEmailListResponseError)
1275
+
1276
+ export const getEmailListDeleteEmailListUrl = (emailListUid: string | null,) => {
1277
+
1278
+
1279
+
1280
+
1281
+ return `/api/v1/email/lists/${emailListUid}`
1282
+ }
1283
+
1284
+ export const emailListDeleteEmailList = async (emailListUid: string | null, options?: RequestInit): Promise<emailListDeleteEmailListResponse> => {
1285
+
1286
+ return customFetch<emailListDeleteEmailListResponse>(getEmailListDeleteEmailListUrl(emailListUid),
1287
+ {
1288
+ ...options,
1289
+ method: 'DELETE'
1290
+
1291
+
1292
+ }
1293
+ );}
1294
+
1295
+
1036
1296
  /**
1037
1297
  * @summary Retrieve all subscribers to an email list.
1038
1298
  */
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck
2
+ import type { EmailList } from './emailList';
3
+
4
+ /**
5
+ * @nullable
6
+ */
7
+ export type EmailListAddEmailListBody = EmailList | null;
@@ -0,0 +1,8 @@
1
+ // @ts-nocheck
2
+ import type { CollectionMetadata } from './collectionMetadata';
3
+ import type { EmailList } from './emailList';
4
+
5
+ export type EmailListGetAllEmailLists200 = {
6
+ metadata?: CollectionMetadata;
7
+ items?: EmailList[];
8
+ };
@@ -0,0 +1,14 @@
1
+ // @ts-nocheck
2
+ import type { LimitParameter } from './limitParameter';
3
+ import type { OffsetParameter } from './offsetParameter';
4
+
5
+ export type EmailListGetAllEmailListsParams = {
6
+ /**
7
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
8
+ */
9
+ limit?: LimitParameter;
10
+ /**
11
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
12
+ */
13
+ offset?: OffsetParameter;
14
+ };
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck
2
+ import type { EmailList } from './emailList';
3
+
4
+ /**
5
+ * @nullable
6
+ */
7
+ export type EmailListUpdateEmailListBody = EmailList | null;
@@ -378,8 +378,11 @@ export * from './dripCampaignUpdateDripCampaignMessageBody';
378
378
  export * from './emailLink';
379
379
  export * from './emailLinkAllOf';
380
380
  export * from './emailList';
381
+ export * from './emailListAddEmailListBody';
381
382
  export * from './emailListAddSubscriptionBody';
382
383
  export * from './emailListAllOf';
384
+ export * from './emailListGetAllEmailLists200';
385
+ export * from './emailListGetAllEmailListsParams';
383
386
  export * from './emailListGetAllSubscriptions200';
384
387
  export * from './emailListGetAllSubscriptionsParams';
385
388
  export * from './emailListPerson';
@@ -387,6 +390,7 @@ export * from './emailListPersonAllOf';
387
390
  export * from './emailListPersonAllOfEmailList';
388
391
  export * from './emailListPersonAllOfPerson';
389
392
  export * from './emailListSubscriberStatus';
393
+ export * from './emailListUpdateEmailListBody';
390
394
  export * from './emailSubscriptionsPayload';
391
395
  export * from './entityType';
392
396
  export * from './extendRenewalParams';
@@ -553,6 +557,7 @@ export * from './segmentPersonAllOfPerson';
553
557
  export * from './segmentPersonAllOfSegment';
554
558
  export * from './sendGridDomainAuthentication';
555
559
  export * from './sendGridDomainAuthenticationAllOf';
560
+ export * from './sendTemplateEmailRequest';
556
561
  export * from './sendTestEmailRequest';
557
562
  export * from './sendTestEmailRequest2';
558
563
  export * from './sendTestEmailRequest2BroadcastCampaign';
@@ -711,6 +716,15 @@ export * from './taxRateAllOf';
711
716
  export * from './teamRole';
712
717
  export * from './template';
713
718
  export * from './templateAllOf';
719
+ export * from './templateEmailInstance';
720
+ export * from './templateEmailInstanceAllOf';
721
+ export * from './templateEmailInstanceAllOfRecipient';
722
+ export * from './templateEmailInstanceAllOfTemplate';
723
+ export * from './templateGetAllTemplateEmails200';
724
+ export * from './templateGetAllTemplateEmailsParams';
725
+ export * from './templateGetTemplateEmails200';
726
+ export * from './templateGetTemplateEmailsParams';
727
+ export * from './templateSendTemplateEmailBody';
714
728
  export * from './temporaryPasswordModel';
715
729
  export * from './tokenPayload';
716
730
  export * from './tokenTwoFactorEnrollmentBeginEmailParams';
@@ -0,0 +1,24 @@
1
+ // @ts-nocheck
2
+
3
+ export interface SendTemplateEmailRequest {
4
+ /**
5
+ * The Uid of the person to send the email to. Required.
6
+ * @nullable
7
+ */
8
+ PersonUid?: string | null;
9
+ /**
10
+ * The from address. Defaults to the support email address for the account.
11
+ * @nullable
12
+ */
13
+ FromEmail?: string | null;
14
+ /**
15
+ * The from name. Defaults to the company name.
16
+ * @nullable
17
+ */
18
+ FromName?: string | null;
19
+ /**
20
+ * Overrides the subject of the template.
21
+ * @nullable
22
+ */
23
+ Subject?: string | null;
24
+ }
@@ -0,0 +1,5 @@
1
+ // @ts-nocheck
2
+ import type { AbstractQcountBean } from './abstractQcountBean';
3
+ import type { TemplateEmailInstanceAllOf } from './templateEmailInstanceAllOf';
4
+
5
+ export type TemplateEmailInstance = AbstractQcountBean & TemplateEmailInstanceAllOf;
@@ -0,0 +1,47 @@
1
+ // @ts-nocheck
2
+ import type { TemplateEmailInstanceAllOfTemplate } from './templateEmailInstanceAllOfTemplate';
3
+ import type { TemplateEmailInstanceAllOfRecipient } from './templateEmailInstanceAllOfRecipient';
4
+
5
+ export type TemplateEmailInstanceAllOf = {
6
+ /** @nullable */
7
+ Template?: TemplateEmailInstanceAllOfTemplate;
8
+ /** @nullable */
9
+ Recipient?: TemplateEmailInstanceAllOfRecipient;
10
+ /**
11
+ * @maxLength 50
12
+ * @nullable
13
+ */
14
+ UniqueMessageId?: string | null;
15
+ /**
16
+ * @maxLength 1000
17
+ * @nullable
18
+ */
19
+ Subject?: string | null;
20
+ /**
21
+ * @maxLength 250
22
+ * @nullable
23
+ */
24
+ FromEmail?: string | null;
25
+ /**
26
+ * @maxLength 250
27
+ * @nullable
28
+ */
29
+ FromName?: string | null;
30
+ SendDateTime?: string;
31
+ /** @nullable */
32
+ ProcessDateTime?: string | null;
33
+ /** @nullable */
34
+ DeliverDateTime?: string | null;
35
+ /** @nullable */
36
+ BounceDateTime?: string | null;
37
+ /** @nullable */
38
+ SpamDateTime?: string | null;
39
+ /** @nullable */
40
+ OpenDateTime?: string | null;
41
+ /** @nullable */
42
+ ClickDateTime?: string | null;
43
+ /** @nullable */
44
+ UnsubscribeDateTime?: string | null;
45
+ /** @nullable */
46
+ SendError?: string | null;
47
+ };
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck
2
+ import type { Person } from './person';
3
+
4
+ /**
5
+ * @nullable
6
+ */
7
+ export type TemplateEmailInstanceAllOfRecipient = Person | null;
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck
2
+ import type { Template } from './template';
3
+
4
+ /**
5
+ * @nullable
6
+ */
7
+ export type TemplateEmailInstanceAllOfTemplate = Template | null;
@@ -0,0 +1,8 @@
1
+ // @ts-nocheck
2
+ import type { CollectionMetadata } from './collectionMetadata';
3
+ import type { TemplateEmailInstance } from './templateEmailInstance';
4
+
5
+ export type TemplateGetAllTemplateEmails200 = {
6
+ metadata?: CollectionMetadata;
7
+ items?: TemplateEmailInstance[];
8
+ };
@@ -0,0 +1,14 @@
1
+ // @ts-nocheck
2
+ import type { LimitParameter } from './limitParameter';
3
+ import type { OffsetParameter } from './offsetParameter';
4
+
5
+ export type TemplateGetAllTemplateEmailsParams = {
6
+ /**
7
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
8
+ */
9
+ limit?: LimitParameter;
10
+ /**
11
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
12
+ */
13
+ offset?: OffsetParameter;
14
+ };
@@ -0,0 +1,8 @@
1
+ // @ts-nocheck
2
+ import type { CollectionMetadata } from './collectionMetadata';
3
+ import type { TemplateEmailInstance } from './templateEmailInstance';
4
+
5
+ export type TemplateGetTemplateEmails200 = {
6
+ metadata?: CollectionMetadata;
7
+ items?: TemplateEmailInstance[];
8
+ };
@@ -0,0 +1,14 @@
1
+ // @ts-nocheck
2
+ import type { LimitParameter } from './limitParameter';
3
+ import type { OffsetParameter } from './offsetParameter';
4
+
5
+ export type TemplateGetTemplateEmailsParams = {
6
+ /**
7
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
8
+ */
9
+ limit?: LimitParameter;
10
+ /**
11
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
12
+ */
13
+ offset?: OffsetParameter;
14
+ };
@@ -0,0 +1,7 @@
1
+ // @ts-nocheck
2
+ import type { SendTemplateEmailRequest } from './sendTemplateEmailRequest';
3
+
4
+ /**
5
+ * @nullable
6
+ */
7
+ export type TemplateSendTemplateEmailBody = SendTemplateEmailRequest | null;
@@ -0,0 +1,188 @@
1
+ // @ts-nocheck
2
+ import type {
3
+ TemplateEmailInstance,
4
+ TemplateGetAllTemplateEmails200,
5
+ TemplateGetAllTemplateEmailsParams,
6
+ TemplateGetTemplateEmails200,
7
+ TemplateGetTemplateEmailsParams,
8
+ TemplateSendTemplateEmailBody
9
+ } from '.././models';
10
+
11
+ import { customFetch } from '../../client';
12
+
13
+ /**
14
+ * Filter with personUid to see what one person was sent, or with templateUid to
15
+ restrict the results to a single template.
16
+ * @summary The one-off emails that were sent from any email template.
17
+ */
18
+ export type templateGetAllTemplateEmailsResponse200 = {
19
+ data: TemplateGetAllTemplateEmails200
20
+ status: 200
21
+ }
22
+
23
+ export type templateGetAllTemplateEmailsResponse401 = {
24
+ data: void
25
+ status: 401
26
+ }
27
+
28
+ export type templateGetAllTemplateEmailsResponseSuccess = (templateGetAllTemplateEmailsResponse200) & {
29
+ headers: Headers;
30
+ };
31
+ export type templateGetAllTemplateEmailsResponseError = (templateGetAllTemplateEmailsResponse401) & {
32
+ headers: Headers;
33
+ };
34
+
35
+ export type templateGetAllTemplateEmailsResponse = (templateGetAllTemplateEmailsResponseSuccess | templateGetAllTemplateEmailsResponseError)
36
+
37
+ export const getTemplateGetAllTemplateEmailsUrl = (params?: TemplateGetAllTemplateEmailsParams,) => {
38
+ const normalizedParams = new URLSearchParams();
39
+
40
+ Object.entries(params || {}).forEach(([key, value]) => {
41
+
42
+ if (value !== undefined) {
43
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
44
+ }
45
+ });
46
+
47
+ const stringifiedParams = normalizedParams.toString();
48
+
49
+ return stringifiedParams.length > 0 ? `/api/v1/templates/emails?${stringifiedParams}` : `/api/v1/templates/emails`
50
+ }
51
+
52
+ export const templateGetAllTemplateEmails = async (params?: TemplateGetAllTemplateEmailsParams, options?: RequestInit): Promise<templateGetAllTemplateEmailsResponse> => {
53
+
54
+ return customFetch<templateGetAllTemplateEmailsResponse>(getTemplateGetAllTemplateEmailsUrl(params),
55
+ {
56
+ ...options,
57
+ method: 'GET'
58
+
59
+
60
+ }
61
+ );}
62
+
63
+
64
+ /**
65
+ * Add personUid to the query string to see what one person was sent from this
66
+ template.
67
+ * @summary The one-off emails that were sent from this email template.
68
+ */
69
+ export type templateGetTemplateEmailsResponse200 = {
70
+ data: TemplateGetTemplateEmails200
71
+ status: 200
72
+ }
73
+
74
+ export type templateGetTemplateEmailsResponse400 = {
75
+ data: void
76
+ status: 400
77
+ }
78
+
79
+ export type templateGetTemplateEmailsResponse401 = {
80
+ data: void
81
+ status: 401
82
+ }
83
+
84
+ export type templateGetTemplateEmailsResponse404 = {
85
+ data: void
86
+ status: 404
87
+ }
88
+
89
+ export type templateGetTemplateEmailsResponseSuccess = (templateGetTemplateEmailsResponse200) & {
90
+ headers: Headers;
91
+ };
92
+ export type templateGetTemplateEmailsResponseError = (templateGetTemplateEmailsResponse400 | templateGetTemplateEmailsResponse401 | templateGetTemplateEmailsResponse404) & {
93
+ headers: Headers;
94
+ };
95
+
96
+ export type templateGetTemplateEmailsResponse = (templateGetTemplateEmailsResponseSuccess | templateGetTemplateEmailsResponseError)
97
+
98
+ export const getTemplateGetTemplateEmailsUrl = (templateUid: string | null,
99
+ params?: TemplateGetTemplateEmailsParams,) => {
100
+ const normalizedParams = new URLSearchParams();
101
+
102
+ Object.entries(params || {}).forEach(([key, value]) => {
103
+
104
+ if (value !== undefined) {
105
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
106
+ }
107
+ });
108
+
109
+ const stringifiedParams = normalizedParams.toString();
110
+
111
+ return stringifiedParams.length > 0 ? `/api/v1/templates/${templateUid}/emails?${stringifiedParams}` : `/api/v1/templates/${templateUid}/emails`
112
+ }
113
+
114
+ export const templateGetTemplateEmails = async (templateUid: string | null,
115
+ params?: TemplateGetTemplateEmailsParams, options?: RequestInit): Promise<templateGetTemplateEmailsResponse> => {
116
+
117
+ return customFetch<templateGetTemplateEmailsResponse>(getTemplateGetTemplateEmailsUrl(templateUid,params),
118
+ {
119
+ ...options,
120
+ method: 'GET'
121
+
122
+
123
+ }
124
+ );}
125
+
126
+
127
+ /**
128
+ * The email is merge-rendered for the person and sent immediately. No broadcast
129
+ is created. People who have bounced, unsubscribed or reported spam are not sent
130
+ the email. Only templates from Email > Email templates can be sent.
131
+
132
+ The response holds the record of the send. Read the open and click analytics
133
+ for it later from the emails endpoint for the template. The template and the
134
+ recipient are left out of the response unless they are asked for, for example
135
+ fields=*,Template.Uid,Recipient.Uid.
136
+ * @summary Send an email template to a single person as a one-off email.
137
+ */
138
+ export type templateSendTemplateEmailResponse200 = {
139
+ data: TemplateEmailInstance
140
+ status: 200
141
+ }
142
+
143
+ export type templateSendTemplateEmailResponse400 = {
144
+ data: void
145
+ status: 400
146
+ }
147
+
148
+ export type templateSendTemplateEmailResponse401 = {
149
+ data: void
150
+ status: 401
151
+ }
152
+
153
+ export type templateSendTemplateEmailResponse404 = {
154
+ data: void
155
+ status: 404
156
+ }
157
+
158
+ export type templateSendTemplateEmailResponseSuccess = (templateSendTemplateEmailResponse200) & {
159
+ headers: Headers;
160
+ };
161
+ export type templateSendTemplateEmailResponseError = (templateSendTemplateEmailResponse400 | templateSendTemplateEmailResponse401 | templateSendTemplateEmailResponse404) & {
162
+ headers: Headers;
163
+ };
164
+
165
+ export type templateSendTemplateEmailResponse = (templateSendTemplateEmailResponseSuccess | templateSendTemplateEmailResponseError)
166
+
167
+ export const getTemplateSendTemplateEmailUrl = (templateUid: string | null,) => {
168
+
169
+
170
+
171
+
172
+ return `/api/v1/templates/${templateUid}/send`
173
+ }
174
+
175
+ export const templateSendTemplateEmail = async (templateUid: string | null,
176
+ templateSendTemplateEmailBody: TemplateSendTemplateEmailBody, options?: RequestInit): Promise<templateSendTemplateEmailResponse> => {
177
+
178
+ return customFetch<templateSendTemplateEmailResponse>(getTemplateSendTemplateEmailUrl(templateUid),
179
+ {
180
+ ...options,
181
+ method: 'POST',
182
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
183
+ body: JSON.stringify(
184
+ templateSendTemplateEmailBody,)
185
+ }
186
+ );}
187
+
188
+