@outseta/api-client 0.3.30 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outseta/api-client",
3
- "version": "0.3.30",
3
+ "version": "0.3.31",
4
4
  "description": "Generated API client for the Outseta REST API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -557,6 +557,7 @@ export * from './segmentPersonAllOfPerson';
557
557
  export * from './segmentPersonAllOfSegment';
558
558
  export * from './sendGridDomainAuthentication';
559
559
  export * from './sendGridDomainAuthenticationAllOf';
560
+ export * from './sendTemplateEmailRequest';
560
561
  export * from './sendTestEmailRequest';
561
562
  export * from './sendTestEmailRequest2';
562
563
  export * from './sendTestEmailRequest2BroadcastCampaign';
@@ -715,6 +716,15 @@ export * from './taxRateAllOf';
715
716
  export * from './teamRole';
716
717
  export * from './template';
717
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';
718
728
  export * from './temporaryPasswordModel';
719
729
  export * from './tokenPayload';
720
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
+