starti.app 2.0.43 → 2.0.52

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.
@@ -50,9 +50,43 @@ export declare class App extends EventTargetWithType<{
50
50
  * ```
51
51
  */
52
52
  addInternalDomain: (domain: string) => Promise<void>;
53
+ /**
54
+ * Get the internal domains of the app.
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * const internalDomains = await startiapp.App.getInternalDomains();
59
+ * console.log(internalDomains);
60
+ * ```
61
+ */
53
62
  getInternalDomains: () => Promise<void>;
63
+ /**
64
+ * Add external domains to the app.
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * await startiapp.App.addExternalDomains(/example.com/, /starti.app/);
69
+ * ```
70
+ */
54
71
  addExternalDomains: (...domains: RegExp[]) => Promise<void>;
72
+ /**
73
+ * Remove external domains from the app.
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * await startiapp.App.removeExternalDomains(/example.com/, /starti.app/);
78
+ * ```
79
+ */
55
80
  removeExternalDomains: (...domains: RegExp[]) => Promise<void>;
81
+ /**
82
+ * Get the external domains of the app.
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * const externalDomains = await startiapp.App.getExternalDomains();
87
+ * console.log(externalDomains);
88
+ * ```
89
+ */
56
90
  getExternalDomains: () => Promise<void>;
57
91
  /**
58
92
  * Remove an internal domain from the app.
@@ -73,7 +107,18 @@ export declare class App extends EventTargetWithType<{
73
107
  setSafeAreaBackgroundColor: (color: string) => Promise<boolean>;
74
108
  /** Sets the navigation spinner options for the app. */
75
109
  setSpinner: (options: SpinnerOptions) => Promise<void>;
110
+ /**
111
+ * Hides the navigation spinner.
112
+ */
76
113
  hideSpinner: () => Promise<void>;
114
+ /**
115
+ * Shows the navigation spinner.
116
+ *
117
+ * @example
118
+ * ```typescript
119
+ * await startiapp.App.showSpinner();
120
+ * ```
121
+ */
77
122
  showSpinner: (options?: SpinnerOptions) => Promise<void>;
78
123
  /** Enables the screen to rotate */
79
124
  enableScreenRotation: () => Promise<void>;
@@ -0,0 +1,12 @@
1
+ import { PopulatedSaveUsernameAndPasswordConfiguration, SaveUsernameAndPasswordConfiguration } from "./BiometricsIntegration";
2
+ export declare class BiometricService {
3
+ static saveConfigurationAndAddMiddlewareToSubmitButton(configurationKey: string, credentialsKey: string, request: SaveUsernameAndPasswordConfiguration): void;
4
+ static getCredentials(credentialsKey: string): {
5
+ username: string;
6
+ password: string;
7
+ } | null;
8
+ static removeConfiguration(configurationKey: string): void;
9
+ static promptForBiometrics(populatedConfiguration: PopulatedSaveUsernameAndPasswordConfiguration): Promise<boolean>;
10
+ static getPopulatedConfiguration(configurationKey: string): PopulatedSaveUsernameAndPasswordConfiguration;
11
+ static tryLoginAsync(configurationKey: string): Promise<boolean>;
12
+ }
@@ -4,6 +4,8 @@ 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
+ private BiometricsCredentialsKey;
7
9
  private defaultScanTitle;
8
10
  private defaultScanReason;
9
11
  constructor(startiapp: Startiapp);
@@ -61,9 +63,44 @@ export declare class Biometrics extends EventTarget {
61
63
  * @returns A promise that resolves when the secured content is successfully removed.
62
64
  */
63
65
  removeSecuredContent(): Promise<void>;
66
+ /**
67
+ * Starts the process of saving a username and password using biometrics.
68
+ * When logged in successfully, make sure to call {@link endSaveUsernameAndPassword} to save the username and password.
69
+ *
70
+ * @param request - The configuration for saving the username and password.
71
+ */
72
+ startSaveUsernameAndPassword(request: SaveUsernameAndPasswordConfiguration): Promise<void>;
73
+ /**
74
+ * Ends the process of saving a username and password using biometrics.
75
+ *
76
+ * @returns A promise that resolves when the username and password are successfully saved.
77
+ */
78
+ endSaveUsernameAndPassword(): Promise<void>;
64
79
  }
65
80
  export type BiometricsAuthenticationType = "None" | "Face" | "Fingerprint";
66
81
  export type BiometricsResultReponse<T> = {
67
82
  key: string;
68
83
  result: T;
69
84
  };
85
+ /**
86
+ * The configuration for saving a username and password using biometrics.
87
+ * @param usernameInputFieldSelector - The JS selector for the username input field.
88
+ * @param passwordInputFieldSelector - The JS selector for the password input field.
89
+ * @param submitButtonSelector - The JS selector for the submit button.
90
+ * @param title - The title of the biometrics scan.
91
+ * @param reason - The reason for the biometrics scan.
92
+ */
93
+ export type SaveUsernameAndPasswordConfiguration = {
94
+ usernameInputFieldSelector: string;
95
+ passwordInputFieldSelector: string;
96
+ submitButtonSelector: string;
97
+ title: string;
98
+ reason: string;
99
+ };
100
+ export type PopulatedSaveUsernameAndPasswordConfiguration = SaveUsernameAndPasswordConfiguration & {
101
+ usernameInputField: HTMLInputElement;
102
+ passwordInputField: HTMLInputElement;
103
+ submitButton: HTMLButtonElement;
104
+ } | {
105
+ error: string;
106
+ };
@@ -1,5 +1,5 @@
1
1
  import { NavigationSpinnerOptions, RegexDto } from "./integrations/App/typings";
2
- import { BiometricsAuthenticationType, BiometricsResultReponse } from "./integrations/Biometrics/BiometricsIntegration";
2
+ import { BiometricsAuthenticationType, BiometricsResultReponse, SaveUsernameAndPasswordConfiguration } from "./integrations/Biometrics/BiometricsIntegration";
3
3
  import { InApPurchasePurchaseType, InAppPurchaseGetProductResponse, InAppPurchaseProductResponse, InAppPurchaseResponse } from "./integrations/InAppPurchase/InAppPurchaseIntegration";
4
4
  import { GeofenceRegion, Location, LocationListeningOptions, LocationOptions } from "./integrations/Location/types";
5
5
  import { ListenResponse, NetworkAccess } from "./integrations/Network/NetworkIntegration";
@@ -71,6 +71,8 @@ type BiometricIntegration = {
71
71
  getSecuredContent(key: string, title: string, reason: string): BiometricsResultReponse<string | null>;
72
72
  hasSecuredContent(key: string): BiometricsResultReponse<boolean>;
73
73
  removeSecuredContent(key: string): void;
74
+ startSaveUsernameAndPassword(request: SaveUsernameAndPasswordConfiguration): void;
75
+ endSaveUsernameAndPassword(): void;
74
76
  };
75
77
  type CalendarIntegration = {
76
78
  isAccessGranted(): void;
@@ -0,0 +1,10 @@
1
+ export declare const SessionStorage: {
2
+ getItem<T>(key: string): T | null;
3
+ setItem<T>(key: string, value: T): void;
4
+ removeItem(key: string): void;
5
+ };
6
+ export declare const LocalStorage: {
7
+ getItem<T>(key: string): T | null;
8
+ setItem<T>(key: string, value: T): void;
9
+ removeItem(key: string): void;
10
+ };
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.43",
5
+ "version": "2.0.52",
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",