@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.
Files changed (53) hide show
  1. package/dist/index.cjs +2473 -200
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +4376 -1787
  4. package/dist/index.d.ts +4376 -1787
  5. package/dist/index.js +2274 -195
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/.openapi-generator/FILES +40 -1
  9. package/src/client.ts +3 -0
  10. package/src/src/apis/AuthEmailTemplatesApi.ts +734 -0
  11. package/src/src/apis/ExecutionsApi.ts +225 -0
  12. package/src/src/apis/SlackApi.ts +264 -0
  13. package/src/src/apis/index.ts +3 -0
  14. package/src/src/models/AuthEmailTemplate.ts +181 -0
  15. package/src/src/models/AuthEmailTemplateDefault.ts +107 -0
  16. package/src/src/models/AuthEmailTemplateDefaultResponse.ts +88 -0
  17. package/src/src/models/AuthEmailTemplateDeleteResponse.ts +88 -0
  18. package/src/src/models/{SuccessResultData.ts → AuthEmailTemplateDeleteResponseData.ts} +11 -11
  19. package/src/src/models/AuthEmailTemplateListResponse.ts +88 -0
  20. package/src/src/models/AuthEmailTemplatePreviewRequest.ts +65 -0
  21. package/src/src/models/AuthEmailTemplatePreviewResponse.ts +88 -0
  22. package/src/src/models/AuthEmailTemplatePreviewResult.ts +97 -0
  23. package/src/src/models/AuthEmailTemplateResponse.ts +88 -0
  24. package/src/src/models/AuthEmailTemplateTestRequest.ts +74 -0
  25. package/src/src/models/AuthEmailTemplateTestResponse.ts +88 -0
  26. package/src/src/models/AuthEmailTemplateTestResult.ts +73 -0
  27. package/src/src/models/AuthEmailTemplateVersion.ts +157 -0
  28. package/src/src/models/AuthEmailTemplateVersionsResponse.ts +88 -0
  29. package/src/src/models/AuthEmailType.ts +54 -0
  30. package/src/src/models/BulkUpsertAuthEmailTemplatesRequest.ts +91 -0
  31. package/src/src/models/BulkUpsertAuthEmailTemplatesResponse.ts +88 -0
  32. package/src/src/models/ExecutionCancelResponse.ts +88 -0
  33. package/src/src/models/ExecutionCancelResponseData.ts +83 -0
  34. package/src/src/models/ExecutionResponse.ts +88 -0
  35. package/src/src/models/ExecutionRetryResponse.ts +88 -0
  36. package/src/src/models/ExecutionRetryResponseData.ts +94 -0
  37. package/src/src/models/ResubscribeResponse.ts +10 -10
  38. package/src/src/models/SendSlackMessageRequest.ts +156 -0
  39. package/src/src/models/SendSlackMessageResponse.ts +88 -0
  40. package/src/src/models/SendSlackMessageResult.ts +115 -0
  41. package/src/src/models/SlackMessage.ts +203 -0
  42. package/src/src/models/SlackMessageListResponse.ts +88 -0
  43. package/src/src/models/SlackMessageListResponseMeta.ts +89 -0
  44. package/src/src/models/SlackMessageResponse.ts +88 -0
  45. package/src/src/models/SlackMessageStatus.ts +56 -0
  46. package/src/src/models/SlackMessageSummary.ts +155 -0
  47. package/src/src/models/SuccessResult.ts +10 -10
  48. package/src/src/models/UpsertAuthEmailTemplateRequest.ts +143 -0
  49. package/src/src/models/WorkflowExecution.ts +201 -0
  50. package/src/src/models/WorkflowExecutionStatus.ts +56 -0
  51. package/src/src/models/WorkflowStepExecution.ts +184 -0
  52. package/src/src/models/WorkflowStepExecutionStatus.ts +57 -0
  53. package/src/src/models/index.ts +37 -1
