@zyphr-dev/node-sdk 0.1.23 → 0.1.25

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.
@@ -0,0 +1,73 @@
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 { ConvertAnonymousUserRequestOneOf1AppleUserName } from './ConvertAnonymousUserRequestOneOf1AppleUserName';
17
+ import {
18
+ ConvertAnonymousUserRequestOneOf1AppleUserNameFromJSON,
19
+ ConvertAnonymousUserRequestOneOf1AppleUserNameFromJSONTyped,
20
+ ConvertAnonymousUserRequestOneOf1AppleUserNameToJSON,
21
+ ConvertAnonymousUserRequestOneOf1AppleUserNameToJSONTyped,
22
+ } from './ConvertAnonymousUserRequestOneOf1AppleUserName';
23
+
24
+ /**
25
+ * Sign in with Apple only -- first-call name payload, since Apple omits the name from /userinfo on subsequent sign-ins.
26
+ * @export
27
+ * @interface ConvertAnonymousUserRequestOneOf1AppleUser
28
+ */
29
+ export interface ConvertAnonymousUserRequestOneOf1AppleUser {
30
+ /**
31
+ *
32
+ * @type {ConvertAnonymousUserRequestOneOf1AppleUserName}
33
+ * @memberof ConvertAnonymousUserRequestOneOf1AppleUser
34
+ */
35
+ name?: ConvertAnonymousUserRequestOneOf1AppleUserName;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the ConvertAnonymousUserRequestOneOf1AppleUser interface.
40
+ */
41
+ export function instanceOfConvertAnonymousUserRequestOneOf1AppleUser(value: object): value is ConvertAnonymousUserRequestOneOf1AppleUser {
42
+ return true;
43
+ }
44
+
45
+ export function ConvertAnonymousUserRequestOneOf1AppleUserFromJSON(json: any): ConvertAnonymousUserRequestOneOf1AppleUser {
46
+ return ConvertAnonymousUserRequestOneOf1AppleUserFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ConvertAnonymousUserRequestOneOf1AppleUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConvertAnonymousUserRequestOneOf1AppleUser {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'name': json['name'] == null ? undefined : ConvertAnonymousUserRequestOneOf1AppleUserNameFromJSON(json['name']),
56
+ };
57
+ }
58
+
59
+ export function ConvertAnonymousUserRequestOneOf1AppleUserToJSON(json: any): ConvertAnonymousUserRequestOneOf1AppleUser {
60
+ return ConvertAnonymousUserRequestOneOf1AppleUserToJSONTyped(json, false);
61
+ }
62
+
63
+ export function ConvertAnonymousUserRequestOneOf1AppleUserToJSONTyped(value?: ConvertAnonymousUserRequestOneOf1AppleUser | null, ignoreDiscriminator: boolean = false): any {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+
68
+ return {
69
+
70
+ 'name': ConvertAnonymousUserRequestOneOf1AppleUserNameToJSON(value['name']),
71
+ };
72
+ }
73
+
@@ -0,0 +1,73 @@
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
+ *
18
+ * @export
19
+ * @interface ConvertAnonymousUserRequestOneOf1AppleUserName
20
+ */
21
+ export interface ConvertAnonymousUserRequestOneOf1AppleUserName {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ConvertAnonymousUserRequestOneOf1AppleUserName
26
+ */
27
+ firstName?: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ConvertAnonymousUserRequestOneOf1AppleUserName
32
+ */
33
+ lastName?: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the ConvertAnonymousUserRequestOneOf1AppleUserName interface.
38
+ */
39
+ export function instanceOfConvertAnonymousUserRequestOneOf1AppleUserName(value: object): value is ConvertAnonymousUserRequestOneOf1AppleUserName {
40
+ return true;
41
+ }
42
+
43
+ export function ConvertAnonymousUserRequestOneOf1AppleUserNameFromJSON(json: any): ConvertAnonymousUserRequestOneOf1AppleUserName {
44
+ return ConvertAnonymousUserRequestOneOf1AppleUserNameFromJSONTyped(json, false);
45
+ }
46
+
47
+ export function ConvertAnonymousUserRequestOneOf1AppleUserNameFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConvertAnonymousUserRequestOneOf1AppleUserName {
48
+ if (json == null) {
49
+ return json;
50
+ }
51
+ return {
52
+
53
+ 'firstName': json['firstName'] == null ? undefined : json['firstName'],
54
+ 'lastName': json['lastName'] == null ? undefined : json['lastName'],
55
+ };
56
+ }
57
+
58
+ export function ConvertAnonymousUserRequestOneOf1AppleUserNameToJSON(json: any): ConvertAnonymousUserRequestOneOf1AppleUserName {
59
+ return ConvertAnonymousUserRequestOneOf1AppleUserNameToJSONTyped(json, false);
60
+ }
61
+
62
+ export function ConvertAnonymousUserRequestOneOf1AppleUserNameToJSONTyped(value?: ConvertAnonymousUserRequestOneOf1AppleUserName | null, ignoreDiscriminator: boolean = false): any {
63
+ if (value == null) {
64
+ return value;
65
+ }
66
+
67
+ return {
68
+
69
+ 'firstName': value['firstName'],
70
+ 'lastName': value['lastName'],
71
+ };
72
+ }
73
+
@@ -32,19 +32,34 @@ export interface CreateTemplateRequest {
32
32
  */
33
33
  description?: string;
34
34
  /**
35
- * Email subject line (supports Handlebars)
35
+ * Email subject line. Supports Handlebars `{{var}}` interpolation;
36
+ * values are HTML-escaped on render (see `html` field for the full
37
+ * escape policy).
38
+ *
36
39
  * @type {string}
37
40
  * @memberof CreateTemplateRequest
38
41
  */
39
42
  subject?: string;
40
43
  /**
41
- * HTML body (supports Handlebars)
44
+ * HTML body. Supports Handlebars `{{var}}` interpolation; values are
45
+ * always HTML-escaped on render.
46
+ *
47
+ * **Triple-brace `{{{var}}}` (raw HTML output) is not supported** for
48
+ * XSS-prevention reasons — input containing `{{{var}}}` is rewritten
49
+ * to `{{var}}` on save and the response includes a top-level
50
+ * `warnings` array describing what changed. To inject pre-rendered
51
+ * HTML, render the entire `html` field outside Zyphr and POST it to
52
+ * `/v1/email/send` directly without `template_id`.
53
+ *
42
54
  * @type {string}
43
55
  * @memberof CreateTemplateRequest
44
56
  */
45
57
  html?: string;
46
58
  /**
47
- * Plain text body (supports Handlebars)
59
+ * Plain text body. Supports Handlebars `{{var}}` interpolation;
60
+ * triple-brace syntax is rewritten to double-brace on save (same
61
+ * policy as the `html` field).
62
+ *
48
63
  * @type {string}
49
64
  * @memberof CreateTemplateRequest
50
65
  */
@@ -13,33 +13,99 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
- import type { SendEmailRequest } from './SendEmailRequest';
16
+ import type { BatchRecipient } from './BatchRecipient';
17
17
  import {
18
- SendEmailRequestFromJSON,
19
- SendEmailRequestFromJSONTyped,
20
- SendEmailRequestToJSON,
21
- SendEmailRequestToJSONTyped,
22
- } from './SendEmailRequest';
18
+ BatchRecipientFromJSON,
19
+ BatchRecipientFromJSONTyped,
20
+ BatchRecipientToJSON,
21
+ BatchRecipientToJSONTyped,
22
+ } from './BatchRecipient';
23
+ import type { EmailAddress } from './EmailAddress';
24
+ import {
25
+ EmailAddressFromJSON,
26
+ EmailAddressFromJSONTyped,
27
+ EmailAddressToJSON,
28
+ EmailAddressToJSONTyped,
29
+ } from './EmailAddress';
23
30
 
24
31
  /**
32
+ * Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`.
25
33
  *
26
34
  * @export
27
35
  * @interface SendBatchEmailRequest
28
36
  */
29
37
  export interface SendBatchEmailRequest {
38
+ /**
39
+ * Sender address. The API also accepts a plain email string for convenience.
40
+ *
41
+ * @type {EmailAddress}
42
+ * @memberof SendBatchEmailRequest
43
+ */
44
+ from: EmailAddress;
45
+ /**
46
+ *
47
+ * @type {Array<BatchRecipient>}
48
+ * @memberof SendBatchEmailRequest
49
+ */
50
+ to: Array<BatchRecipient>;
51
+ /**
52
+ * Reply-to address. The API also accepts a plain email string for convenience.
53
+ *
54
+ * @type {EmailAddress}
55
+ * @memberof SendBatchEmailRequest
56
+ */
57
+ replyTo?: EmailAddress;
58
+ /**
59
+ * Required when sending raw content (no `template_id`).
60
+ * @type {string}
61
+ * @memberof SendBatchEmailRequest
62
+ */
63
+ subject?: string;
64
+ /**
65
+ * Provide either `html` or `text` (or both) when sending raw content.
66
+ * @type {string}
67
+ * @memberof SendBatchEmailRequest
68
+ */
69
+ html?: string;
70
+ /**
71
+ * Provide either `html` or `text` (or both) when sending raw content.
72
+ * @type {string}
73
+ * @memberof SendBatchEmailRequest
74
+ */
75
+ text?: string;
76
+ /**
77
+ * Template ID to use instead of raw `subject`/`html`/`text`.
78
+ * @type {string}
79
+ * @memberof SendBatchEmailRequest
80
+ */
81
+ templateId?: string;
82
+ /**
83
+ * Default variables to pass to the template. Merged with each recipient's per-recipient `variables` (per-recipient values win on key collisions).
84
+ *
85
+ * @type {{ [key: string]: any; }}
86
+ * @memberof SendBatchEmailRequest
87
+ */
88
+ templateData?: { [key: string]: any; };
89
+ /**
90
+ *
91
+ * @type {Array<string>}
92
+ * @memberof SendBatchEmailRequest
93
+ */
94
+ tags?: Array<string>;
30
95
  /**
31
96
  *
32
- * @type {Array<SendEmailRequest>}
97
+ * @type {{ [key: string]: any; }}
33
98
  * @memberof SendBatchEmailRequest
34
99
  */
35
- messages: Array<SendEmailRequest>;
100
+ metadata?: { [key: string]: any; };
36
101
  }
37
102
 
38
103
  /**
39
104
  * Check if a given object implements the SendBatchEmailRequest interface.
40
105
  */
41
106
  export function instanceOfSendBatchEmailRequest(value: object): value is SendBatchEmailRequest {
42
- if (!('messages' in value) || value['messages'] === undefined) return false;
107
+ if (!('from' in value) || value['from'] === undefined) return false;
108
+ if (!('to' in value) || value['to'] === undefined) return false;
43
109
  return true;
44
110
  }
45
111
 
@@ -53,7 +119,16 @@ export function SendBatchEmailRequestFromJSONTyped(json: any, ignoreDiscriminato
53
119
  }
54
120
  return {
55
121
 
56
- 'messages': ((json['messages'] as Array<any>).map(SendEmailRequestFromJSON)),
122
+ 'from': EmailAddressFromJSON(json['from']),
123
+ 'to': ((json['to'] as Array<any>).map(BatchRecipientFromJSON)),
124
+ 'replyTo': json['reply_to'] == null ? undefined : EmailAddressFromJSON(json['reply_to']),
125
+ 'subject': json['subject'] == null ? undefined : json['subject'],
126
+ 'html': json['html'] == null ? undefined : json['html'],
127
+ 'text': json['text'] == null ? undefined : json['text'],
128
+ 'templateId': json['template_id'] == null ? undefined : json['template_id'],
129
+ 'templateData': json['template_data'] == null ? undefined : json['template_data'],
130
+ 'tags': json['tags'] == null ? undefined : json['tags'],
131
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
57
132
  };
58
133
  }
59
134
 
@@ -68,7 +143,16 @@ export function SendBatchEmailRequestToJSONTyped(value?: SendBatchEmailRequest |
68
143
 
69
144
  return {
70
145
 
71
- 'messages': ((value['messages'] as Array<any>).map(SendEmailRequestToJSON)),
146
+ 'from': EmailAddressToJSON(value['from']),
147
+ 'to': ((value['to'] as Array<any>).map(BatchRecipientToJSON)),
148
+ 'reply_to': EmailAddressToJSON(value['replyTo']),
149
+ 'subject': value['subject'],
150
+ 'html': value['html'],
151
+ 'text': value['text'],
152
+ 'template_id': value['templateId'],
153
+ 'template_data': value['templateData'],
154
+ 'tags': value['tags'],
155
+ 'metadata': value['metadata'],
72
156
  };
73
157
  }
74
158
 
@@ -0,0 +1,82 @@
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
+ *
18
+ * @export
19
+ * @interface SignInAnonymouslyRequest
20
+ */
21
+ export interface SignInAnonymouslyRequest {
22
+ /**
23
+ * Stable per-device identifier supplied by the client. Use a cryptographically-random opaque value persisted to client storage on first run.
24
+ * @type {string}
25
+ * @memberof SignInAnonymouslyRequest
26
+ */
27
+ deviceId: string;
28
+ /**
29
+ * Optional display name. If omitted, the user has no name until conversion.
30
+ * @type {string}
31
+ * @memberof SignInAnonymouslyRequest
32
+ */
33
+ name?: string;
34
+ /**
35
+ *
36
+ * @type {{ [key: string]: any; }}
37
+ * @memberof SignInAnonymouslyRequest
38
+ */
39
+ metadata?: { [key: string]: any; };
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the SignInAnonymouslyRequest interface.
44
+ */
45
+ export function instanceOfSignInAnonymouslyRequest(value: object): value is SignInAnonymouslyRequest {
46
+ if (!('deviceId' in value) || value['deviceId'] === undefined) return false;
47
+ return true;
48
+ }
49
+
50
+ export function SignInAnonymouslyRequestFromJSON(json: any): SignInAnonymouslyRequest {
51
+ return SignInAnonymouslyRequestFromJSONTyped(json, false);
52
+ }
53
+
54
+ export function SignInAnonymouslyRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SignInAnonymouslyRequest {
55
+ if (json == null) {
56
+ return json;
57
+ }
58
+ return {
59
+
60
+ 'deviceId': json['device_id'],
61
+ 'name': json['name'] == null ? undefined : json['name'],
62
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
63
+ };
64
+ }
65
+
66
+ export function SignInAnonymouslyRequestToJSON(json: any): SignInAnonymouslyRequest {
67
+ return SignInAnonymouslyRequestToJSONTyped(json, false);
68
+ }
69
+
70
+ export function SignInAnonymouslyRequestToJSONTyped(value?: SignInAnonymouslyRequest | null, ignoreDiscriminator: boolean = false): any {
71
+ if (value == null) {
72
+ return value;
73
+ }
74
+
75
+ return {
76
+
77
+ 'device_id': value['deviceId'],
78
+ 'name': value['name'],
79
+ 'metadata': value['metadata'],
80
+ };
81
+ }
82
+
@@ -46,6 +46,17 @@ export interface TemplateResponse {
46
46
  * @memberof TemplateResponse
47
47
  */
48
48
  meta?: RequestMeta;
49
+ /**
50
+ * Non-fatal advisories about the request. Currently emitted only when
51
+ * the server rewrites template content for security (see the `html`
52
+ * field on `CreateTemplateRequest` for the triple-brace policy).
53
+ * Omitted entirely when no warnings apply — clients should treat its
54
+ * absence as equivalent to an empty array.
55
+ *
56
+ * @type {Array<string>}
57
+ * @memberof TemplateResponse
58
+ */
59
+ warnings?: Array<string>;
49
60
  }
50
61
 
51
62
  /**
@@ -67,6 +78,7 @@ export function TemplateResponseFromJSONTyped(json: any, ignoreDiscriminator: bo
67
78
 
68
79
  'data': json['data'] == null ? undefined : TemplateFromJSON(json['data']),
69
80
  'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
81
+ 'warnings': json['warnings'] == null ? undefined : json['warnings'],
70
82
  };
71
83
  }
72
84
 
@@ -83,6 +95,7 @@ export function TemplateResponseToJSONTyped(value?: TemplateResponse | null, ign
83
95
 
84
96
  'data': TemplateToJSON(value['data']),
85
97
  'meta': RequestMetaToJSON(value['meta']),
98
+ 'warnings': value['warnings'],
86
99
  };
87
100
  }
88
101
 
@@ -32,18 +32,27 @@ export interface UpdateTemplateRequest {
32
32
  */
33
33
  description?: string;
34
34
  /**
35
+ * Email subject line. Supports Handlebars `{{var}}` interpolation
36
+ * (HTML-escaped on render).
35
37
  *
36
38
  * @type {string}
37
39
  * @memberof UpdateTemplateRequest
38
40
  */
39
41
  subject?: string;
40
42
  /**
43
+ * HTML body. Supports Handlebars `{{var}}` interpolation; values are
44
+ * always HTML-escaped on render. Triple-brace `{{{var}}}` is not
45
+ * supported — input is rewritten to `{{var}}` on save and the
46
+ * response includes a top-level `warnings` array describing the
47
+ * rewrite. See `CreateTemplateRequest.html` for full rationale.
41
48
  *
42
49
  * @type {string}
43
50
  * @memberof UpdateTemplateRequest
44
51
  */
45
52
  html?: string;
46
53
  /**
54
+ * Plain text body. Supports Handlebars `{{var}}` interpolation; same
55
+ * triple-brace rewrite policy as `html`.
47
56
  *
48
57
  * @type {string}
49
58
  * @memberof UpdateTemplateRequest
@@ -32,6 +32,7 @@ export * from './AuthUser';
32
32
  export * from './AuthUserResponse';
33
33
  export * from './AuthUserResponseData';
34
34
  export * from './BatchPublishWaaSEvents201Response';
35
+ export * from './BatchRecipient';
35
36
  export * from './BulkRetryWebhookDeliveriesRequest';
36
37
  export * from './BulkUpsertAuthEmailTemplatesRequest';
37
38
  export * from './BulkUpsertAuthEmailTemplatesResponse';
@@ -48,6 +49,11 @@ export * from './ConsentRecordResponseData';
48
49
  export * from './ConsentStatus';
49
50
  export * from './ConsentStatusResponse';
50
51
  export * from './ConsentWithdrawResponse';
52
+ export * from './ConvertAnonymousUserRequest';
53
+ export * from './ConvertAnonymousUserRequestOneOf';
54
+ export * from './ConvertAnonymousUserRequestOneOf1';
55
+ export * from './ConvertAnonymousUserRequestOneOf1AppleUser';
56
+ export * from './ConvertAnonymousUserRequestOneOf1AppleUserName';
51
57
  export * from './CreateCategoryRequest';
52
58
  export * from './CreateSubscriberRequest';
53
59
  export * from './CreateTemplateRequest';
@@ -235,6 +241,7 @@ export * from './SessionListResponseData';
235
241
  export * from './SessionListResponseDataSessionInfo';
236
242
  export * from './SetPreferencesRequest';
237
243
  export * from './SetPreferencesRequestPreferencesInner';
244
+ export * from './SignInAnonymouslyRequest';
238
245
  export * from './SlackMessage';
239
246
  export * from './SlackMessageListResponse';
240
247
  export * from './SlackMessageListResponseMeta';