@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.
Files changed (44) hide show
  1. package/dist/index.cjs +1964 -190
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +3178 -1137
  4. package/dist/index.d.ts +3178 -1137
  5. package/dist/index.js +1811 -185
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/.openapi-generator/FILES +31 -1
  9. package/src/client.ts +3 -0
  10. package/src/src/apis/AuthEmailTemplatesApi.ts +734 -0
  11. package/src/src/apis/SlackApi.ts +264 -0
  12. package/src/src/apis/index.ts +2 -0
  13. package/src/src/models/AuthEmailTemplate.ts +181 -0
  14. package/src/src/models/AuthEmailTemplateDefault.ts +107 -0
  15. package/src/src/models/AuthEmailTemplateDefaultResponse.ts +88 -0
  16. package/src/src/models/AuthEmailTemplateDeleteResponse.ts +88 -0
  17. package/src/src/models/{SuccessResultData.ts → AuthEmailTemplateDeleteResponseData.ts} +11 -11
  18. package/src/src/models/AuthEmailTemplateListResponse.ts +88 -0
  19. package/src/src/models/AuthEmailTemplatePreviewDraft.ts +108 -0
  20. package/src/src/models/AuthEmailTemplatePreviewRequest.ts +81 -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/ResubscribeResponse.ts +10 -10
  33. package/src/src/models/SendSlackMessageRequest.ts +156 -0
  34. package/src/src/models/SendSlackMessageResponse.ts +88 -0
  35. package/src/src/models/SendSlackMessageResult.ts +115 -0
  36. package/src/src/models/SlackMessage.ts +203 -0
  37. package/src/src/models/SlackMessageListResponse.ts +88 -0
  38. package/src/src/models/SlackMessageListResponseMeta.ts +89 -0
  39. package/src/src/models/SlackMessageResponse.ts +88 -0
  40. package/src/src/models/SlackMessageStatus.ts +56 -0
  41. package/src/src/models/SlackMessageSummary.ts +155 -0
  42. package/src/src/models/SuccessResult.ts +10 -10
  43. package/src/src/models/UpsertAuthEmailTemplateRequest.ts +143 -0
  44. package/src/src/models/index.ts +29 -1
