@zyphr-dev/node-sdk 0.1.49 → 0.1.51

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyphr-dev/node-sdk",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "description": "Official Zyphr SDK for Node.js, React, and React Native",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -48,11 +48,17 @@ export interface ApplicationSelf {
48
48
  */
49
49
  signingAlgorithm: ApplicationSelfSigningAlgorithmEnum;
50
50
  /**
51
- * The auth-email test allowlist. When non-empty, only these addresses receive auth emails (the gate from sc-7443); an empty array disables the gate. Settable via PATCH /auth/application (sc-7600).
51
+ * The auth-email allowlist. In `allowlist` mode, only these addresses receive auth emails; in `unrestricted` mode it is ignored. Settable via PATCH /auth/application (sc-7600).
52
52
  * @type {Array<string>}
53
53
  * @memberof ApplicationSelf
54
54
  */
55
55
  testRecipients: Array<string>;
56
+ /**
57
+ * Explicit auth-email gate mode (sc-7673). `unrestricted` sends auth emails to everyone. `allowlist` restricts auth email to `test_recipients` — and an EMPTY allowlist in this mode fails CLOSED (blocks all auth email). This replaces the previous behavior where the gate was inferred from whether `test_recipients` was empty. Defaults to `unrestricted`.
58
+ * @type {string}
59
+ * @memberof ApplicationSelf
60
+ */
61
+ authEmailMode: ApplicationSelfAuthEmailModeEnum;
56
62
  }
57
63
 
58
64
 
@@ -75,6 +81,15 @@ export const ApplicationSelfSigningAlgorithmEnum = {
75
81
  } as const;
76
82
  export type ApplicationSelfSigningAlgorithmEnum = typeof ApplicationSelfSigningAlgorithmEnum[keyof typeof ApplicationSelfSigningAlgorithmEnum];
77
83
 
84
+ /**
85
+ * @export
86
+ */
87
+ export const ApplicationSelfAuthEmailModeEnum = {
88
+ ALLOWLIST: 'allowlist',
89
+ UNRESTRICTED: 'unrestricted'
90
+ } as const;
91
+ export type ApplicationSelfAuthEmailModeEnum = typeof ApplicationSelfAuthEmailModeEnum[keyof typeof ApplicationSelfAuthEmailModeEnum];
92
+
78
93
 
79
94
  /**
80
95
  * Check if a given object implements the ApplicationSelf interface.
@@ -85,6 +100,7 @@ export function instanceOfApplicationSelf(value: object): value is ApplicationSe
85
100
  if (!('environment' in value) || value['environment'] === undefined) return false;
86
101
  if (!('signingAlgorithm' in value) || value['signingAlgorithm'] === undefined) return false;
87
102
  if (!('testRecipients' in value) || value['testRecipients'] === undefined) return false;
103
+ if (!('authEmailMode' in value) || value['authEmailMode'] === undefined) return false;
88
104
  return true;
89
105
  }
90
106
 
@@ -103,6 +119,7 @@ export function ApplicationSelfFromJSONTyped(json: any, ignoreDiscriminator: boo
103
119
  'environment': json['environment'],
104
120
  'signingAlgorithm': json['signing_algorithm'],
105
121
  'testRecipients': json['test_recipients'],
122
+ 'authEmailMode': json['auth_email_mode'],
106
123
  };
107
124
  }
108
125
 
@@ -122,6 +139,7 @@ export function ApplicationSelfToJSONTyped(value?: ApplicationSelf | null, ignor
122
139
  'environment': value['environment'],
123
140
  'signing_algorithm': value['signingAlgorithm'],
124
141
  'test_recipients': value['testRecipients'],
142
+ 'auth_email_mode': value['authEmailMode'],
125
143
  };
126
144
  }
127
145
 
@@ -61,6 +61,12 @@ export interface PasswordPolicy {
61
61
  * @memberof PasswordPolicy
62
62
  */
63
63
  disallowCommon: boolean;
64
+ /**
65
+ * Whether passwords found in the HaveIBeenPwned breach corpus are rejected at registration/reset. Checked via k-anonymity (only a 5-char SHA-1 prefix leaves our infrastructure) and fail-open: if the breach source is unavailable the password is allowed. Default false (advisory only — the breach signal is returned but does not gate acceptance unless enabled).
66
+ * @type {boolean}
67
+ * @memberof PasswordPolicy
68
+ */
69
+ disallowBreached: boolean;
64
70
  }
