@sekyro/react 0.1.0-rc.4 → 0.1.0-rc.5

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.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, RefObject } from 'react';
3
- import { CaptureErrorKind, GateHint, ReasonCode, CameraPermissionState, CameraFacing, Verification, CaptureError, CapturedArtifacts, VerificationResult, CaptureState } from '@sekyro/web';
3
+ import { CaptureErrorKind, GateHint, ReasonCode, CameraPermissionState, CameraFacing, Verification, CaptureError, CapturedArtifacts, VerificationResult, CaptureState, HostedBranding } from '@sekyro/web';
4
4
 
5
5
  /** A built-in tip (copy `capture.tips.<id>`, built-in icon). */
6
6
  type BuiltInTipId = "light" | "uncover" | "eyeLevel" | "straight";
@@ -79,10 +79,41 @@ interface Strings {
79
79
  "reasons.expired_document": string;
80
80
  "reasons.authenticity_review": string;
81
81
  "reasons.registry_mismatch": string;
82
+ "reasons.document_nni_mismatch": string;
82
83
  "reasons.otp_mismatch": string;
83
84
  "reasons.otp_expired": string;
84
85
  "reasons.otp_send_failed": string;
85
86
  "reasons.uncalibrated_capture_channel": string;
87
+ "reasons.location_not_allowed": string;
88
+ "reasons.anonymizer_blocked": string;
89
+ "reasons.nationality_not_allowed": string;
90
+ "reasons.document_type_not_accepted": string;
91
+ "reasons.underage": string;
92
+ "reasons.age_unverifiable": string;
93
+ "reasons.name_mismatch": string;
94
+ "reasons.birth_date_mismatch": string;
95
+ "reasons.nationality_mismatch": string;
96
+ "reasons.document_number_mismatch": string;
97
+ "reasons.liveness_inconclusive": string;
98
+ "reasons.match_inconclusive": string;
99
+ "reasons.document_authenticity": string;
100
+ "reasons.mobile_required": string;
101
+ "reasons.capture_tampered": string;
102
+ "reasons.device_velocity_exceeded": string;
103
+ /** `device_cooldown` without a usable `retryAfter`. */
104
+ "reasons.device_cooldown": string;
105
+ /** `device_cooldown`, `{time}` = a relative time ("in 5 minutes"). */
106
+ "cooldown.retryIn": string;
107
+ /** `device_cooldown`, `{time}` = a clock time (with the date when not today). */
108
+ "cooldown.retryAt": string;
109
+ /** The model service is busy and the SDK retries by itself. */
110
+ "capture.busy": string;
111
+ "errors.inference_unavailable": string;
112
+ "method.title": string;
113
+ "method.description": string;
114
+ "method.national_number": string;
115
+ "method.document_photo": string;
116
+ "errors.method_required": string;
86
117
  "errors.attestation_invalid": string;
87
118
  "errors.network_error": string;
88
119
  "errors.session_expired": string;
@@ -131,6 +162,18 @@ declare function captureErrorStringKey(kind: CaptureErrorKind): StringKey;
131
162
  * `reasons.*`. Returns `null` for a reason without built-in copy.
132
163
  */
133
164
  declare function reasonStringKey(reason: ReasonCode): StringKey | null;
165
+ /**
166
+ * When a device in cooldown may verify again (`device_cooldown` +
167
+ * `retryAfter`), as the copy key and its `{time}`: within the hour a relative
168
+ * time ("in 5 minutes", minutes rounded up) for `cooldown.retryIn`; later a
169
+ * clock time — with the date when it is not today — for `cooldown.retryAt`.
170
+ * `null` when `retryAfter` is missing, invalid or already past (use
171
+ * `reasons.device_cooldown`). Locale digits and wording come from `Intl`.
172
+ */
173
+ declare function retryAfterTime(locale: SekyroLocale, retryAfter: string | undefined, now?: Date): {
174
+ key: "cooldown.retryIn" | "cooldown.retryAt";
175
+ time: string;
176
+ } | null;
134
177
  /**
135
178
  * The remaining-attempts line for `count`, pluralized with the locale's CLDR
136
179
  * rules (`Intl.PluralRules`) and the locale's digits (`Intl.NumberFormat`) —
@@ -171,7 +214,7 @@ interface VoiceOptions {
171
214
  * pass a new object to change it). A key without a URL — or a resolver that
172
215
  * throws — means "no clip" (speech fallback applies).
173
216
  *
174
- * Default: in verification mode, the Sekyro clip set delivered with the
217
+ * Default: in verification mode, the Sekyro AI clip set delivered with the
175
218
  * session (`https://assets.sekyro.ai` — allow it in your CSP `media-src`);
176
219
  * in capture-only mode, none (device voice only).
177
220
  */
@@ -298,7 +341,7 @@ interface LivenessCaptureProps {
298
341
  defaultFacing?: CameraFacing;
299
342
  /**
300
343
  * Voice guidance (on by default). Clips: `voice.clips` when given; else, in
301
- * verification mode, the Sekyro clip set delivered with the session (served
344
+ * verification mode, the Sekyro AI clip set delivered with the session (served
302
345
  * from `https://assets.sekyro.ai` — allow it in your CSP `media-src`); else
303
346
  * none. The device voice covers any key without a clip.
304
347
  * `false` = no speech, no voice switch, no stage chip, no "Listen" button.
@@ -370,6 +413,17 @@ declare const DEFAULT_THEME: Required<SekyroTheme> & {
370
413
  };
371
414
  /** The CSS custom properties a theme resolves to (defaults filled in). */
372
415
  declare function themeToCssVars(theme?: SekyroTheme): Record<string, string>;
416
+ /**
417
+ * Map the session's org / app branding (`HostedSessionView.branding`, set in
418
+ * the Sekyro dashboard) onto a {@link SekyroTheme}. Each colour maps to the
419
+ * theme key of the same name and the focus ring follows `brand`. Values that
420
+ * are not `#rrggbb` are ignored. Combine with your own theme through
421
+ * {@link mergeThemes} — pass yours LAST so it wins:
422
+ * `mergeThemes(brandingToTheme(view.branding), myTheme)`.
423
+ */
424
+ declare function brandingToTheme(branding: HostedBranding | undefined): SekyroTheme;
425
+ /** Merge themes left to right: a later theme wins per token (colours merge per key). */
426
+ declare function mergeThemes(...themes: (SekyroTheme | undefined)[]): SekyroTheme;
373
427
  /** Props of {@link SekyroThemeProvider}. */
374
428
  interface SekyroThemeProviderProps {
375
429
  /** Partial theme; unset tokens keep the {@link DEFAULT_THEME} values. */
@@ -388,4 +442,4 @@ declare function SekyroThemeProvider({ theme, children, className }: SekyroTheme
388
442
  /** The complete dictionary for `locale` with `overrides` merged on top. */
389
443
  declare function resolveStrings(locale: SekyroLocale, overrides?: Partial<Strings>): Strings;
390
444
 
391
- export { type BuiltInTipId, DEFAULT_THEME, DEFAULT_TIPS, type IntroContext, type IntroTip, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, type LivenessNotice, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, VOICE_KEYS, type VoiceClipMap, type VoiceClipResolver, type VoiceClipSource, type VoiceControl, type VoiceKey, type VoiceOptions, ar, attemptsRemainingText, captureErrorStringKey, en, fr, hintStringKey, reasonStringKey, resolveStrings, themeToCssVars };
445
+ export { type BuiltInTipId, DEFAULT_THEME, DEFAULT_TIPS, type IntroContext, type IntroTip, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, type LivenessNotice, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, VOICE_KEYS, type VoiceClipMap, type VoiceClipResolver, type VoiceClipSource, type VoiceControl, type VoiceKey, type VoiceOptions, ar, attemptsRemainingText, brandingToTheme, captureErrorStringKey, en, fr, hintStringKey, mergeThemes, reasonStringKey, resolveStrings, retryAfterTime, themeToCssVars };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, RefObject } from 'react';
3
- import { CaptureErrorKind, GateHint, ReasonCode, CameraPermissionState, CameraFacing, Verification, CaptureError, CapturedArtifacts, VerificationResult, CaptureState } from '@sekyro/web';
3
+ import { CaptureErrorKind, GateHint, ReasonCode, CameraPermissionState, CameraFacing, Verification, CaptureError, CapturedArtifacts, VerificationResult, CaptureState, HostedBranding } from '@sekyro/web';
4
4
 
5
5
  /** A built-in tip (copy `capture.tips.<id>`, built-in icon). */
6
6
  type BuiltInTipId = "light" | "uncover" | "eyeLevel" | "straight";
@@ -79,10 +79,41 @@ interface Strings {
79
79
  "reasons.expired_document": string;
80
80
  "reasons.authenticity_review": string;
81
81
  "reasons.registry_mismatch": string;
82
+ "reasons.document_nni_mismatch": string;
82
83
  "reasons.otp_mismatch": string;
83
84
  "reasons.otp_expired": string;
84
85
  "reasons.otp_send_failed": string;
85
86
  "reasons.uncalibrated_capture_channel": string;
87
+ "reasons.location_not_allowed": string;
88
+ "reasons.anonymizer_blocked": string;
89
+ "reasons.nationality_not_allowed": string;
90
+ "reasons.document_type_not_accepted": string;
91
+ "reasons.underage": string;
92
+ "reasons.age_unverifiable": string;
93
+ "reasons.name_mismatch": string;
94
+ "reasons.birth_date_mismatch": string;
95
+ "reasons.nationality_mismatch": string;
96
+ "reasons.document_number_mismatch": string;
97
+ "reasons.liveness_inconclusive": string;
98
+ "reasons.match_inconclusive": string;
99
+ "reasons.document_authenticity": string;
100
+ "reasons.mobile_required": string;
101
+ "reasons.capture_tampered": string;
102
+ "reasons.device_velocity_exceeded": string;
103
+ /** `device_cooldown` without a usable `retryAfter`. */
104
+ "reasons.device_cooldown": string;
105
+ /** `device_cooldown`, `{time}` = a relative time ("in 5 minutes"). */
106
+ "cooldown.retryIn": string;
107
+ /** `device_cooldown`, `{time}` = a clock time (with the date when not today). */
108
+ "cooldown.retryAt": string;
109
+ /** The model service is busy and the SDK retries by itself. */
110
+ "capture.busy": string;
111
+ "errors.inference_unavailable": string;
112
+ "method.title": string;
113
+ "method.description": string;
114
+ "method.national_number": string;
115
+ "method.document_photo": string;
116
+ "errors.method_required": string;
86
117
  "errors.attestation_invalid": string;
87
118
  "errors.network_error": string;
88
119
  "errors.session_expired": string;
@@ -131,6 +162,18 @@ declare function captureErrorStringKey(kind: CaptureErrorKind): StringKey;
131
162
  * `reasons.*`. Returns `null` for a reason without built-in copy.
132
163
  */
133
164
  declare function reasonStringKey(reason: ReasonCode): StringKey | null;
165
+ /**
166
+ * When a device in cooldown may verify again (`device_cooldown` +
167
+ * `retryAfter`), as the copy key and its `{time}`: within the hour a relative
168
+ * time ("in 5 minutes", minutes rounded up) for `cooldown.retryIn`; later a
169
+ * clock time — with the date when it is not today — for `cooldown.retryAt`.
170
+ * `null` when `retryAfter` is missing, invalid or already past (use
171
+ * `reasons.device_cooldown`). Locale digits and wording come from `Intl`.
172
+ */
173
+ declare function retryAfterTime(locale: SekyroLocale, retryAfter: string | undefined, now?: Date): {
174
+ key: "cooldown.retryIn" | "cooldown.retryAt";
175
+ time: string;
176
+ } | null;
134
177
  /**
135
178
  * The remaining-attempts line for `count`, pluralized with the locale's CLDR
136
179
  * rules (`Intl.PluralRules`) and the locale's digits (`Intl.NumberFormat`) —
@@ -171,7 +214,7 @@ interface VoiceOptions {
171
214
  * pass a new object to change it). A key without a URL — or a resolver that
172
215
  * throws — means "no clip" (speech fallback applies).
173
216
  *
174
- * Default: in verification mode, the Sekyro clip set delivered with the
217
+ * Default: in verification mode, the Sekyro AI clip set delivered with the
175
218
  * session (`https://assets.sekyro.ai` — allow it in your CSP `media-src`);
176
219
  * in capture-only mode, none (device voice only).
177
220
  */
@@ -298,7 +341,7 @@ interface LivenessCaptureProps {
298
341
  defaultFacing?: CameraFacing;
299
342
  /**
300
343
  * Voice guidance (on by default). Clips: `voice.clips` when given; else, in
301
- * verification mode, the Sekyro clip set delivered with the session (served
344
+ * verification mode, the Sekyro AI clip set delivered with the session (served
302
345
  * from `https://assets.sekyro.ai` — allow it in your CSP `media-src`); else
303
346
  * none. The device voice covers any key without a clip.
304
347
  * `false` = no speech, no voice switch, no stage chip, no "Listen" button.
@@ -370,6 +413,17 @@ declare const DEFAULT_THEME: Required<SekyroTheme> & {
370
413
  };
371
414
  /** The CSS custom properties a theme resolves to (defaults filled in). */
372
415
  declare function themeToCssVars(theme?: SekyroTheme): Record<string, string>;
416
+ /**
417
+ * Map the session's org / app branding (`HostedSessionView.branding`, set in
418
+ * the Sekyro dashboard) onto a {@link SekyroTheme}. Each colour maps to the
419
+ * theme key of the same name and the focus ring follows `brand`. Values that
420
+ * are not `#rrggbb` are ignored. Combine with your own theme through
421
+ * {@link mergeThemes} — pass yours LAST so it wins:
422
+ * `mergeThemes(brandingToTheme(view.branding), myTheme)`.
423
+ */
424
+ declare function brandingToTheme(branding: HostedBranding | undefined): SekyroTheme;
425
+ /** Merge themes left to right: a later theme wins per token (colours merge per key). */
426
+ declare function mergeThemes(...themes: (SekyroTheme | undefined)[]): SekyroTheme;
373
427
  /** Props of {@link SekyroThemeProvider}. */
374
428
  interface SekyroThemeProviderProps {
375
429
  /** Partial theme; unset tokens keep the {@link DEFAULT_THEME} values. */
@@ -388,4 +442,4 @@ declare function SekyroThemeProvider({ theme, children, className }: SekyroTheme
388
442
  /** The complete dictionary for `locale` with `overrides` merged on top. */
389
443
  declare function resolveStrings(locale: SekyroLocale, overrides?: Partial<Strings>): Strings;
390
444
 
391
- export { type BuiltInTipId, DEFAULT_THEME, DEFAULT_TIPS, type IntroContext, type IntroTip, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, type LivenessNotice, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, VOICE_KEYS, type VoiceClipMap, type VoiceClipResolver, type VoiceClipSource, type VoiceControl, type VoiceKey, type VoiceOptions, ar, attemptsRemainingText, captureErrorStringKey, en, fr, hintStringKey, reasonStringKey, resolveStrings, themeToCssVars };
445
+ export { type BuiltInTipId, DEFAULT_THEME, DEFAULT_TIPS, type IntroContext, type IntroTip, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, type LivenessNotice, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, VOICE_KEYS, type VoiceClipMap, type VoiceClipResolver, type VoiceClipSource, type VoiceControl, type VoiceKey, type VoiceOptions, ar, attemptsRemainingText, brandingToTheme, captureErrorStringKey, en, fr, hintStringKey, mergeThemes, reasonStringKey, resolveStrings, retryAfterTime, themeToCssVars };