@passflow/core 0.43.0 → 0.44.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.
- package/README.md +23 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -5
- package/dist/index.d.ts +34 -5
- package/dist/index.mjs +1068 -1052
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2297,17 +2297,35 @@ export type TwoFactorCompletionOptions = {
|
|
|
2297
2297
|
trustDevice?: boolean;
|
|
2298
2298
|
};
|
|
2299
2299
|
/**
|
|
2300
|
-
* A device the user
|
|
2300
|
+
* A device of the user's on this app: one that holds a grant to stand in for
|
|
2301
|
+
* their second factor, a device key, or both.
|
|
2301
2302
|
*/
|
|
2302
2303
|
export type TwoFactorTrustedDevice = {
|
|
2303
2304
|
id: string;
|
|
2304
2305
|
user_agent?: string;
|
|
2306
|
+
/** True while the device holds a grant that stands in for the second factor. */
|
|
2307
|
+
trusted: boolean;
|
|
2305
2308
|
created_at: string;
|
|
2309
|
+
/** When the grant ends; absent on a device without one. */
|
|
2310
|
+
expires_at?: string;
|
|
2306
2311
|
last_used_at?: string;
|
|
2307
|
-
|
|
2312
|
+
/** Set when the device enrolled a device key. */
|
|
2313
|
+
device_key?: TwoFactorTrustedDeviceKey;
|
|
2314
|
+
/** Set when the device can approve sign-ins by push. */
|
|
2315
|
+
push_approval?: TwoFactorTrustedDevicePush;
|
|
2308
2316
|
/** True for the device the request came from. */
|
|
2309
2317
|
current: boolean;
|
|
2310
2318
|
};
|
|
2319
|
+
/** A device's enrolled device key, as `TwoFactorTrustedDevice.device_key`. */
|
|
2320
|
+
export type TwoFactorTrustedDeviceKey = {
|
|
2321
|
+
key_storage: 'software' | 'hardware';
|
|
2322
|
+
enrolled_at: string;
|
|
2323
|
+
last_proof_at?: string;
|
|
2324
|
+
};
|
|
2325
|
+
/** A device's push approval, as `TwoFactorTrustedDevice.push_approval`. */
|
|
2326
|
+
export type TwoFactorTrustedDevicePush = {
|
|
2327
|
+
registered_at: string;
|
|
2328
|
+
};
|
|
2311
2329
|
/** GET /v2/user/2fa/trusted-devices */
|
|
2312
2330
|
export type TwoFactorTrustedDevicesResponse = {
|
|
2313
2331
|
devices: TwoFactorTrustedDevice[];
|
|
@@ -2368,8 +2386,8 @@ export type TwoFactorSetupMagicLinkSession = {
|
|
|
2368
2386
|
userId: string;
|
|
2369
2387
|
appId?: string | null;
|
|
2370
2388
|
scope: '2fa_setup';
|
|
2371
|
-
/** `true` when the link replaces an enrolled authenticator.
|
|
2372
|
-
reset
|
|
2389
|
+
/** `true` when the link replaces an enrolled authenticator. */
|
|
2390
|
+
reset: boolean;
|
|
2373
2391
|
timestamp: number;
|
|
2374
2392
|
expiresAt: number;
|
|
2375
2393
|
};
|
|
@@ -5200,8 +5218,19 @@ export declare class TenantUserMembership {
|
|
|
5200
5218
|
export declare class TenantService {
|
|
5201
5219
|
private tenantApi;
|
|
5202
5220
|
private scopes;
|
|
5221
|
+
private readStoredAccessToken?;
|
|
5203
5222
|
private logger;
|
|
5204
|
-
|
|
5223
|
+
private tenantScopeWarned;
|
|
5224
|
+
/**
|
|
5225
|
+
* @param readStoredAccessToken Returns the stored access token. Without it the service never
|
|
5226
|
+
* warns about a token that lacks tenant membership.
|
|
5227
|
+
*/
|
|
5228
|
+
constructor(tenantApi: TenantAPI, scopes: string[], logger?: Logger, readStoredAccessToken?: (() => string | undefined) | undefined);
|
|
5229
|
+
/**
|
|
5230
|
+
* Warns once when the stored access token has no `passflow_tm` claim, which means the sign-in
|
|
5231
|
+
* did not ask for the tenant scope. Never throws: a missing or unparseable token is ignored.
|
|
5232
|
+
*/
|
|
5233
|
+
private warnIfNoTenantMembership;
|
|
5205
5234
|
/**
|
|
5206
5235
|
* Handle Passflow API errors
|
|
5207
5236
|
* @param error The error object
|
package/dist/index.d.ts
CHANGED
|
@@ -2297,17 +2297,35 @@ export type TwoFactorCompletionOptions = {
|
|
|
2297
2297
|
trustDevice?: boolean;
|
|
2298
2298
|
};
|
|
2299
2299
|
/**
|
|
2300
|
-
* A device the user
|
|
2300
|
+
* A device of the user's on this app: one that holds a grant to stand in for
|
|
2301
|
+
* their second factor, a device key, or both.
|
|
2301
2302
|
*/
|
|
2302
2303
|
export type TwoFactorTrustedDevice = {
|
|
2303
2304
|
id: string;
|
|
2304
2305
|
user_agent?: string;
|
|
2306
|
+
/** True while the device holds a grant that stands in for the second factor. */
|
|
2307
|
+
trusted: boolean;
|
|
2305
2308
|
created_at: string;
|
|
2309
|
+
/** When the grant ends; absent on a device without one. */
|
|
2310
|
+
expires_at?: string;
|
|
2306
2311
|
last_used_at?: string;
|
|
2307
|
-
|
|
2312
|
+
/** Set when the device enrolled a device key. */
|
|
2313
|
+
device_key?: TwoFactorTrustedDeviceKey;
|
|
2314
|
+
/** Set when the device can approve sign-ins by push. */
|
|
2315
|
+
push_approval?: TwoFactorTrustedDevicePush;
|
|
2308
2316
|
/** True for the device the request came from. */
|
|
2309
2317
|
current: boolean;
|
|
2310
2318
|
};
|
|
2319
|
+
/** A device's enrolled device key, as `TwoFactorTrustedDevice.device_key`. */
|
|
2320
|
+
export type TwoFactorTrustedDeviceKey = {
|
|
2321
|
+
key_storage: 'software' | 'hardware';
|
|
2322
|
+
enrolled_at: string;
|
|
2323
|
+
last_proof_at?: string;
|
|
2324
|
+
};
|
|
2325
|
+
/** A device's push approval, as `TwoFactorTrustedDevice.push_approval`. */
|
|
2326
|
+
export type TwoFactorTrustedDevicePush = {
|
|
2327
|
+
registered_at: string;
|
|
2328
|
+
};
|
|
2311
2329
|
/** GET /v2/user/2fa/trusted-devices */
|
|
2312
2330
|
export type TwoFactorTrustedDevicesResponse = {
|
|
2313
2331
|
devices: TwoFactorTrustedDevice[];
|
|
@@ -2368,8 +2386,8 @@ export type TwoFactorSetupMagicLinkSession = {
|
|
|
2368
2386
|
userId: string;
|
|
2369
2387
|
appId?: string | null;
|
|
2370
2388
|
scope: '2fa_setup';
|
|
2371
|
-
/** `true` when the link replaces an enrolled authenticator.
|
|
2372
|
-
reset
|
|
2389
|
+
/** `true` when the link replaces an enrolled authenticator. */
|
|
2390
|
+
reset: boolean;
|
|
2373
2391
|
timestamp: number;
|
|
2374
2392
|
expiresAt: number;
|
|
2375
2393
|
};
|
|
@@ -5200,8 +5218,19 @@ export declare class TenantUserMembership {
|
|
|
5200
5218
|
export declare class TenantService {
|
|
5201
5219
|
private tenantApi;
|
|
5202
5220
|
private scopes;
|
|
5221
|
+
private readStoredAccessToken?;
|
|
5203
5222
|
private logger;
|
|
5204
|
-
|
|
5223
|
+
private tenantScopeWarned;
|
|
5224
|
+
/**
|
|
5225
|
+
* @param readStoredAccessToken Returns the stored access token. Without it the service never
|
|
5226
|
+
* warns about a token that lacks tenant membership.
|
|
5227
|
+
*/
|
|
5228
|
+
constructor(tenantApi: TenantAPI, scopes: string[], logger?: Logger, readStoredAccessToken?: (() => string | undefined) | undefined);
|
|
5229
|
+
/**
|
|
5230
|
+
* Warns once when the stored access token has no `passflow_tm` claim, which means the sign-in
|
|
5231
|
+
* did not ask for the tenant scope. Never throws: a missing or unparseable token is ignored.
|
|
5232
|
+
*/
|
|
5233
|
+
private warnIfNoTenantMembership;
|
|
5205
5234
|
/**
|
|
5206
5235
|
* Handle Passflow API errors
|
|
5207
5236
|
* @param error The error object
|