starti.app 2.0.113 → 2.0.121

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.
@@ -1,6 +1,10 @@
1
- import { BiometricsAuthenticationType, PopulatedSaveUsernameAndPasswordConfiguration, SaveUsernameAndPasswordConfiguration } from "./BiometricsIntegration";
1
+ import { BiometricsAuthenticationType, PopulatedSaveUsernameAndPasswordConfiguration, SaveUsernameAndPasswordConfiguration, SaveUsernameAndPasswordI18n } from "./BiometricsIntegration";
2
2
  export declare class BiometricService {
3
- static saveConfigurationAndAddMiddlewareToSubmitButton(configurationKey: string, credentialsKey: string, request: SaveUsernameAndPasswordConfiguration): void;
3
+ static saveTranslations(request: SaveUsernameAndPasswordI18n & {
4
+ key?: string;
5
+ }): void;
6
+ static getTranslations(configurationKey?: string): SaveUsernameAndPasswordI18n | null;
7
+ static addMiddlewareToSubmitButton(credentialsKey: string, request: SaveUsernameAndPasswordConfiguration): void;
4
8
  static getCredentials(credentialsKey: string): {
5
9
  username: string;
6
10
  password: string;
@@ -9,8 +13,12 @@ export declare class BiometricService {
9
13
  private static getTranslatedAuthenticationType;
10
14
  private static getConfirmMessage;
11
15
  static promptUseBiometricsNextTime(populatedConfiguration: PopulatedSaveUsernameAndPasswordConfiguration): Promise<boolean>;
12
- static presentUseBiometricsNextTime(populatedConfiguration: SaveUsernameAndPasswordConfiguration, biometricsType: BiometricsAuthenticationType): Promise<boolean>;
13
- static getPopulatedConfiguration(configurationKey: string): PopulatedSaveUsernameAndPasswordConfiguration;
14
- static tryLoginAsync(configurationKey: string): Promise<boolean>;
16
+ static presentUseBiometricsNextTime(populatedConfiguration: SaveUsernameAndPasswordI18n, biometricsType: BiometricsAuthenticationType): Promise<boolean>;
17
+ static getPopulatedConfiguration(request: SaveUsernameAndPasswordConfiguration): PopulatedSaveUsernameAndPasswordConfiguration;
18
+ static tryLoginAsync(request: SaveUsernameAndPasswordConfiguration): Promise<boolean>;
15
19
  private static setInputValue;
20
+ private static getConfigurationKey;
21
+ private static upsertConfigurationKey;
22
+ static removeConfigurationKeys: () => void;
23
+ private static clearTranslationsIfNeeded;
16
24
  }
@@ -1,4 +1,4 @@
1
- import { BiometricsAuthenticationType, SaveUsernameAndPasswordConfiguration } from "./BiometricsIntegration";
1
+ import { BiometricsAuthenticationType, SaveUsernameAndPasswordI18n } from "./BiometricsIntegration";
2
2
  export declare class BiometricsDrawer {
3
3
  private static vaulDrawerService;
4
4
  static get isAvailable(): boolean;
@@ -7,6 +7,6 @@ export declare class BiometricsDrawer {
7
7
  private static getSubtitle;
8
8
  private static getAcceptButtonText;
9
9
  private static getDeclineButtonText;
10
- static presentBiometricDrawer(populatedConfiguration: SaveUsernameAndPasswordConfiguration, biometricsType: BiometricsAuthenticationType): Promise<boolean>;
10
+ static presentBiometricDrawer(populatedConfiguration: SaveUsernameAndPasswordI18n, biometricsType: BiometricsAuthenticationType): Promise<boolean>;
11
11
  static createDrawerContent(title: string, subtitle: string, acceptButtonText: string, declineButtonText: string): HTMLElement;
12
12
  }
@@ -4,7 +4,6 @@ export declare class Biometrics extends EventTarget {
4
4
  private biometricsIntegration;
5
5
  private SECURED_CONTENT_KEY;
6
6
  private SECURED_LOGIN_KEY;
7
- private BiometricsConfigurationKey;
8
7
  private BiometricsCredentialsKey;
9
8
  private defaultScanTitle;
10
9
  private defaultScanReason;
@@ -75,7 +74,7 @@ export declare class Biometrics extends EventTarget {
75
74
  *
76
75
  * @returns A promise that resolves when the username and password are successfully saved.
77
76
  */
78
- endSaveUsernameAndPassword(): Promise<void>;
77
+ endSaveUsernameAndPassword(config?: EndSaveUsernameAndPasswordConfiguration): Promise<void>;
79
78
  /**
80
79
  * Checks the current access status for biometrics.
81
80
  *
@@ -89,23 +88,20 @@ export type BiometricsResultReponse<T> = {
89
88
  result: T;
90
89
  };
91
90
  /**
92
- * The configuration for saving a username and password using biometrics.
93
- * @param usernameInputFieldSelector - The JS selector for the username input field.
94
- * @param passwordInputFieldSelector - The JS selector for the password input field.
95
- * @param submitButtonSelector - The JS selector for the submit button.
96
- * @param title - The title of the biometrics scan.
97
- * @param reason - The reason for the biometrics scan.
91
+ * Configuration options for ending the save username and password operation.
98
92
  *
99
- * @param language - The language of the biometrics scan.
100
- *
101
- * @param confirmMessageTemplate - The template for the confirm message.
102
- * @param biometricsTypeTranslations - The translations for the biometrics types.
93
+ * @param key - An optional key to identify the configuration.
103
94
  */
104
- export type SaveUsernameAndPasswordConfiguration = {
95
+ export type EndSaveUsernameAndPasswordConfiguration = {
96
+ key?: string;
97
+ };
98
+ export type SaveUsernameAndPasswordConfigurationSelectors = {
105
99
  usernameInputFieldSelector: string;
106
100
  passwordInputFieldSelector: string;
107
101
  submitButtonSelector: string;
108
102
  executingButtonSelector?: string;
103
+ };
104
+ export type SaveUsernameAndPasswordI18n = {
109
105
  title: string;
110
106
  reason: string;
111
107
  } & ({
@@ -130,6 +126,20 @@ export type SaveUsernameAndPasswordConfiguration = {
130
126
  };
131
127
  };
132
128
  });
129
+ /**
130
+ * Configuration type for saving username and password functionality.
131
+ *
132
+ * Combines selector configuration and internationalization settings
133
+ * for the save username and password feature in biometrics integration.
134
+ *
135
+ * @remarks
136
+ * This type merges `SaveUsernameAndPasswordConfigurationSelectors` for
137
+ * DOM element selection and `SaveUsernameAndPasswordI18n` for localization
138
+ * to provide a complete configuration interface.
139
+ */
140
+ export type SaveUsernameAndPasswordConfiguration = {
141
+ key?: string;
142
+ } & SaveUsernameAndPasswordConfigurationSelectors & SaveUsernameAndPasswordI18n;
133
143
  export type PopulatedSaveUsernameAndPasswordConfiguration = (SaveUsernameAndPasswordConfiguration & {
134
144
  usernameInputField: HTMLInputElement;
135
145
  passwordInputField: HTMLInputElement;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "starti.app",
3
3
  "author": "starti.app",
4
4
  "license": "MIT",
5
- "version": "2.0.113",
5
+ "version": "2.0.121",
6
6
  "description": "Use this package for easy communication with the starti.app API.",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",