65
71
 
66
72
  /**
@@ -74,6 +80,7 @@ export function instanceOfPasswordPolicy(value: object): value is PasswordPolicy
74
80
  if (!('requireNumbers' in value) || value['requireNumbers'] === undefined) return false;
75
81
  if (!('requireSpecial' in value) || value['requireSpecial'] === undefined) return false;
76
82
  if (!('disallowCommon' in value) || value['disallowCommon'] === undefined) return false;
83
+ if (!('disallowBreached' in value) || value['disallowBreached'] === undefined) return false;
77
84
  return true;
78
85
  }
79
86
 
@@ -94,6 +101,7 @@ export function PasswordPolicyFromJSONTyped(json: any, ignoreDiscriminator: bool
94
101
  'requireNumbers': json['require_numbers'],
95
102
  'requireSpecial': json['require_special'],
96
103
  'disallowCommon': json['disallow_common'],
104
+ 'disallowBreached': json['disallow_breached'],
97
105
  };
98
106
  }
99
107
 
@@ -115,6 +123,7 @@ export function PasswordPolicyToJSONTyped(value?: PasswordPolicy | null, ignoreD
115
123
  'require_numbers': value['requireNumbers'],
116
124
  'require_special': value['requireSpecial'],
117
125
  'disallow_common': value['disallowCommon'],
126
+ 'disallow_breached': value['disallowBreached'],
118
127
  };
119
128
  }
120
129
 
@@ -20,13 +20,25 @@ import { mapValues } from '../runtime';
20
20
  */
21
21
  export interface PasswordStrength {
22
22
  /**
23
- * Whether the password would be accepted by the server's enforcement path. A password that is valid here is accepted by registration.
23
+ * Whether the password would be accepted by the server's enforcement path. A password that is valid here is accepted by registration. When the application enables `disallow_breached`, a breached password is `valid: false` here AND rejected by register/reset (no drift).
24
24
  * @type {boolean}
25
25
  * @memberof PasswordStrength
26
26
  */
27
27
  valid: boolean;
28
28
  /**
29
- * Strength score, 0-100.
29
+ * Whether the password appears in the HaveIBeenPwned breach corpus. This is a distinct signal from `valid` and is always returned regardless of the app's `disallow_breached` setting. Fail-open: if the breach source is unavailable this is `false`.
30
+ * @type {boolean}
31
+ * @memberof PasswordStrength
32
+ */
33
+ breached: boolean;
34
+ /**
35
+ * HIBP occurrence count for the password (0 if not breached or if the breach lookup failed/was unavailable).
36
+ * @type {number}
37
+ * @memberof PasswordStrength
38
+ */
39
+ breachCount: number;
40
+ /**
41
+ * Strength score, 0-100. A pure composition measure — independent of the breach signal.
30
42
  * @type {number}
31
43
  * @memberof PasswordStrength
32
44
  */
@@ -63,6 +75,8 @@ export type PasswordStrengthLabelEnum = typeof PasswordStrengthLabelEnum[keyof t
63
75
  */
64
76
  export function instanceOfPasswordStrength(value: object): value is PasswordStrength {
65
77
  if (!('valid' in value) || value['valid'] === undefined) return false;
78
+ if (!('breached' in value) || value['breached'] === undefined) return false;
79
+ if (!('breachCount' in value) || value['breachCount'] === undefined) return false;
66
80
  if (!('score' in value) || value['score'] === undefined) return false;
67
81
  if (!('label' in value) || value['label'] === undefined) return false;
68
82
  if (!('feedback' in value) || value['feedback'] === undefined) return false;
@@ -80,6 +94,8 @@ export function PasswordStrengthFromJSONTyped(json: any, ignoreDiscriminator: bo
80
94
  return {
81
95
 
82
96
  'valid': json['valid'],
97
+ 'breached': json['breached'],
98
+ 'breachCount': json['breach_count'],
83
99
  'score': json['score'],
84
100
  'label': json['label'],
85
101
  'feedback': json['feedback'],
@@ -98,6 +114,8 @@ export function PasswordStrengthToJSONTyped(value?: PasswordStrength | null, ign
98
114
  return {
99
115
 
100
116
  'valid': value['valid'],
117
+ 'breached': value['breached'],
118
+ 'breach_count': value['breachCount'],
101
119
  'score': value['score'],
102
120
  'label': value['label'],
103
121
  'feedback': value['feedback'],
@@ -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