@@ -0,0 +1,156 @@
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
+ /**
17
+ * Either `text` or `blocks` must be provided. If `connection_id` is omitted,
18
+ * the project's default Slack connection is used. If `channel` is omitted,
19
+ * the connection's default channel is used.
20
+ *
21
+ * @export
22
+ * @interface SendSlackMessageRequest
23
+ */
24
+ export interface SendSlackMessageRequest {
25
+ /**
26
+ * ID of the Slack connection to send through. Defaults to the project's active connection.
27
+ * @type {string}
28
+ * @memberof SendSlackMessageRequest
29
+ */
30
+ connectionId?: string;
31
+ /**
32
+ * Slack channel ID (e.g. `C0123456789`). Falls back to the connection's default channel.
33
+ * @type {string}
34
+ * @memberof SendSlackMessageRequest
35
+ */
36
+ channel?: string;
37
+ /**
38
+ * Message text. Supports Slack markdown when `mrkdwn` is true.
39
+ * @type {string}
40
+ * @memberof SendSlackMessageRequest
41
+ */
42
+ text?: string;
43
+ /**
44
+ * Slack Block Kit blocks for rich formatting.
45
+ * @type {Array<{ [key: string]: any; }>}
46
+ * @memberof SendSlackMessageRequest
47
+ */
48
+ blocks?: Array<{ [key: string]: any; }>;
49
+ /**
50
+ * Slack message attachments (legacy formatting).
51
+ * @type {Array<{ [key: string]: any; }>}
52
+ * @memberof SendSlackMessageRequest
53
+ */
54
+ attachments?: Array<{ [key: string]: any; }>;
55
+ /**
56
+ * Thread timestamp to reply in a thread.
57
+ * @type {string}
58
+ * @memberof SendSlackMessageRequest
59
+ */
60
+ threadTs?: string;
61
+ /**
62
+ * Also post thread replies to the channel.
63
+ * @type {boolean}
64
+ * @memberof SendSlackMessageRequest
65
+ */
66
+ replyBroadcast?: boolean;
67
+ /**
68
+ * Enable link previews.
69
+ * @type {boolean}
70
+ * @memberof SendSlackMessageRequest
71
+ */
72
+ unfurlLinks?: boolean;
73
+ /**
74
+ * Enable media previews.
75
+ * @type {boolean}
76
+ * @memberof SendSlackMessageRequest
77
+ */
78
+ unfurlMedia?: boolean;
79
+ /**
80
+ * Enable Slack markdown processing.
81
+ * @type {boolean}
82
+ * @memberof SendSlackMessageRequest
83
+ */
84
+ mrkdwn?: boolean;
85
+ /**
86
+ * Custom metadata to attach to the message.
87
+ * @type {{ [key: string]: any; }}
88
+ * @memberof SendSlackMessageRequest
89
+ */
90
+ metadata?: { [key: string]: any; };
91
+ /**
92
+ * Tags for message categorisation.
93
+ * @type {Array<string>}
94
+ * @memberof SendSlackMessageRequest
95
+ */
96
+ tags?: Array<string>;
97
+ }
98
+
99
+ /**
100
+ * Check if a given object implements the SendSlackMessageRequest interface.
101
+ */
102
+ export function instanceOfSendSlackMessageRequest(value: object): value is SendSlackMessageRequest {
103
+ return true;
104
+ }
105
+
106
+ export function SendSlackMessageRequestFromJSON(json: any): SendSlackMessageRequest {
107
+ return SendSlackMessageRequestFromJSONTyped(json, false);
108
+ }
109
+
110
+ export function SendSlackMessageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SendSlackMessageRequest {
111
+ if (json == null) {
112
+ return json;
113
+ }
114
+ return {
115
+
116
+ 'connectionId': json['connection_id'] == null ? undefined : json['connection_id'],
117
+ 'channel': json['channel'] == null ? undefined : json['channel'],
118
+ 'text': json['text'] == null ? undefined : json['text'],
119
+ 'blocks': json['blocks'] == null ? undefined : json['blocks'],
120
+ 'attachments': json['attachments'] == null ? undefined : json['attachments'],
121
+ 'threadTs': json['thread_ts'] == null ? undefined : json['thread_ts'],
122
+ 'replyBroadcast': json['reply_broadcast'] == null ? undefined : json['reply_broadcast'],
123
+ 'unfurlLinks': json['unfurl_links'] == null ? undefined : json['unfurl_links'],
124
+ 'unfurlMedia': json['unfurl_media'] == null ? undefined : json['unfurl_media'],
125
+ 'mrkdwn': json['mrkdwn'] == null ? undefined : json['mrkdwn'],
126
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
127
+ 'tags': json['tags'] == null ? undefined : json['tags'],
128
+ };
129
+ }
130
+
131
+ export function SendSlackMessageRequestToJSON(json: any): SendSlackMessageRequest {
132
+ return SendSlackMessageRequestToJSONTyped(json, false);
133
+ }
134
+
135
+ export function SendSlackMessageRequestToJSONTyped(value?: SendSlackMessageRequest | null, ignoreDiscriminator: boolean = false): any {
136
+ if (value == null) {
137
+ return value;
138
+ }
139
+
140
+ return {
141
+
142
+ 'connection_id': value['connectionId'],
143
+ 'channel': value['channel'],
144
+ 'text': value['text'],
145
+ 'blocks': value['blocks'],
146
+ 'attachments': value['attachments'],
147
+ 'thread_ts': value['threadTs'],
148
+ 'reply_broadcast': value['replyBroadcast'],
149
+ 'unfurl_links': value['unfurlLinks'],
150
+ 'unfurl_media': value['unfurlMedia'],
151
+ 'mrkdwn': value['mrkdwn'],
152
+ 'metadata': value['metadata'],
153
+ 'tags': value['tags'],
154
+ };
155
+ }
156
+
@@ -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 { SendSlackMessageResult } from './SendSlackMessageResult';
17
+ import {
18
+ SendSlackMessageResultFromJSON,
19
+ SendSlackMessageResultFromJSONTyped,
20
+ SendSlackMessageResultToJSON,
21
+ SendSlackMessageResultToJSONTyped,
22
+ } from './SendSlackMessageResult';
23
+ import type { RequestMeta } from './RequestMeta';
24
+ import {
25
+ RequestMetaFromJSON,
26
+ RequestMetaFromJSONTyped,
27
+ RequestMetaToJSON,
28
+ RequestMetaToJSONTyped,
29
+ } from './RequestMeta';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface SendSlackMessageResponse
35
+ */
36
+ export interface SendSlackMessageResponse {
37
+ /**
38
+ *
39
+ * @type {SendSlackMessageResult}
40
+ * @memberof SendSlackMessageResponse
41
+ */
42
+ data?: SendSlackMessageResult;
43
+ /**
44
+ *
45
+ * @type {RequestMeta}
46
+ * @memberof SendSlackMessageResponse
47
+ */
48
+ meta?: RequestMeta;
49
+ }
50
+
51
+ /**
52
+ * Check if a given object implements the SendSlackMessageResponse interface.
53
+ */
54
+ export function instanceOfSendSlackMessageResponse(value: object): value is SendSlackMessageResponse {
55
+ return true;
56
+ }
57
+
58
+ export function SendSlackMessageResponseFromJSON(json: any): SendSlackMessageResponse {
59
+ return SendSlackMessageResponseFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function SendSlackMessageResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SendSlackMessageResponse {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'data': json['data'] == null ? undefined : SendSlackMessageResultFromJSON(json['data']),
69
+ 'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
70
+ };
71
+ }
72
+
73
+ export function SendSlackMessageResponseToJSON(json: any): SendSlackMessageResponse {
74
+ return SendSlackMessageResponseToJSONTyped(json, false);
75
+ }
76
+
77
+ export function SendSlackMessageResponseToJSONTyped(value?: SendSlackMessageResponse | null, ignoreDiscriminator: boolean = false): any {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+
82
+ return {
83
+
84
+ 'data': SendSlackMessageResultToJSON(value['data']),
85
+ 'meta': RequestMetaToJSON(value['meta']),
86
+ };
87
+ }
88
+
@@ -0,0 +1,115 @@
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 { SlackMessageStatus } from './SlackMessageStatus';
17
+ import {
18
+ SlackMessageStatusFromJSON,
19
+ SlackMessageStatusFromJSONTyped,
20
+ SlackMessageStatusToJSON,
21
+ SlackMessageStatusToJSONTyped,
22
+ } from './SlackMessageStatus';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface SendSlackMessageResult
28
+ */
29
+ export interface SendSlackMessageResult {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof SendSlackMessageResult
34
+ */
35
+ id?: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof SendSlackMessageResult
40
+ */
41
+ channelId?: string;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof SendSlackMessageResult
46
+ */
47
+ messageTs?: string | null;
48
+ /**
49
+ *
50
+ * @type {SlackMessageStatus}
51
+ * @memberof SendSlackMessageResult
52
+ */
53
+ status?: SlackMessageStatus;
54
+ /**
55
+ *
56
+ * @type {Date}
57
+ * @memberof SendSlackMessageResult
58
+ */
59
+ createdAt?: Date;
60
+ /**
61
+ *
62
+ * @type {Date}
63
+ * @memberof SendSlackMessageResult
64
+ */
65
+ sentAt?: Date | null;
66
+ }
67
+
68
+
69
+
70
+ /**
71
+ * Check if a given object implements the SendSlackMessageResult interface.
72
+ */
73
+ export function instanceOfSendSlackMessageResult(value: object): value is SendSlackMessageResult {
74
+ return true;
75
+ }
76
+
77
+ export function SendSlackMessageResultFromJSON(json: any): SendSlackMessageResult {
78
+ return SendSlackMessageResultFromJSONTyped(json, false);
79
+ }
80
+
81
+ export function SendSlackMessageResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): SendSlackMessageResult {
82
+ if (json == null) {
83
+ return json;
84
+ }
85
+ return {
86
+
87
+ 'id': json['id'] == null ? undefined : json['id'],
88
+ 'channelId': json['channel_id'] == null ? undefined : json['channel_id'],
89
+ 'messageTs': json['message_ts'] == null ? undefined : json['message_ts'],
90
+ 'status': json['status'] == null ? undefined : SlackMessageStatusFromJSON(json['status']),
91
+ 'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
92
+ 'sentAt': json['sent_at'] == null ? undefined : (new Date(json['sent_at'])),
93
+ };
94
+ }
95
+
96
+ export function SendSlackMessageResultToJSON(json: any): SendSlackMessageResult {
97
+ return SendSlackMessageResultToJSONTyped(json, false);
98
+ }
99
+
100
+ export function SendSlackMessageResultToJSONTyped(value?: SendSlackMessageResult | null, ignoreDiscriminator: boolean = false): any {
101
+ if (value == null) {
102
+ return value;
103
+ }
104
+
105
+ return {
106
+
107
+ 'id': value['id'],
108
+ 'channel_id': value['channelId'],
109
+ 'message_ts': value['messageTs'],
110
+ 'status': SlackMessageStatusToJSON(value['status']),
111
+ 'created_at': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
112
+ 'sent_at': value['sentAt'] == null ? undefined : ((value['sentAt'] as any).toISOString()),
113
+ };
114
+ }
115
+
@@ -0,0 +1,203 @@
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 { SlackMessageStatus } from './SlackMessageStatus';
17
+ import {
18
+ SlackMessageStatusFromJSON,
19
+ SlackMessageStatusFromJSONTyped,
20
+ SlackMessageStatusToJSON,
21
+ SlackMessageStatusToJSONTyped,
22
+ } from './SlackMessageStatus';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface SlackMessage
28
+ */
29
+ export interface SlackMessage {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof SlackMessage
34
+ */
35
+ id?: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof SlackMessage
40
+ */
41
+ slackConnectionId?: string;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof SlackMessage
46
+ */
47
+ channelId?: string;
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof SlackMessage
52
+ */
53
+ channelName?: string | null;
54
+ /**
55
+ *
56
+ * @type {string}
57
+ * @memberof SlackMessage
58
+ */
59
+ text?: string | null;
60
+ /**
61
+ *
62
+ * @type {Array<{ [key: string]: any; }>}
63
+ * @memberof SlackMessage
64
+ */
65
+ blocks?: Array<{ [key: string]: any; }> | null;
66
+ /**
67
+ *
68
+ * @type {Array<{ [key: string]: any; }>}
69
+ * @memberof SlackMessage
70
+ */
71
+ attachments?: Array<{ [key: string]: any; }> | null;
72
+ /**
73
+ *
74
+ * @type {string}
75
+ * @memberof SlackMessage
76
+ */
77
+ messageTs?: string | null;
78
+ /**
79
+ *
80
+ * @type {string}
81
+ * @memberof SlackMessage
82
+ */
83
+ threadTs?: string | null;
84
+ /**
85
+ *
86
+ * @type {SlackMessageStatus}
87
+ * @memberof SlackMessage
88
+ */
89
+ status?: SlackMessageStatus;
90
+ /**
91
+ *
92
+ * @type {string}
93
+ * @memberof SlackMessage
94
+ */
95
+ statusReason?: string | null;
96
+ /**
97
+ *
98
+ * @type {Array<string>}
99
+ * @memberof SlackMessage
100
+ */
101
+ tags?: Array<string> | null;
102
+ /**
103
+ *
104
+ * @type {{ [key: string]: any; }}
105
+ * @memberof SlackMessage
106
+ */
107
+ metadata?: { [key: string]: any; } | null;
108
+ /**
109
+ *
110
+ * @type {Date}
111
+ * @memberof SlackMessage
112
+ */
113
+ createdAt?: Date;
114
+ /**
115
+ *
116
+ * @type {Date}
117
+ * @memberof SlackMessage
118
+ */
119
+ queuedAt?: Date | null;
120
+ /**
121
+ *
122
+ * @type {Date}
123
+ * @memberof SlackMessage
124
+ */
125
+ sentAt?: Date | null;
126
+ /**
127
+ *
128
+ * @type {Date}
129
+ * @memberof SlackMessage
130
+ */
131
+ failedAt?: Date | null;
132
+ }
133
+
134
+
135
+
136
+ /**
137
+ * Check if a given object implements the SlackMessage interface.
138
+ */
139
+ export function instanceOfSlackMessage(value: object): value is SlackMessage {
140
+ return true;
141
+ }
142
+
143
+ export function SlackMessageFromJSON(json: any): SlackMessage {
144
+ return SlackMessageFromJSONTyped(json, false);
145
+ }
146
+
147
+ export function SlackMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): SlackMessage {
148
+ if (json == null) {
149
+ return json;
150
+ }
151
+ return {
152
+
153
+ 'id': json['id'] == null ? undefined : json['id'],
154
+ 'slackConnectionId': json['slack_connection_id'] == null ? undefined : json['slack_connection_id'],
155
+ 'channelId': json['channel_id'] == null ? undefined : json['channel_id'],
156
+ 'channelName': json['channel_name'] == null ? undefined : json['channel_name'],
157
+ 'text': json['text'] == null ? undefined : json['text'],
158
+ 'blocks': json['blocks'] == null ? undefined : json['blocks'],
159
+ 'attachments': json['attachments'] == null ? undefined : json['attachments'],
160
+ 'messageTs': json['message_ts'] == null ? undefined : json['message_ts'],
161
+ 'threadTs': json['thread_ts'] == null ? undefined : json['thread_ts'],
162
+ 'status': json['status'] == null ? undefined : SlackMessageStatusFromJSON(json['status']),
163
+ 'statusReason': json['status_reason'] == null ? undefined : json['status_reason'],
164
+ 'tags': json['tags'] == null ? undefined : json['tags'],
165
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
166
+ 'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
167
+ 'queuedAt': json['queued_at'] == null ? undefined : (new Date(json['queued_at'])),
168
+ 'sentAt': json['sent_at'] == null ? undefined : (new Date(json['sent_at'])),
169
+ 'failedAt': json['failed_at'] == null ? undefined : (new Date(json['failed_at'])),
170
+ };
171
+ }
172
+
173
+ export function SlackMessageToJSON(json: any): SlackMessage {
174
+ return SlackMessageToJSONTyped(json, false);
175
+ }
176
+
177
+ export function SlackMessageToJSONTyped(value?: SlackMessage | null, ignoreDiscriminator: boolean = false): any {
178
+ if (value == null) {
179
+ return value;
180
+ }
181
+
182
+ return {
183
+
184
+ 'id': value['id'],
185
+ 'slack_connection_id': value['slackConnectionId'],
186
+ 'channel_id': value['channelId'],
187
+ 'channel_name': value['channelName'],
188
+ 'text': value['text'],
189
+ 'blocks': value['blocks'],
190
+ 'attachments': value['attachments'],
191
+ 'message_ts': value['messageTs'],
192
+ 'thread_ts': value['threadTs'],
193
+ 'status': SlackMessageStatusToJSON(value['status']),
194
+ 'status_reason': value['statusReason'],
195
+ 'tags': value['tags'],
196
+ 'metadata': value['metadata'],
197
+ 'created_at': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
198
+ 'queued_at': value['queuedAt'] == null ? undefined : ((value['queuedAt'] as any).toISOString()),
199
+ 'sent_at': value['sentAt'] == null ? undefined : ((value['sentAt'] as any).toISOString()),
200
+ 'failed_at': value['failedAt'] == null ? undefined : ((value['failedAt'] as any).toISOString()),
201
+ };
202
+ }
203
+
@@ -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 { SlackMessageSummary } from './SlackMessageSummary';
17
+ import {
18
+ SlackMessageSummaryFromJSON,
19
+ SlackMessageSummaryFromJSONTyped,
20
+ SlackMessageSummaryToJSON,
21
+ SlackMessageSummaryToJSONTyped,
22
+ } from './SlackMessageSummary';
23
+ import type { SlackMessageListResponseMeta } from './SlackMessageListResponseMeta';
24
+ import {
25
+ SlackMessageListResponseMetaFromJSON,
26
+ SlackMessageListResponseMetaFromJSONTyped,
27
+ SlackMessageListResponseMetaToJSON,
28
+ SlackMessageListResponseMetaToJSONTyped,
29
+ } from './SlackMessageListResponseMeta';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface SlackMessageListResponse
35
+ */
36
+ export interface SlackMessageListResponse {
37
+ /**
38
+ *
39
+ * @type {Array<SlackMessageSummary>}
40
+ * @memberof SlackMessageListResponse
41
+ */
42
+ data?: Array<SlackMessageSummary>;
43
+ /**
44
+ *
45
+ * @type {SlackMessageListResponseMeta}
46
+ * @memberof SlackMessageListResponse
47
+ */
48
+ meta?: SlackMessageListResponseMeta;
49
+ }
50
+
51
+ /**
52
+ * Check if a given object implements the SlackMessageListResponse interface.
53
+ */
54
+ export function instanceOfSlackMessageListResponse(value: object): value is SlackMessageListResponse {
55
+ return true;
56
+ }
57
+
58
+ export function SlackMessageListResponseFromJSON(json: any): SlackMessageListResponse {
59
+ return SlackMessageListResponseFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function SlackMessageListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SlackMessageListResponse {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(SlackMessageSummaryFromJSON)),
69
+ 'meta': json['meta'] == null ? undefined : SlackMessageListResponseMetaFromJSON(json['meta']),
70
+ };
71
+ }
72
+
73
+ export function SlackMessageListResponseToJSON(json: any): SlackMessageListResponse {
74
+ return SlackMessageListResponseToJSONTyped(json, false);
75
+ }
76
+
77
+ export function SlackMessageListResponseToJSONTyped(value?: SlackMessageListResponse | null, ignoreDiscriminator: boolean = false): any {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+
82
+ return {
83
+
84
+ 'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(SlackMessageSummaryToJSON)),
85
+ 'meta': SlackMessageListResponseMetaToJSON(value['meta']),
86
+ };
87
+ }
88
+