@koolbase/core 12.45.0 → 12.46.0

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.
@@ -429,9 +429,18 @@ export declare class KoolbaseAuth {
429
429
  }>;
430
430
  /** Turns MFA on and returns ten recovery codes, shown this once only. Other devices are signed out. */
431
431
  confirmMfaEnrollment(code: string): Promise<string[]>;
432
+ /**
433
+ * Whether two-step sign-in is on, how many recovery codes are left, and
434
+ * what the app's two-step setting allows: `offered` (false when the app
435
+ * does not offer it, so nothing can turn it on) and `required` (nothing
436
+ * can turn it off). An API before 12.46.0 sends neither: offered, not
437
+ * required.
438
+ */
432
439
  mfaStatus(): Promise<{
433
440
  enabled: boolean;
434
441
  recoveryCodesRemaining: number;
442
+ offered: boolean;
443
+ required: boolean;
435
444
  }>;
436
445
  /** Re-confirms the second factor, opening ten minutes to change MFA. */
437
446
  stepUpMfa(params: {
package/dist/cjs/auth.js CHANGED
@@ -1217,11 +1217,23 @@ class KoolbaseAuth {
1217
1217
  await this.checkResponse(res);
1218
1218
  return (await res.json()).recovery_codes;
1219
1219
  }
1220
+ /**
1221
+ * Whether two-step sign-in is on, how many recovery codes are left, and
1222
+ * what the app's two-step setting allows: `offered` (false when the app
1223
+ * does not offer it, so nothing can turn it on) and `required` (nothing
1224
+ * can turn it off). An API before 12.46.0 sends neither: offered, not
1225
+ * required.
1226
+ */
1220
1227
  async mfaStatus() {
1221
1228
  const res = await this.authRequest('/v1/sdk/auth/mfa', { method: 'GET', includeAuth: true });
1222
1229
  await this.checkResponse(res);
1223
1230
  const d = await res.json();
1224
- return { enabled: !!d.enabled, recoveryCodesRemaining: Number(d.recovery_codes_remaining ?? 0) };
1231
+ return {
1232
+ enabled: !!d.enabled,
1233
+ recoveryCodesRemaining: Number(d.recovery_codes_remaining ?? 0),
1234
+ offered: d.offered !== false,
1235
+ required: d.required === true,
1236
+ };
1225
1237
  }
1226
1238
  /** Re-confirms the second factor, opening ten minutes to change MFA. */
1227
1239
  async stepUpMfa(params) {
@@ -429,9 +429,18 @@ export declare class KoolbaseAuth {
429
429
  }>;
430
430
  /** Turns MFA on and returns ten recovery codes, shown this once only. Other devices are signed out. */
431
431
  confirmMfaEnrollment(code: string): Promise<string[]>;
432
+ /**
433
+ * Whether two-step sign-in is on, how many recovery codes are left, and
434
+ * what the app's two-step setting allows: `offered` (false when the app
435
+ * does not offer it, so nothing can turn it on) and `required` (nothing
436
+ * can turn it off). An API before 12.46.0 sends neither: offered, not
437
+ * required.
438
+ */
432
439
  mfaStatus(): Promise<{
433
440
  enabled: boolean;
434
441
  recoveryCodesRemaining: number;
442
+ offered: boolean;
443
+ required: boolean;
435
444
  }>;
436
445
  /** Re-confirms the second factor, opening ten minutes to change MFA. */
437
446
  stepUpMfa(params: {
package/dist/esm/auth.js CHANGED
@@ -1214,11 +1214,23 @@ export class KoolbaseAuth {
1214
1214
  await this.checkResponse(res);
1215
1215
  return (await res.json()).recovery_codes;
1216
1216
  }
1217
+ /**
1218
+ * Whether two-step sign-in is on, how many recovery codes are left, and
1219
+ * what the app's two-step setting allows: `offered` (false when the app
1220
+ * does not offer it, so nothing can turn it on) and `required` (nothing
1221
+ * can turn it off). An API before 12.46.0 sends neither: offered, not
1222
+ * required.
1223
+ */
1217
1224
  async mfaStatus() {
1218
1225
  const res = await this.authRequest('/v1/sdk/auth/mfa', { method: 'GET', includeAuth: true });
1219
1226
  await this.checkResponse(res);
1220
1227
  const d = await res.json();
1221
- return { enabled: !!d.enabled, recoveryCodesRemaining: Number(d.recovery_codes_remaining ?? 0) };
1228
+ return {
1229
+ enabled: !!d.enabled,
1230
+ recoveryCodesRemaining: Number(d.recovery_codes_remaining ?? 0),
1231
+ offered: d.offered !== false,
1232
+ required: d.required === true,
1233
+ };
1222
1234
  }
1223
1235
  /** Re-confirms the second factor, opening ten minutes to change MFA. */
1224
1236
  async stepUpMfa(params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koolbase/core",
3
- "version": "12.45.0",
3
+ "version": "12.46.0",
4
4
  "description": "Koolbase SDK core \u2014 shared behaviour behind @koolbase/react-native and @koolbase/js. Install one of those, not this.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/esm/index.d.ts",