@zyphr-dev/node-sdk 0.1.19 → 0.1.21
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.cjs +1964 -190
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3178 -1137
- package/dist/index.d.ts +3178 -1137
- package/dist/index.js +1811 -185
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +31 -1
- package/src/client.ts +3 -0
- package/src/src/apis/AuthEmailTemplatesApi.ts +734 -0
- package/src/src/apis/SlackApi.ts +264 -0
- package/src/src/apis/index.ts +2 -0
- package/src/src/models/AuthEmailTemplate.ts +181 -0
- package/src/src/models/AuthEmailTemplateDefault.ts +107 -0
- package/src/src/models/AuthEmailTemplateDefaultResponse.ts +88 -0
- package/src/src/models/AuthEmailTemplateDeleteResponse.ts +88 -0
- package/src/src/models/{SuccessResultData.ts → AuthEmailTemplateDeleteResponseData.ts} +11 -11
- package/src/src/models/AuthEmailTemplateListResponse.ts +88 -0
- package/src/src/models/AuthEmailTemplatePreviewDraft.ts +108 -0
- package/src/src/models/AuthEmailTemplatePreviewRequest.ts +81 -0
- package/src/src/models/AuthEmailTemplatePreviewResponse.ts +88 -0
- package/src/src/models/AuthEmailTemplatePreviewResult.ts +97 -0
- package/src/src/models/AuthEmailTemplateResponse.ts +88 -0
- package/src/src/models/AuthEmailTemplateTestRequest.ts +74 -0
- package/src/src/models/AuthEmailTemplateTestResponse.ts +88 -0
- package/src/src/models/AuthEmailTemplateTestResult.ts +73 -0
- package/src/src/models/AuthEmailTemplateVersion.ts +157 -0
- package/src/src/models/AuthEmailTemplateVersionsResponse.ts +88 -0
- package/src/src/models/AuthEmailType.ts +54 -0
- package/src/src/models/BulkUpsertAuthEmailTemplatesRequest.ts +91 -0
- package/src/src/models/BulkUpsertAuthEmailTemplatesResponse.ts +88 -0
- package/src/src/models/ResubscribeResponse.ts +10 -10
- package/src/src/models/SendSlackMessageRequest.ts +156 -0
- package/src/src/models/SendSlackMessageResponse.ts +88 -0
- package/src/src/models/SendSlackMessageResult.ts +115 -0
- package/src/src/models/SlackMessage.ts +203 -0
- package/src/src/models/SlackMessageListResponse.ts +88 -0
- package/src/src/models/SlackMessageListResponseMeta.ts +89 -0
- package/src/src/models/SlackMessageResponse.ts +88 -0
- package/src/src/models/SlackMessageStatus.ts +56 -0
- package/src/src/models/SlackMessageSummary.ts +155 -0
- package/src/src/models/SuccessResult.ts +10 -10
- package/src/src/models/UpsertAuthEmailTemplateRequest.ts +143 -0
- package/src/src/models/index.ts +29 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Zyphr API
|
|
5
|
+
* Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@zyphr.dev
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
ApiError,
|
|
19
|
+
SendSlackMessageRequest,
|
|
20
|
+
SendSlackMessageResponse,
|
|
21
|
+
SlackMessageListResponse,
|
|
22
|
+
SlackMessageResponse,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
import {
|
|
25
|
+
ApiErrorFromJSON,
|
|
26
|
+
ApiErrorToJSON,
|
|
27
|
+
SendSlackMessageRequestFromJSON,
|
|
28
|
+
SendSlackMessageRequestToJSON,
|
|
29
|
+
SendSlackMessageResponseFromJSON,
|
|
30
|
+
SendSlackMessageResponseToJSON,
|
|
31
|
+
SlackMessageListResponseFromJSON,
|
|
32
|
+
SlackMessageListResponseToJSON,
|
|
33
|
+
SlackMessageResponseFromJSON,
|
|
34
|
+
SlackMessageResponseToJSON,
|
|
35
|
+
} from '../models/index';
|
|
36
|
+
|
|
37
|
+
export interface SlackApiGetSlackMessageRequest {
|
|
38
|
+
id: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface SlackApiListSlackMessagesRequest {
|
|
42
|
+
connectionId?: string;
|
|
43
|
+
channelId?: string;
|
|
44
|
+
status?: ListSlackMessagesStatusEnum;
|
|
45
|
+
limit?: number;
|
|
46
|
+
offset?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface SlackApiSendSlackMessageOperationRequest {
|
|
50
|
+
sendSlackMessageRequest: SendSlackMessageRequest;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* SlackApi - interface
|
|
55
|
+
*
|
|
56
|
+
* @export
|
|
57
|
+
* @interface SlackApiInterface
|
|
58
|
+
*/
|
|
59
|
+
export interface SlackApiInterface {
|
|
60
|
+
/**
|
|
61
|
+
* Retrieve a single Slack message by ID, including its full block/attachment payload and status timestamps.
|
|
62
|
+
* @summary Get a Slack message
|
|
63
|
+
* @param {string} id
|
|
64
|
+
* @param {*} [options] Override http request option.
|
|
65
|
+
* @throws {RequiredError}
|
|
66
|
+
* @memberof SlackApiInterface
|
|
67
|
+
*/
|
|
68
|
+
getSlackMessageRaw(requestParameters: SlackApiGetSlackMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SlackMessageResponse>>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Retrieve a single Slack message by ID, including its full block/attachment payload and status timestamps.
|
|
72
|
+
* Get a Slack message
|
|
73
|
+
*/
|
|
74
|
+
getSlackMessage(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SlackMessageResponse>;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* List Slack messages sent through the project, with optional filtering by connection, channel, and status.
|
|
78
|
+
* @summary List Slack messages
|
|
79
|
+
* @param {string} [connectionId] Filter by Slack connection ID.
|
|
80
|
+
* @param {string} [channelId] Filter by Slack channel ID.
|
|
81
|
+
* @param {'queued' | 'sending' | 'sent' | 'delivered' | 'failed'} [status] Filter by message status.
|
|
82
|
+
* @param {number} [limit]
|
|
83
|
+
* @param {number} [offset]
|
|
84
|
+
* @param {*} [options] Override http request option.
|
|
85
|
+
* @throws {RequiredError}
|
|
86
|
+
* @memberof SlackApiInterface
|
|
87
|
+
*/
|
|
88
|
+
listSlackMessagesRaw(requestParameters: SlackApiListSlackMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SlackMessageListResponse>>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* List Slack messages sent through the project, with optional filtering by connection, channel, and status.
|
|
92
|
+
* List Slack messages
|
|
93
|
+
*/
|
|
94
|
+
listSlackMessages(connectionId?: string, channelId?: string, status?: ListSlackMessagesStatusEnum, limit?: number, offset?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SlackMessageListResponse>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Send a message to a Slack channel through a connected Slack workspace. Either `text` or `blocks` must be provided. If `connection_id` is omitted, the project\'s active Slack connection is used. If `channel` is omitted, the connection\'s default channel is used.
|
|
98
|
+
* @summary Send a Slack message
|
|
99
|
+
* @param {SendSlackMessageRequest} sendSlackMessageRequest
|
|
100
|
+
* @param {*} [options] Override http request option.
|
|
101
|
+
* @throws {RequiredError}
|
|
102
|
+
* @memberof SlackApiInterface
|
|
103
|
+
*/
|
|
104
|
+
sendSlackMessageRaw(requestParameters: SlackApiSendSlackMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SendSlackMessageResponse>>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Send a message to a Slack channel through a connected Slack workspace. Either `text` or `blocks` must be provided. If `connection_id` is omitted, the project\'s active Slack connection is used. If `channel` is omitted, the connection\'s default channel is used.
|
|
108
|
+
* Send a Slack message
|
|
109
|
+
*/
|
|
110
|
+
sendSlackMessage(sendSlackMessageRequest: SendSlackMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SendSlackMessageResponse>;
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
*/
|
|
117
|
+
export class SlackApi extends runtime.BaseAPI implements SlackApiInterface {
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Retrieve a single Slack message by ID, including its full block/attachment payload and status timestamps.
|
|
121
|
+
* Get a Slack message
|
|
122
|
+
*/
|
|
123
|
+
async getSlackMessageRaw(requestParameters: SlackApiGetSlackMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SlackMessageResponse>> {
|
|
124
|
+
if (requestParameters['id'] == null) {
|
|
125
|
+
throw new runtime.RequiredError(
|
|
126
|
+
'id',
|
|
127
|
+
'Required parameter "id" was null or undefined when calling getSlackMessage().'
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const queryParameters: any = {};
|
|
132
|
+
|
|
133
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
134
|
+
|
|
135
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
136
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const response = await this.request({
|
|
140
|
+
path: `/slack/messages/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
141
|
+
method: 'GET',
|
|
142
|
+
headers: headerParameters,
|
|
143
|
+
query: queryParameters,
|
|
144
|
+
}, initOverrides);
|
|
145
|
+
|
|
146
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SlackMessageResponseFromJSON(jsonValue));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Retrieve a single Slack message by ID, including its full block/attachment payload and status timestamps.
|
|
151
|
+
* Get a Slack message
|
|
152
|
+
*/
|
|
153
|
+
async getSlackMessage(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SlackMessageResponse> {
|
|
154
|
+
const response = await this.getSlackMessageRaw({ id: id }, initOverrides);
|
|
155
|
+
return await response.value();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* List Slack messages sent through the project, with optional filtering by connection, channel, and status.
|
|
160
|
+
* List Slack messages
|
|
161
|
+
*/
|
|
162
|
+
async listSlackMessagesRaw(requestParameters: SlackApiListSlackMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SlackMessageListResponse>> {
|
|
163
|
+
const queryParameters: any = {};
|
|
164
|
+
|
|
165
|
+
if (requestParameters['connectionId'] != null) {
|
|
166
|
+
queryParameters['connection_id'] = requestParameters['connectionId'];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (requestParameters['channelId'] != null) {
|
|
170
|
+
queryParameters['channel_id'] = requestParameters['channelId'];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (requestParameters['status'] != null) {
|
|
174
|
+
queryParameters['status'] = requestParameters['status'];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (requestParameters['limit'] != null) {
|
|
178
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (requestParameters['offset'] != null) {
|
|
182
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
186
|
+
|
|
187
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
188
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const response = await this.request({
|
|
192
|
+
path: `/slack/messages`,
|
|
193
|
+
method: 'GET',
|
|
194
|
+
headers: headerParameters,
|
|
195
|
+
query: queryParameters,
|
|
196
|
+
}, initOverrides);
|
|
197
|
+
|
|
198
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SlackMessageListResponseFromJSON(jsonValue));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* List Slack messages sent through the project, with optional filtering by connection, channel, and status.
|
|
203
|
+
* List Slack messages
|
|
204
|
+
*/
|
|
205
|
+
async listSlackMessages(connectionId?: string, channelId?: string, status?: ListSlackMessagesStatusEnum, limit?: number, offset?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SlackMessageListResponse> {
|
|
206
|
+
const response = await this.listSlackMessagesRaw({ connectionId: connectionId, channelId: channelId, status: status, limit: limit, offset: offset }, initOverrides);
|
|
207
|
+
return await response.value();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Send a message to a Slack channel through a connected Slack workspace. Either `text` or `blocks` must be provided. If `connection_id` is omitted, the project\'s active Slack connection is used. If `channel` is omitted, the connection\'s default channel is used.
|
|
212
|
+
* Send a Slack message
|
|
213
|
+
*/
|
|
214
|
+
async sendSlackMessageRaw(requestParameters: SlackApiSendSlackMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SendSlackMessageResponse>> {
|
|
215
|
+
if (requestParameters['sendSlackMessageRequest'] == null) {
|
|
216
|
+
throw new runtime.RequiredError(
|
|
217
|
+
'sendSlackMessageRequest',
|
|
218
|
+
'Required parameter "sendSlackMessageRequest" was null or undefined when calling sendSlackMessage().'
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const queryParameters: any = {};
|
|
223
|
+
|
|
224
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
225
|
+
|
|
226
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
227
|
+
|
|
228
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
229
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const response = await this.request({
|
|
233
|
+
path: `/slack/send`,
|
|
234
|
+
method: 'POST',
|
|
235
|
+
headers: headerParameters,
|
|
236
|
+
query: queryParameters,
|
|
237
|
+
body: SendSlackMessageRequestToJSON(requestParameters['sendSlackMessageRequest']),
|
|
238
|
+
}, initOverrides);
|
|
239
|
+
|
|
240
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SendSlackMessageResponseFromJSON(jsonValue));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Send a message to a Slack channel through a connected Slack workspace. Either `text` or `blocks` must be provided. If `connection_id` is omitted, the project\'s active Slack connection is used. If `channel` is omitted, the connection\'s default channel is used.
|
|
245
|
+
* Send a Slack message
|
|
246
|
+
*/
|
|
247
|
+
async sendSlackMessage(sendSlackMessageRequest: SendSlackMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SendSlackMessageResponse> {
|
|
248
|
+
const response = await this.sendSlackMessageRaw({ sendSlackMessageRequest: sendSlackMessageRequest }, initOverrides);
|
|
249
|
+
return await response.value();
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @export
|
|
256
|
+
*/
|
|
257
|
+
export const ListSlackMessagesStatusEnum = {
|
|
258
|
+
QUEUED: 'queued',
|
|
259
|
+
SENDING: 'sending',
|
|
260
|
+
SENT: 'sent',
|
|
261
|
+
DELIVERED: 'delivered',
|
|
262
|
+
FAILED: 'failed'
|
|
263
|
+
} as const;
|
|
264
|
+
export type ListSlackMessagesStatusEnum = typeof ListSlackMessagesStatusEnum[keyof typeof ListSlackMessagesStatusEnum];
|
package/src/src/apis/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export * from './AuthEmailTemplatesApi';
|
|
3
4
|
export * from './AuthEmailVerificationApi';
|
|
4
5
|
export * from './AuthLoginApi';
|
|
5
6
|
export * from './AuthMFAApi';
|
|
@@ -17,6 +18,7 @@ export * from './ExecutionsApi';
|
|
|
17
18
|
export * from './InboxApi';
|
|
18
19
|
export * from './PushApi';
|
|
19
20
|
export * from './SMSApi';
|
|
21
|
+
export * from './SlackApi';
|
|
20
22
|
export * from './SubscribersApi';
|
|
21
23
|
export * from './TemplatesApi';
|
|
22
24
|
export * from './TopicsApi';
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Zyphr API
|
|
5
|
+
* Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@zyphr.dev
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { AuthEmailType } from './AuthEmailType';
|
|
17
|
+
import {
|
|
18
|
+
AuthEmailTypeFromJSON,
|
|
19
|
+
AuthEmailTypeFromJSONTyped,
|
|
20
|
+
AuthEmailTypeToJSON,
|
|
21
|
+
AuthEmailTypeToJSONTyped,
|
|
22
|
+
} from './AuthEmailType';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface AuthEmailTemplate
|
|
28
|
+
*/
|
|
29
|
+
export interface AuthEmailTemplate {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {AuthEmailType}
|
|
33
|
+
* @memberof AuthEmailTemplate
|
|
34
|
+
*/
|
|
35
|
+
emailType?: AuthEmailType;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof AuthEmailTemplate
|
|
40
|
+
*/
|
|
41
|
+
subject?: string;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof AuthEmailTemplate
|
|
46
|
+
*/
|
|
47
|
+
html?: string;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof AuthEmailTemplate
|
|
52
|
+
*/
|
|
53
|
+
text?: string | null;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {string}
|
|
57
|
+
* @memberof AuthEmailTemplate
|
|
58
|
+
*/
|
|
59
|
+
mjmlSource?: string | null;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @type {{ [key: string]: any; }}
|
|
63
|
+
* @memberof AuthEmailTemplate
|
|
64
|
+
*/
|
|
65
|
+
designJson?: { [key: string]: any; } | null;
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @type {string}
|
|
69
|
+
* @memberof AuthEmailTemplate
|
|
70
|
+
*/
|
|
71
|
+
editorType?: AuthEmailTemplateEditorTypeEnum | null;
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @type {string}
|
|
75
|
+
* @memberof AuthEmailTemplate
|
|
76
|
+
*/
|
|
77
|
+
fromName?: string | null;
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @type {string}
|
|
81
|
+
* @memberof AuthEmailTemplate
|
|
82
|
+
*/
|
|
83
|
+
replyTo?: string | null;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* @type {boolean}
|
|
87
|
+
* @memberof AuthEmailTemplate
|
|
88
|
+
*/
|
|
89
|
+
isEnabled?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* True when the system default is being returned (no override exists)
|
|
92
|
+
* @type {boolean}
|
|
93
|
+
* @memberof AuthEmailTemplate
|
|
94
|
+
*/
|
|
95
|
+
isDefault?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
* @type {boolean}
|
|
99
|
+
* @memberof AuthEmailTemplate
|
|
100
|
+
*/
|
|
101
|
+
hasOverride?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* @type {number}
|
|
105
|
+
* @memberof AuthEmailTemplate
|
|
106
|
+
*/
|
|
107
|
+
version?: number | null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @export
|
|
113
|
+
*/
|
|
114
|
+
export const AuthEmailTemplateEditorTypeEnum = {
|
|
115
|
+
CODE: 'code',
|
|
116
|
+
MJML: 'mjml',
|
|
117
|
+
DESIGN: 'design'
|
|
118
|
+
} as const;
|
|
119
|
+
export type AuthEmailTemplateEditorTypeEnum = typeof AuthEmailTemplateEditorTypeEnum[keyof typeof AuthEmailTemplateEditorTypeEnum];
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Check if a given object implements the AuthEmailTemplate interface.
|
|
124
|
+
*/
|
|
125
|
+
export function instanceOfAuthEmailTemplate(value: object): value is AuthEmailTemplate {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function AuthEmailTemplateFromJSON(json: any): AuthEmailTemplate {
|
|
130
|
+
return AuthEmailTemplateFromJSONTyped(json, false);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function AuthEmailTemplateFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthEmailTemplate {
|
|
134
|
+
if (json == null) {
|
|
135
|
+
return json;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
|
|
139
|
+
'emailType': json['email_type'] == null ? undefined : AuthEmailTypeFromJSON(json['email_type']),
|
|
140
|
+
'subject': json['subject'] == null ? undefined : json['subject'],
|
|
141
|
+
'html': json['html'] == null ? undefined : json['html'],
|
|
142
|
+
'text': json['text'] == null ? undefined : json['text'],
|
|
143
|
+
'mjmlSource': json['mjml_source'] == null ? undefined : json['mjml_source'],
|
|
144
|
+
'designJson': json['design_json'] == null ? undefined : json['design_json'],
|
|
145
|
+
'editorType': json['editor_type'] == null ? undefined : json['editor_type'],
|
|
146
|
+
'fromName': json['from_name'] == null ? undefined : json['from_name'],
|
|
147
|
+
'replyTo': json['reply_to'] == null ? undefined : json['reply_to'],
|
|
148
|
+
'isEnabled': json['is_enabled'] == null ? undefined : json['is_enabled'],
|
|
149
|
+
'isDefault': json['is_default'] == null ? undefined : json['is_default'],
|
|
150
|
+
'hasOverride': json['has_override'] == null ? undefined : json['has_override'],
|
|
151
|
+
'version': json['version'] == null ? undefined : json['version'],
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function AuthEmailTemplateToJSON(json: any): AuthEmailTemplate {
|
|
156
|
+
return AuthEmailTemplateToJSONTyped(json, false);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function AuthEmailTemplateToJSONTyped(value?: AuthEmailTemplate | null, ignoreDiscriminator: boolean = false): any {
|
|
160
|
+
if (value == null) {
|
|
161
|
+
return value;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
|
|
166
|
+
'email_type': AuthEmailTypeToJSON(value['emailType']),
|
|
167
|
+
'subject': value['subject'],
|
|
168
|
+
'html': value['html'],
|
|
169
|
+
'text': value['text'],
|
|
170
|
+
'mjml_source': value['mjmlSource'],
|
|
171
|
+
'design_json': value['designJson'],
|
|
172
|
+
'editor_type': value['editorType'],
|
|
173
|
+
'from_name': value['fromName'],
|
|
174
|
+
'reply_to': value['replyTo'],
|
|
175
|
+
'is_enabled': value['isEnabled'],
|
|
176
|
+
'is_default': value['isDefault'],
|
|
177
|
+
'has_override': value['hasOverride'],
|
|
178
|
+
'version': value['version'],
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Zyphr API
|
|
5
|
+
* Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@zyphr.dev
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { AuthEmailType } from './AuthEmailType';
|
|
17
|
+
import {
|
|
18
|
+
AuthEmailTypeFromJSON,
|
|
19
|
+
AuthEmailTypeFromJSONTyped,
|
|
20
|
+
AuthEmailTypeToJSON,
|
|
21
|
+
AuthEmailTypeToJSONTyped,
|
|
22
|
+
} from './AuthEmailType';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface AuthEmailTemplateDefault
|
|
28
|
+
*/
|
|
29
|
+
export interface AuthEmailTemplateDefault {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {AuthEmailType}
|
|
33
|
+
* @memberof AuthEmailTemplateDefault
|
|
34
|
+
*/
|
|
35
|
+
emailType?: AuthEmailType;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof AuthEmailTemplateDefault
|
|
40
|
+
*/
|
|
41
|
+
subject?: string;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof AuthEmailTemplateDefault
|
|
46
|
+
*/
|
|
47
|
+
html?: string;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof AuthEmailTemplateDefault
|
|
52
|
+
*/
|
|
53
|
+
text?: string | null;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {Array<string>}
|
|
57
|
+
* @memberof AuthEmailTemplateDefault
|
|
58
|
+
*/
|
|
59
|
+
variables?: Array<string>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Check if a given object implements the AuthEmailTemplateDefault interface.
|
|
66
|
+
*/
|
|
67
|
+
export function instanceOfAuthEmailTemplateDefault(value: object): value is AuthEmailTemplateDefault {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function AuthEmailTemplateDefaultFromJSON(json: any): AuthEmailTemplateDefault {
|
|
72
|
+
return AuthEmailTemplateDefaultFromJSONTyped(json, false);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function AuthEmailTemplateDefaultFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthEmailTemplateDefault {
|
|
76
|
+
if (json == null) {
|
|
77
|
+
return json;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
|
|
81
|
+
'emailType': json['email_type'] == null ? undefined : AuthEmailTypeFromJSON(json['email_type']),
|
|
82
|
+
'subject': json['subject'] == null ? undefined : json['subject'],
|
|
83
|
+
'html': json['html'] == null ? undefined : json['html'],
|
|
84
|
+
'text': json['text'] == null ? undefined : json['text'],
|
|
85
|
+
'variables': json['variables'] == null ? undefined : json['variables'],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function AuthEmailTemplateDefaultToJSON(json: any): AuthEmailTemplateDefault {
|
|
90
|
+
return AuthEmailTemplateDefaultToJSONTyped(json, false);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function AuthEmailTemplateDefaultToJSONTyped(value?: AuthEmailTemplateDefault | null, ignoreDiscriminator: boolean = false): any {
|
|
94
|
+
if (value == null) {
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
|
|
100
|
+
'email_type': AuthEmailTypeToJSON(value['emailType']),
|
|
101
|
+
'subject': value['subject'],
|
|
102
|
+
'html': value['html'],
|
|
103
|
+
'text': value['text'],
|
|
104
|
+
'variables': value['variables'],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Zyphr API
|
|
5
|
+
* Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@zyphr.dev
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { RequestMeta } from './RequestMeta';
|
|
17
|
+
import {
|
|
18
|
+
RequestMetaFromJSON,
|
|
19
|
+
RequestMetaFromJSONTyped,
|
|
20
|
+
RequestMetaToJSON,
|
|
21
|
+
RequestMetaToJSONTyped,
|
|
22
|
+
} from './RequestMeta';
|
|
23
|
+
import type { AuthEmailTemplateDefault } from './AuthEmailTemplateDefault';
|
|
24
|
+
import {
|
|
25
|
+
AuthEmailTemplateDefaultFromJSON,
|
|
26
|
+
AuthEmailTemplateDefaultFromJSONTyped,
|
|
27
|
+
AuthEmailTemplateDefaultToJSON,
|
|
28
|
+
AuthEmailTemplateDefaultToJSONTyped,
|
|
29
|
+
} from './AuthEmailTemplateDefault';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @interface AuthEmailTemplateDefaultResponse
|
|
35
|
+
*/
|
|
36
|
+
export interface AuthEmailTemplateDefaultResponse {
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {AuthEmailTemplateDefault}
|
|
40
|
+
* @memberof AuthEmailTemplateDefaultResponse
|
|
41
|
+
*/
|
|
42
|
+
data?: AuthEmailTemplateDefault;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {RequestMeta}
|
|
46
|
+
* @memberof AuthEmailTemplateDefaultResponse
|
|
47
|
+
*/
|
|
48
|
+
meta?: RequestMeta;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Check if a given object implements the AuthEmailTemplateDefaultResponse interface.
|
|
53
|
+
*/
|
|
54
|
+
export function instanceOfAuthEmailTemplateDefaultResponse(value: object): value is AuthEmailTemplateDefaultResponse {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function AuthEmailTemplateDefaultResponseFromJSON(json: any): AuthEmailTemplateDefaultResponse {
|
|
59
|
+
return AuthEmailTemplateDefaultResponseFromJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function AuthEmailTemplateDefaultResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthEmailTemplateDefaultResponse {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
|
|
68
|
+
'data': json['data'] == null ? undefined : AuthEmailTemplateDefaultFromJSON(json['data']),
|
|
69
|
+
'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function AuthEmailTemplateDefaultResponseToJSON(json: any): AuthEmailTemplateDefaultResponse {
|
|
74
|
+
return AuthEmailTemplateDefaultResponseToJSONTyped(json, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function AuthEmailTemplateDefaultResponseToJSONTyped(value?: AuthEmailTemplateDefaultResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
78
|
+
if (value == null) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'data': AuthEmailTemplateDefaultToJSON(value['data']),
|
|
85
|
+
'meta': RequestMetaToJSON(value['meta']),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|