@zyphr-dev/node-sdk 0.1.18 → 0.1.20
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 +2473 -200
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4376 -1787
- package/dist/index.d.ts +4376 -1787
- package/dist/index.js +2274 -195
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +40 -1
- package/src/client.ts +3 -0
- package/src/src/apis/AuthEmailTemplatesApi.ts +734 -0
- package/src/src/apis/ExecutionsApi.ts +225 -0
- package/src/src/apis/SlackApi.ts +264 -0
- package/src/src/apis/index.ts +3 -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/AuthEmailTemplatePreviewRequest.ts +65 -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/ExecutionCancelResponse.ts +88 -0
- package/src/src/models/ExecutionCancelResponseData.ts +83 -0
- package/src/src/models/ExecutionResponse.ts +88 -0
- package/src/src/models/ExecutionRetryResponse.ts +88 -0
- package/src/src/models/ExecutionRetryResponseData.ts +94 -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/WorkflowExecution.ts +201 -0
- package/src/src/models/WorkflowExecutionStatus.ts +56 -0
- package/src/src/models/WorkflowStepExecution.ts +184 -0
- package/src/src/models/WorkflowStepExecutionStatus.ts +57 -0
- package/src/src/models/index.ts +37 -1
|
@@ -0,0 +1,225 @@
|
|
|
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
|
+
ExecutionCancelResponse,
|
|
20
|
+
ExecutionResponse,
|
|
21
|
+
ExecutionRetryResponse,
|
|
22
|
+
} from '../models/index';
|
|
23
|
+
import {
|
|
24
|
+
ApiErrorFromJSON,
|
|
25
|
+
ApiErrorToJSON,
|
|
26
|
+
ExecutionCancelResponseFromJSON,
|
|
27
|
+
ExecutionCancelResponseToJSON,
|
|
28
|
+
ExecutionResponseFromJSON,
|
|
29
|
+
ExecutionResponseToJSON,
|
|
30
|
+
ExecutionRetryResponseFromJSON,
|
|
31
|
+
ExecutionRetryResponseToJSON,
|
|
32
|
+
} from '../models/index';
|
|
33
|
+
|
|
34
|
+
export interface ExecutionsApiCancelExecutionRequest {
|
|
35
|
+
id: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ExecutionsApiGetExecutionRequest {
|
|
39
|
+
id: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ExecutionsApiRetryExecutionRequest {
|
|
43
|
+
id: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* ExecutionsApi - interface
|
|
48
|
+
*
|
|
49
|
+
* @export
|
|
50
|
+
* @interface ExecutionsApiInterface
|
|
51
|
+
*/
|
|
52
|
+
export interface ExecutionsApiInterface {
|
|
53
|
+
/**
|
|
54
|
+
* Cancel a workflow execution that is still pending or running. Already-terminal executions cannot be cancelled.
|
|
55
|
+
* @summary Cancel a running execution
|
|
56
|
+
* @param {string} id Execution ID
|
|
57
|
+
* @param {*} [options] Override http request option.
|
|
58
|
+
* @throws {RequiredError}
|
|
59
|
+
* @memberof ExecutionsApiInterface
|
|
60
|
+
*/
|
|
61
|
+
cancelExecutionRaw(requestParameters: ExecutionsApiCancelExecutionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ExecutionCancelResponse>>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Cancel a workflow execution that is still pending or running. Already-terminal executions cannot be cancelled.
|
|
65
|
+
* Cancel a running execution
|
|
66
|
+
*/
|
|
67
|
+
cancelExecution(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ExecutionCancelResponse>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Retrieve a workflow execution by ID, including its step execution details.
|
|
71
|
+
* @summary Get a workflow execution
|
|
72
|
+
* @param {string} id Execution ID
|
|
73
|
+
* @param {*} [options] Override http request option.
|
|
74
|
+
* @throws {RequiredError}
|
|
75
|
+
* @memberof ExecutionsApiInterface
|
|
76
|
+
*/
|
|
77
|
+
getExecutionRaw(requestParameters: ExecutionsApiGetExecutionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ExecutionResponse>>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Retrieve a workflow execution by ID, including its step execution details.
|
|
81
|
+
* Get a workflow execution
|
|
82
|
+
*/
|
|
83
|
+
getExecution(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ExecutionResponse>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Create a new workflow execution that re-runs the same workflow with the original subscriber, payload, and sender. Only `failed` or `cancelled` executions can be retried.
|
|
87
|
+
* @summary Retry a failed or cancelled execution
|
|
88
|
+
* @param {string} id ID of the execution to retry
|
|
89
|
+
* @param {*} [options] Override http request option.
|
|
90
|
+
* @throws {RequiredError}
|
|
91
|
+
* @memberof ExecutionsApiInterface
|
|
92
|
+
*/
|
|
93
|
+
retryExecutionRaw(requestParameters: ExecutionsApiRetryExecutionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ExecutionRetryResponse>>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Create a new workflow execution that re-runs the same workflow with the original subscriber, payload, and sender. Only `failed` or `cancelled` executions can be retried.
|
|
97
|
+
* Retry a failed or cancelled execution
|
|
98
|
+
*/
|
|
99
|
+
retryExecution(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ExecutionRetryResponse>;
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
*/
|
|
106
|
+
export class ExecutionsApi extends runtime.BaseAPI implements ExecutionsApiInterface {
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Cancel a workflow execution that is still pending or running. Already-terminal executions cannot be cancelled.
|
|
110
|
+
* Cancel a running execution
|
|
111
|
+
*/
|
|
112
|
+
async cancelExecutionRaw(requestParameters: ExecutionsApiCancelExecutionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ExecutionCancelResponse>> {
|
|
113
|
+
if (requestParameters['id'] == null) {
|
|
114
|
+
throw new runtime.RequiredError(
|
|
115
|
+
'id',
|
|
116
|
+
'Required parameter "id" was null or undefined when calling cancelExecution().'
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const queryParameters: any = {};
|
|
121
|
+
|
|
122
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
123
|
+
|
|
124
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
125
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const response = await this.request({
|
|
129
|
+
path: `/executions/{id}/cancel`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
130
|
+
method: 'POST',
|
|
131
|
+
headers: headerParameters,
|
|
132
|
+
query: queryParameters,
|
|
133
|
+
}, initOverrides);
|
|
134
|
+
|
|
135
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecutionCancelResponseFromJSON(jsonValue));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Cancel a workflow execution that is still pending or running. Already-terminal executions cannot be cancelled.
|
|
140
|
+
* Cancel a running execution
|
|
141
|
+
*/
|
|
142
|
+
async cancelExecution(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ExecutionCancelResponse> {
|
|
143
|
+
const response = await this.cancelExecutionRaw({ id: id }, initOverrides);
|
|
144
|
+
return await response.value();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Retrieve a workflow execution by ID, including its step execution details.
|
|
149
|
+
* Get a workflow execution
|
|
150
|
+
*/
|
|
151
|
+
async getExecutionRaw(requestParameters: ExecutionsApiGetExecutionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ExecutionResponse>> {
|
|
152
|
+
if (requestParameters['id'] == null) {
|
|
153
|
+
throw new runtime.RequiredError(
|
|
154
|
+
'id',
|
|
155
|
+
'Required parameter "id" was null or undefined when calling getExecution().'
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const queryParameters: any = {};
|
|
160
|
+
|
|
161
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
162
|
+
|
|
163
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
164
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const response = await this.request({
|
|
168
|
+
path: `/executions/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
169
|
+
method: 'GET',
|
|
170
|
+
headers: headerParameters,
|
|
171
|
+
query: queryParameters,
|
|
172
|
+
}, initOverrides);
|
|
173
|
+
|
|
174
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecutionResponseFromJSON(jsonValue));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Retrieve a workflow execution by ID, including its step execution details.
|
|
179
|
+
* Get a workflow execution
|
|
180
|
+
*/
|
|
181
|
+
async getExecution(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ExecutionResponse> {
|
|
182
|
+
const response = await this.getExecutionRaw({ id: id }, initOverrides);
|
|
183
|
+
return await response.value();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Create a new workflow execution that re-runs the same workflow with the original subscriber, payload, and sender. Only `failed` or `cancelled` executions can be retried.
|
|
188
|
+
* Retry a failed or cancelled execution
|
|
189
|
+
*/
|
|
190
|
+
async retryExecutionRaw(requestParameters: ExecutionsApiRetryExecutionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ExecutionRetryResponse>> {
|
|
191
|
+
if (requestParameters['id'] == null) {
|
|
192
|
+
throw new runtime.RequiredError(
|
|
193
|
+
'id',
|
|
194
|
+
'Required parameter "id" was null or undefined when calling retryExecution().'
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const queryParameters: any = {};
|
|
199
|
+
|
|
200
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
201
|
+
|
|
202
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
203
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const response = await this.request({
|
|
207
|
+
path: `/executions/{id}/retry`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
208
|
+
method: 'POST',
|
|
209
|
+
headers: headerParameters,
|
|
210
|
+
query: queryParameters,
|
|
211
|
+
}, initOverrides);
|
|
212
|
+
|
|
213
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecutionRetryResponseFromJSON(jsonValue));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Create a new workflow execution that re-runs the same workflow with the original subscriber, payload, and sender. Only `failed` or `cancelled` executions can be retried.
|
|
218
|
+
* Retry a failed or cancelled execution
|
|
219
|
+
*/
|
|
220
|
+
async retryExecution(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ExecutionRetryResponse> {
|
|
221
|
+
const response = await this.retryExecutionRaw({ id: id }, initOverrides);
|
|
222
|
+
return await response.value();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
}
|
|
@@ -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';
|
|
@@ -13,9 +14,11 @@ export * from './AuthUserProfileApi';
|
|
|
13
14
|
export * from './AuthWebAuthnApi';
|
|
14
15
|
export * from './DevicesApi';
|
|
15
16
|
export * from './EmailsApi';
|
|
17
|
+
export * from './ExecutionsApi';
|
|
16
18
|
export * from './InboxApi';
|
|
17
19
|
export * from './PushApi';
|
|
18
20
|
export * from './SMSApi';
|
|
21
|
+
export * from './SlackApi';
|
|
19
22
|
export * from './SubscribersApi';
|
|
20
23
|
export * from './TemplatesApi';
|
|
21
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
|
+
|