@zyphr-dev/node-sdk 0.1.48 → 0.1.50

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,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 ## Account Sending Status Every authenticated response carries the account\'s current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## 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 { PasswordStrength } from './PasswordStrength';
24
+ import {
25
+ PasswordStrengthFromJSON,
26
+ PasswordStrengthFromJSONTyped,
27
+ PasswordStrengthToJSON,
28
+ PasswordStrengthToJSONTyped,
29
+ } from './PasswordStrength';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface PasswordStrengthResponse
35
+ */
36
+ export interface PasswordStrengthResponse {
37
+ /**
38
+ *
39
+ * @type {PasswordStrength}
40
+ * @memberof PasswordStrengthResponse
41
+ */
42
+ data?: PasswordStrength;
43
+ /**
44
+ *
45
+ * @type {RequestMeta}
46
+ * @memberof PasswordStrengthResponse
47
+ */
48
+ meta?: RequestMeta;
49
+ }
50
+
51
+ /**
52
+ * Check if a given object implements the PasswordStrengthResponse interface.
53
+ */
54
+ export function instanceOfPasswordStrengthResponse(value: object): value is PasswordStrengthResponse {
55
+ return true;
56
+ }
57
+
58
+ export function PasswordStrengthResponseFromJSON(json: any): PasswordStrengthResponse {
59
+ return PasswordStrengthResponseFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function PasswordStrengthResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PasswordStrengthResponse {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'data': json['data'] == null ? undefined : PasswordStrengthFromJSON(json['data']),
69
+ 'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
70
+ };
71
+ }
72
+
73
+ export function PasswordStrengthResponseToJSON(json: any): PasswordStrengthResponse {
74
+ return PasswordStrengthResponseToJSONTyped(json, false);
75
+ }
76
+
77
+ export function PasswordStrengthResponseToJSONTyped(value?: PasswordStrengthResponse | null, ignoreDiscriminator: boolean = false): any {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+
82
+ return {
83
+
84
+ 'data': PasswordStrengthToJSON(value['data']),
85
+ 'meta': RequestMetaToJSON(value['meta']),
86
+ };
87
+ }
88
+
@@ -14,24 +14,40 @@
14
14
 
15
15
  import { mapValues } from '../runtime';
16
16
  /**
17
- *
17
+ * Provide test_recipients and/or auth_email_mode. Omitting one leaves that value unchanged; sending neither is a 400.
18
18
  * @export
19
19
  * @interface SetSelfApplicationTestRecipientsRequest
20
20
  */
21
21
  export interface SetSelfApplicationTestRecipientsRequest {
22
22
  /**
23
- * Email addresses allowed to receive auth emails. An empty array clears the allowlist (disables the gate).
23
+ * Email addresses allowed to receive auth emails when auth_email_mode is 'allowlist'. Ignored in 'unrestricted' mode. Optional — omit to leave the current list unchanged.
24
24
  * @type {Array<string>}
25
25
  * @memberof SetSelfApplicationTestRecipientsRequest
26
26
  */
27
- testRecipients: Array<string>;
27
+ testRecipients?: Array<string>;
28
+ /**
29
+ * Optional (sc-7673). Explicit auth-email gate mode. 'unrestricted' sends to everyone; 'allowlist' restricts to test_recipients (an EMPTY list in allowlist mode fails closed — blocks all auth email). Omit to leave the current mode unchanged.
30
+ * @type {string}
31
+ * @memberof SetSelfApplicationTestRecipientsRequest
32
+ */
33
+ authEmailMode?: SetSelfApplicationTestRecipientsRequestAuthEmailModeEnum;
28
34
  }
29
35
 
36
+
37
+ /**
38
+ * @export
39
+ */
40
+ export const SetSelfApplicationTestRecipientsRequestAuthEmailModeEnum = {
41
+ ALLOWLIST: 'allowlist',
42
+ UNRESTRICTED: 'unrestricted'
43
+ } as const;
44
+ export type SetSelfApplicationTestRecipientsRequestAuthEmailModeEnum = typeof SetSelfApplicationTestRecipientsRequestAuthEmailModeEnum[keyof typeof SetSelfApplicationTestRecipientsRequestAuthEmailModeEnum];
45
+
46
+
30
47
  /**
31
48
  * Check if a given object implements the SetSelfApplicationTestRecipientsRequest interface.
32
49
  */
33
50
  export function instanceOfSetSelfApplicationTestRecipientsRequest(value: object): value is SetSelfApplicationTestRecipientsRequest {
34
- if (!('testRecipients' in value) || value['testRecipients'] === undefined) return false;
35
51
  return true;
36
52
  }
37
53
 
@@ -45,7 +61,8 @@ export function SetSelfApplicationTestRecipientsRequestFromJSONTyped(json: any,
45
61
  }
46
62
  return {
47
63
 
48
- 'testRecipients': json['test_recipients'],
64
+ 'testRecipients': json['test_recipients'] == null ? undefined : json['test_recipients'],
65
+ 'authEmailMode': json['auth_email_mode'] == null ? undefined : json['auth_email_mode'],
49
66
  };
50
67
  }
51
68
 
@@ -61,6 +78,7 @@ export function SetSelfApplicationTestRecipientsRequestToJSONTyped(value?: SetSe
61
78
  return {
62
79
 
63
80
  'test_recipients': value['testRecipients'],
81
+ 'auth_email_mode': value['authEmailMode'],
64
82
  };
65
83
  }
66
84
 
@@ -229,9 +229,12 @@ export * from './OrganizationMembershipResponse';
229
229
  export * from './OrganizationMembershipWithUser';
230
230
  export * from './OrganizationResponse';
231
231
  export * from './PaginationMeta';
232
- export * from './PasswordRequirements';
232
+ export * from './PasswordPolicy';
233
233
  export * from './PasswordRequirementsResponse';
234
234
  export * from './PasswordRequirementsResponseData';
235
+ export * from './PasswordStrength';
236
+ export * from './PasswordStrengthRequest';
237
+ export * from './PasswordStrengthResponse';
235
238
  export * from './PayloadTooLargeError';
236
239
  export * from './PayloadTooLargeErrorError';
237
240
  export * from './PayloadTooLargeErrorErrorDetails';