@@ -0,0 +1,91 @@
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 { UpsertAuthEmailTemplateRequest } from './UpsertAuthEmailTemplateRequest';
17
+ import {
18
+ UpsertAuthEmailTemplateRequestFromJSON,
19
+ UpsertAuthEmailTemplateRequestFromJSONTyped,
20
+ UpsertAuthEmailTemplateRequestToJSON,
21
+ UpsertAuthEmailTemplateRequestToJSONTyped,
22
+ } from './UpsertAuthEmailTemplateRequest';
23
+
24
+ /**
25
+ * Atomic upsert of any subset of magic_link, password_reset, email_verification.
26
+ * At least one entry must be provided.
27
+ *
28
+ * @export
29
+ * @interface BulkUpsertAuthEmailTemplatesRequest
30
+ */
31
+ export interface BulkUpsertAuthEmailTemplatesRequest {
32
+ /**
33
+ *
34
+ * @type {UpsertAuthEmailTemplateRequest}
35
+ * @memberof BulkUpsertAuthEmailTemplatesRequest
36
+ */
37
+ magicLink?: UpsertAuthEmailTemplateRequest;
38
+ /**
39
+ *
40
+ * @type {UpsertAuthEmailTemplateRequest}
41
+ * @memberof BulkUpsertAuthEmailTemplatesRequest
42
+ */
43
+ passwordReset?: UpsertAuthEmailTemplateRequest;
44
+ /**
45
+ *
46
+ * @type {UpsertAuthEmailTemplateRequest}
47
+ * @memberof BulkUpsertAuthEmailTemplatesRequest
48
+ */
49
+ emailVerification?: UpsertAuthEmailTemplateRequest;
50
+ }
51
+
52
+ /**
53
+ * Check if a given object implements the BulkUpsertAuthEmailTemplatesRequest interface.
54
+ */
55
+ export function instanceOfBulkUpsertAuthEmailTemplatesRequest(value: object): value is BulkUpsertAuthEmailTemplatesRequest {
56
+ return true;
57
+ }
58
+
59
+ export function BulkUpsertAuthEmailTemplatesRequestFromJSON(json: any): BulkUpsertAuthEmailTemplatesRequest {
60
+ return BulkUpsertAuthEmailTemplatesRequestFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function BulkUpsertAuthEmailTemplatesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkUpsertAuthEmailTemplatesRequest {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'magicLink': json['magic_link'] == null ? undefined : UpsertAuthEmailTemplateRequestFromJSON(json['magic_link']),
70
+ 'passwordReset': json['password_reset'] == null ? undefined : UpsertAuthEmailTemplateRequestFromJSON(json['password_reset']),
71
+ 'emailVerification': json['email_verification'] == null ? undefined : UpsertAuthEmailTemplateRequestFromJSON(json['email_verification']),
72
+ };
73
+ }
74
+
75
+ export function BulkUpsertAuthEmailTemplatesRequestToJSON(json: any): BulkUpsertAuthEmailTemplatesRequest {
76
+ return BulkUpsertAuthEmailTemplatesRequestToJSONTyped(json, false);
77
+ }
78
+
79
+ export function BulkUpsertAuthEmailTemplatesRequestToJSONTyped(value?: BulkUpsertAuthEmailTemplatesRequest | null, ignoreDiscriminator: boolean = false): any {
80
+ if (value == null) {
81
+ return value;
82
+ }
83
+
84
+ return {
85
+
86
+ 'magic_link': UpsertAuthEmailTemplateRequestToJSON(value['magicLink']),
87
+ 'password_reset': UpsertAuthEmailTemplateRequestToJSON(value['passwordReset']),
88
+ 'email_verification': UpsertAuthEmailTemplateRequestToJSON(value['emailVerification']),
89
+ };
90
+ }
91
+
@@ -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 { AuthEmailTemplate } from './AuthEmailTemplate';
24
+ import {
25
+ AuthEmailTemplateFromJSON,
26
+ AuthEmailTemplateFromJSONTyped,
27
+ AuthEmailTemplateToJSON,
28
+ AuthEmailTemplateToJSONTyped,
29
+ } from './AuthEmailTemplate';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface BulkUpsertAuthEmailTemplatesResponse
35
+ */
36
+ export interface BulkUpsertAuthEmailTemplatesResponse {
37
+ /**
38
+ *
39
+ * @type {{ [key: string]: AuthEmailTemplate; }}
40
+ * @memberof BulkUpsertAuthEmailTemplatesResponse
41
+ */
42
+ data?: { [key: string]: AuthEmailTemplate; };
43
+ /**
44
+ *
45
+ * @type {RequestMeta}
46
+ * @memberof BulkUpsertAuthEmailTemplatesResponse
47
+ */
48
+ meta?: RequestMeta;
49
+ }
50
+
51
+ /**
52
+ * Check if a given object implements the BulkUpsertAuthEmailTemplatesResponse interface.
53
+ */
54
+ export function instanceOfBulkUpsertAuthEmailTemplatesResponse(value: object): value is BulkUpsertAuthEmailTemplatesResponse {
55
+ return true;
56
+ }
57
+
58
+ export function BulkUpsertAuthEmailTemplatesResponseFromJSON(json: any): BulkUpsertAuthEmailTemplatesResponse {
59
+ return BulkUpsertAuthEmailTemplatesResponseFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function BulkUpsertAuthEmailTemplatesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkUpsertAuthEmailTemplatesResponse {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'data': json['data'] == null ? undefined : (mapValues(json['data'], AuthEmailTemplateFromJSON)),
69
+ 'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
70
+ };
71
+ }
72
+
73
+ export function BulkUpsertAuthEmailTemplatesResponseToJSON(json: any): BulkUpsertAuthEmailTemplatesResponse {
74
+ return BulkUpsertAuthEmailTemplatesResponseToJSONTyped(json, false);
75
+ }
76
+
77
+ export function BulkUpsertAuthEmailTemplatesResponseToJSONTyped(value?: BulkUpsertAuthEmailTemplatesResponse | null, ignoreDiscriminator: boolean = false): any {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+
82
+ return {
83
+
84
+ 'data': value['data'] == null ? undefined : (mapValues(value['data'], AuthEmailTemplateToJSON)),
85
+ 'meta': RequestMetaToJSON(value['meta']),
86
+ };
87
+ }
88
+
@@ -13,13 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
- import type { SuccessResultData } from './SuccessResultData';
16
+ import type { AuthEmailTemplateDeleteResponseData } from './AuthEmailTemplateDeleteResponseData';
17
17
  import {
18
- SuccessResultDataFromJSON,
19
- SuccessResultDataFromJSONTyped,
20
- SuccessResultDataToJSON,
21
- SuccessResultDataToJSONTyped,
22
- } from './SuccessResultData';
18
+ AuthEmailTemplateDeleteResponseDataFromJSON,
19
+ AuthEmailTemplateDeleteResponseDataFromJSONTyped,
20
+ AuthEmailTemplateDeleteResponseDataToJSON,
21
+ AuthEmailTemplateDeleteResponseDataToJSONTyped,
22
+ } from './AuthEmailTemplateDeleteResponseData';
23
23
  import type { RequestMeta } from './RequestMeta';
24
24
  import {
25
25
  RequestMetaFromJSON,
@@ -36,10 +36,10 @@ import {
36
36
  export interface ResubscribeResponse {
37
37
  /**
38
38
  *
39
- * @type {SuccessResultData}
39
+ * @type {AuthEmailTemplateDeleteResponseData}
40
40
  * @memberof ResubscribeResponse
41
41
  */
42
- data?: SuccessResultData;
42
+ data?: AuthEmailTemplateDeleteResponseData;
43
43
  /**
44
44
  *
45
45
  * @type {RequestMeta}
@@ -65,7 +65,7 @@ export function ResubscribeResponseFromJSONTyped(json: any, ignoreDiscriminator:
65
65
  }
66
66
  return {
67
67
 
68
- 'data': json['data'] == null ? undefined : SuccessResultDataFromJSON(json['data']),
68
+ 'data': json['data'] == null ? undefined : AuthEmailTemplateDeleteResponseDataFromJSON(json['data']),
69
69
  'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
70
70
  };
71
71
  }
@@ -81,7 +81,7 @@ export function ResubscribeResponseToJSONTyped(value?: ResubscribeResponse | nul
81
81
 
82
82
  return {
83
83
 
84
- 'data': SuccessResultDataToJSON(value['data']),
84
+ 'data': AuthEmailTemplateDeleteResponseDataToJSON(value['data']),
85
85
  'meta': RequestMetaToJSON(value['meta']),
86
86
  };
87
87
  }
@@ -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
+