@corbado/observe 0.16.0 → 0.16.2

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/dist/index.d.mts CHANGED
@@ -1049,7 +1049,8 @@ declare class SocialLoginOperationFull extends OperationFull {
1049
1049
  constructor(tracker: CorbadoTracker, config?: SocialLoginOperationConfig);
1050
1050
  }
1051
1051
 
1052
- type AppConfirmationOperationSpecType = "qr-code";
1052
+ /** How the confirmation is reached: a QR handoff or an app on the browser's device. */
1053
+ type AppConfirmationOperationSpecType = "qr-code" | "same-device";
1053
1054
  type AppConfirmationOperationStart = {
1054
1055
  explicitSpecType?: AppConfirmationOperationSpecType;
1055
1056
  };
@@ -1064,6 +1065,7 @@ type AppConfirmationOperationConfig = {
1064
1065
  declare class AppConfirmationOperationFull extends OperationFull {
1065
1066
  readonly ceremony: StepHelper<{}, {}, AppConfirmationOperationCeremonyTypedError>;
1066
1067
  readonly retry: StepHelper;
1068
+ /** Optional separate browser exchange after approval; omit when the final poll already proves acceptance. */
1067
1069
  readonly postResponse: StepHelper;
1068
1070
  constructor(tracker: CorbadoTracker, config?: AppConfirmationOperationConfig);
1069
1071
  }
@@ -2203,13 +2205,46 @@ declare class EventStore<T = Event> {
2203
2205
  size(): number;
2204
2206
  }
2205
2207
 
2206
- /** Sanitizes publicKey creation options (native values, JSON object, or JSON string). */
2208
+ /**
2209
+ * Serializes WebAuthn creation options, removing `user.name` and `user.displayName`.
2210
+ * Binary values become base64url strings. Other fields remain, including user IDs and challenges.
2211
+ *
2212
+ * @param value - Native publicKey options, a JSON object, or JSON text; not an application envelope.
2213
+ * @returns JSON text, or undefined for malformed or unserializable input.
2214
+ * @remarks Does not mutate input, read blacklisted getters, or call toJSON. No tracker initialization is required.
2215
+ * @example
2216
+ * ```ts
2217
+ * import { sanitizeCreationOptions } from "@corbado/observe";
2218
+ * const optionsJson = sanitizeCreationOptions({ user: { id: "user-id", name: "private" } });
2219
+ * ```
2220
+ */
2207
2221
  declare function sanitizeCreationOptions(value: unknown): string | undefined;
2208
- /** Sanitizes a registration credential; keeps attestation material but removes PRF results. */
2222
+ /**
2223
+ * Serializes a registration credential, removing `clientExtensionResults.prf.results`.
2224
+ * Other fields remain, including attestation material and credential IDs. Binary values become base64url strings.
2225
+ *
2226
+ * @param value - A native registration credential, JSON object, or JSON text; not an application envelope.
2227
+ * @returns JSON text, or undefined for malformed or unserializable input.
2228
+ * @remarks Does not mutate input, read blacklisted getters, or call toJSON. Encoded attestation and client-data blobs are not decoded or redacted.
2229
+ */
2209
2230
  declare function sanitizeCreationResponse(value: unknown): string | undefined;
2210
- /** Serializes publicKey authentication options. No fields are currently blacklisted. */
2231
+ /**
2232
+ * Serializes WebAuthn authentication options. No fields are currently blacklisted;
2233
+ * challenges, credential IDs, and extension inputs remain. Binary values become base64url strings.
2234
+ *
2235
+ * @param value - Native publicKey options, a JSON object, or JSON text; not an application envelope.
2236
+ * @returns JSON text, or undefined for malformed or unserializable input.
2237
+ * @remarks Does not mutate input or call toJSON. No tracker initialization is required.
2238
+ */
2211
2239
  declare function sanitizeRequestOptions(value: unknown): string | undefined;
2212
- /** Sanitizes an authentication credential; removes its login signature and PRF results. */
2240
+ /**
2241
+ * Serializes an authentication credential, removing `response.signature` and `clientExtensionResults.prf.results`.
2242
+ * Other fields remain, including credential IDs and user handles. Binary values become base64url strings.
2243
+ *
2244
+ * @param value - A native authentication credential, JSON object, or JSON text; not an application envelope.
2245
+ * @returns JSON text, or undefined for malformed or unserializable input.
2246
+ * @remarks Does not mutate input, read blacklisted getters, or call toJSON. This is a path blacklist, not general-purpose secret detection; encoded client-data blobs are not decoded or redacted.
2247
+ */
2213
2248
  declare function sanitizeAssertionResponse(value: unknown): string | undefined;
2214
2249
 
2215
2250
  /**
package/dist/index.d.ts CHANGED
@@ -1049,7 +1049,8 @@ declare class SocialLoginOperationFull extends OperationFull {
1049
1049
  constructor(tracker: CorbadoTracker, config?: SocialLoginOperationConfig);
1050
1050
  }
1051
1051
 
1052
- type AppConfirmationOperationSpecType = "qr-code";
1052
+ /** How the confirmation is reached: a QR handoff or an app on the browser's device. */
1053
+ type AppConfirmationOperationSpecType = "qr-code" | "same-device";
1053
1054
  type AppConfirmationOperationStart = {
1054
1055
  explicitSpecType?: AppConfirmationOperationSpecType;
1055
1056
  };
@@ -1064,6 +1065,7 @@ type AppConfirmationOperationConfig = {
1064
1065
  declare class AppConfirmationOperationFull extends OperationFull {
1065
1066
  readonly ceremony: StepHelper<{}, {}, AppConfirmationOperationCeremonyTypedError>;
1066
1067
  readonly retry: StepHelper;
1068
+ /** Optional separate browser exchange after approval; omit when the final poll already proves acceptance. */
1067
1069
  readonly postResponse: StepHelper;
1068
1070
  constructor(tracker: CorbadoTracker, config?: AppConfirmationOperationConfig);
1069
1071
  }
@@ -2203,13 +2205,46 @@ declare class EventStore<T = Event> {
2203
2205
  size(): number;
2204
2206
  }
2205
2207
 
2206
- /** Sanitizes publicKey creation options (native values, JSON object, or JSON string). */
2208
+ /**
2209
+ * Serializes WebAuthn creation options, removing `user.name` and `user.displayName`.
2210
+ * Binary values become base64url strings. Other fields remain, including user IDs and challenges.
2211
+ *
2212
+ * @param value - Native publicKey options, a JSON object, or JSON text; not an application envelope.
2213
+ * @returns JSON text, or undefined for malformed or unserializable input.
2214
+ * @remarks Does not mutate input, read blacklisted getters, or call toJSON. No tracker initialization is required.
2215
+ * @example
2216
+ * ```ts
2217
+ * import { sanitizeCreationOptions } from "@corbado/observe";
2218
+ * const optionsJson = sanitizeCreationOptions({ user: { id: "user-id", name: "private" } });
2219
+ * ```
2220
+ */
2207
2221
  declare function sanitizeCreationOptions(value: unknown): string | undefined;
2208
- /** Sanitizes a registration credential; keeps attestation material but removes PRF results. */
2222
+ /**
2223
+ * Serializes a registration credential, removing `clientExtensionResults.prf.results`.
2224
+ * Other fields remain, including attestation material and credential IDs. Binary values become base64url strings.
2225
+ *
2226
+ * @param value - A native registration credential, JSON object, or JSON text; not an application envelope.
2227
+ * @returns JSON text, or undefined for malformed or unserializable input.
2228
+ * @remarks Does not mutate input, read blacklisted getters, or call toJSON. Encoded attestation and client-data blobs are not decoded or redacted.
2229
+ */
2209
2230
  declare function sanitizeCreationResponse(value: unknown): string | undefined;
2210
- /** Serializes publicKey authentication options. No fields are currently blacklisted. */
2231
+ /**
2232
+ * Serializes WebAuthn authentication options. No fields are currently blacklisted;
2233
+ * challenges, credential IDs, and extension inputs remain. Binary values become base64url strings.
2234
+ *
2235
+ * @param value - Native publicKey options, a JSON object, or JSON text; not an application envelope.
2236
+ * @returns JSON text, or undefined for malformed or unserializable input.
2237
+ * @remarks Does not mutate input or call toJSON. No tracker initialization is required.
2238
+ */
2211
2239
  declare function sanitizeRequestOptions(value: unknown): string | undefined;
2212
- /** Sanitizes an authentication credential; removes its login signature and PRF results. */
2240
+ /**
2241
+ * Serializes an authentication credential, removing `response.signature` and `clientExtensionResults.prf.results`.
2242
+ * Other fields remain, including credential IDs and user handles. Binary values become base64url strings.
2243
+ *
2244
+ * @param value - A native authentication credential, JSON object, or JSON text; not an application envelope.
2245
+ * @returns JSON text, or undefined for malformed or unserializable input.
2246
+ * @remarks Does not mutate input, read blacklisted getters, or call toJSON. This is a path blacklist, not general-purpose secret detection; encoded client-data blobs are not decoded or redacted.
2247
+ */
2213
2248
  declare function sanitizeAssertionResponse(value: unknown): string | undefined;
2214
2249
 
2215
2250
  /**