mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-05-18 21:40:41 -04:00
Move shared projects to dist/shared (#900)
This commit is contained in:
committed by
Leendert de Borst
parent
ecd592e74f
commit
ec11ab0817
14
.github/workflows/browser-extension-build.yml
vendored
14
.github/workflows/browser-extension-build.yml
vendored
@@ -32,8 +32,9 @@ jobs:
|
||||
run: |
|
||||
# Check if files exist and were recently modified
|
||||
TARGET_DIRS=(
|
||||
"apps/browser-extension/src/utils/shared/identity-generator"
|
||||
"apps/browser-extension/src/utils/shared/password-generator"
|
||||
"apps/browser-extension/src/utils/dist/shared/identity-generator"
|
||||
"apps/browser-extension/src/utils/dist/shared/password-generator"
|
||||
"apps/browser-extension/src/utils/dist/shared/models"
|
||||
)
|
||||
|
||||
for dir in "${TARGET_DIRS[@]}"; do
|
||||
@@ -42,15 +43,6 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for required files
|
||||
REQUIRED_FILES=("index.js" "index.mjs" "index.d.ts" "index.js.map" "index.mjs.map")
|
||||
for file in "${REQUIRED_FILES[@]}"; do
|
||||
if [ ! -f "$dir/$file" ]; then
|
||||
echo "❌ Required file $dir/$file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if files were modified in the last 5 minutes
|
||||
find "$dir" -type f -mmin -5 | grep -q . || {
|
||||
echo "❌ Files in $dir were not recently modified"
|
||||
|
||||
14
.github/workflows/mobile-app-build.yml
vendored
14
.github/workflows/mobile-app-build.yml
vendored
@@ -53,8 +53,9 @@ jobs:
|
||||
run: |
|
||||
# Check if files exist and were recently modified
|
||||
TARGET_DIRS=(
|
||||
"utils/shared/identity-generator"
|
||||
"utils/shared/password-generator"
|
||||
"utils/dist/shared/identity-generator"
|
||||
"utils/dist/shared/password-generator"
|
||||
"utils/dist/shared/models"
|
||||
)
|
||||
|
||||
for dir in "${TARGET_DIRS[@]}"; do
|
||||
@@ -63,15 +64,6 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for required files
|
||||
REQUIRED_FILES=("index.js" "index.mjs" "index.d.ts" "index.js.map" "index.mjs.map")
|
||||
for file in "${REQUIRED_FILES[@]}"; do
|
||||
if [ ! -f "$dir/$file" ]; then
|
||||
echo "❌ Required file $dir/$file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if files were modified in the last 5 minutes
|
||||
find "$dir" -type f -mmin -5 | grep -q . || {
|
||||
echo "❌ Files in $dir were not recently modified"
|
||||
|
||||
@@ -66,9 +66,9 @@ jobs:
|
||||
run: |
|
||||
$scanner = "${{ github.workspace }}\.sonar\scanner\dotnet-sonarscanner"
|
||||
if ('${{ github.event_name }}' -eq 'pull_request_target') {
|
||||
& $scanner begin /k:"lanedirt_AliasVault" /o:"lanedirt" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.pullrequest.key=${{ github.event.pull_request.number }} /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.coverage.exclusions="**Tests*.cs" /d:sonar.exclusions="**/__tests__/test-forms/*.html,**/shared/identity-generator/*.js,**/shared/password-generator/*.js"
|
||||
& $scanner begin /k:"lanedirt_AliasVault" /o:"lanedirt" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.pullrequest.key=${{ github.event.pull_request.number }} /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.coverage.exclusions="**Tests*.cs" /d:sonar.exclusions="**/__tests__/test-forms/*.html,**/dist/shared/**"
|
||||
} else {
|
||||
& $scanner begin /k:"lanedirt_AliasVault" /o:"lanedirt" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.coverage.exclusions="**Tests*.cs" /d:sonar.exclusions="**/__tests__/test-forms/*.html,**/shared/identity-generator/*.js,**/shared/password-generator/*.js"
|
||||
& $scanner begin /k:"lanedirt_AliasVault" /o:"lanedirt" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.coverage.exclusions="**Tests*.cs" /d:sonar.exclusions="**/__tests__/test-forms/*.html,**/dist/shared/**"
|
||||
}
|
||||
dotnet build
|
||||
dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutput=coverage /p:CoverletOutputFormat=opencover --filter 'FullyQualifiedName!~AliasVault.E2ETests'
|
||||
|
||||
1
apps/browser-extension/.gitignore
vendored
1
apps/browser-extension/.gitignore
vendored
@@ -10,6 +10,7 @@ lerna-debug.log*
|
||||
node_modules
|
||||
.output
|
||||
dist
|
||||
!src/utils/dist
|
||||
stats.html
|
||||
stats-*.json
|
||||
.wxt
|
||||
|
||||
@@ -12,7 +12,7 @@ export default [
|
||||
ignores: [
|
||||
"dist/**",
|
||||
"node_modules/**",
|
||||
"src/utils/shared/**",
|
||||
"src/utils/dist/**",
|
||||
]
|
||||
},
|
||||
js.configs.recommended,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type Browser } from '@wxt-dev/browser';
|
||||
import { sendMessage } from 'webext-bridge/background';
|
||||
|
||||
import { PasswordGenerator } from '@/utils/shared/password-generator';
|
||||
import { PasswordGenerator } from '@/utils/dist/shared/password-generator';
|
||||
|
||||
import { browser } from "#imports";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { storage } from 'wxt/utils/storage';
|
||||
|
||||
import type { Vault, VaultResponse, VaultPostResponse } from '@/utils/dist/shared/models/webapi';
|
||||
import { EncryptionUtility } from '@/utils/EncryptionUtility';
|
||||
import type { Vault, VaultResponse, VaultPostResponse } from '@/utils/shared/models/webapi';
|
||||
import { SqliteClient } from '@/utils/SqliteClient';
|
||||
import { BoolResponse as messageBoolResponse } from '@/utils/types/messaging/BoolResponse';
|
||||
import { CredentialsResponse as messageCredentialsResponse } from '@/utils/types/messaging/CredentialsResponse';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import { CombinedStopWords } from '@/utils/formDetector/FieldPatterns';
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
|
||||
type CredentialWithPriority = Credential & {
|
||||
priority: number;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { openAutofillPopup } from '@/entrypoints/contentScript/Popup';
|
||||
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import { FormDetector } from '@/utils/formDetector/FormDetector';
|
||||
import { FormFiller } from '@/utils/formDetector/FormFiller';
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
|
||||
/**
|
||||
* Global timestamp to track popup debounce time.
|
||||
|
||||
@@ -4,10 +4,10 @@ import { filterCredentials } from '@/entrypoints/contentScript/Filter';
|
||||
import { fillCredential } from '@/entrypoints/contentScript/Form';
|
||||
|
||||
import { DISABLED_SITES_KEY, TEMPORARY_DISABLED_SITES_KEY, GLOBAL_AUTOFILL_POPUP_ENABLED_KEY, VAULT_LOCKED_DISMISS_UNTIL_KEY, LAST_CUSTOM_EMAIL_KEY, LAST_CUSTOM_USERNAME_KEY } from '@/utils/Constants';
|
||||
import { CreateIdentityGenerator } from '@/utils/dist/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import { CreatePasswordGenerator, PasswordGenerator } from '@/utils/dist/shared/password-generator';
|
||||
import { FormDetector } from '@/utils/formDetector/FormDetector';
|
||||
import { CreateIdentityGenerator } from '@/utils/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import { CreatePasswordGenerator, PasswordGenerator } from '@/utils/shared/password-generator';
|
||||
import { SqliteClient } from '@/utils/SqliteClient';
|
||||
import { CredentialsResponse } from '@/utils/types/messaging/CredentialsResponse';
|
||||
import { PasswordSettingsResponse } from '@/utils/types/messaging/PasswordSettingsResponse';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import SqliteClient from '@/utils/SqliteClient';
|
||||
|
||||
type CredentialCardProps = {
|
||||
|
||||
@@ -2,8 +2,8 @@ import React from 'react';
|
||||
|
||||
import { FormInputCopyToClipboard } from '@/entrypoints/popup/components/FormInputCopyToClipboard';
|
||||
|
||||
import { IdentityHelperUtils } from '@/utils/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import { IdentityHelperUtils } from '@/utils/dist/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
type AliasBlockProps = {
|
||||
credential: Credential;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import SqliteClient from '@/utils/SqliteClient';
|
||||
|
||||
type HeaderBlockProps = {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
|
||||
import { FormInputCopyToClipboard } from '@/entrypoints/popup/components/FormInputCopyToClipboard';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
type LoginCredentialsBlockProps = {
|
||||
credential: Credential;
|
||||
|
||||
@@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react';
|
||||
|
||||
import { useDb } from '@/entrypoints/popup/context/DbContext';
|
||||
|
||||
import type { TotpCode } from '@/utils/shared/models/vault';
|
||||
import type { TotpCode } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
type TotpBlockProps = {
|
||||
credentialId: string;
|
||||
|
||||
@@ -5,8 +5,8 @@ import { useDb } from '@/entrypoints/popup/context/DbContext';
|
||||
import { useWebApi } from '@/entrypoints/popup/context/WebApiContext';
|
||||
|
||||
import { AppInfo } from '@/utils/AppInfo';
|
||||
import type { MailboxEmail } from '@/utils/dist/shared/models/webapi';
|
||||
import { EncryptionUtility } from '@/utils/EncryptionUtility';
|
||||
import type { MailboxEmail } from '@/utils/shared/models/webapi';
|
||||
|
||||
import { storage } from '#imports';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React, { createContext, useContext, useState, useEffect, useCallback, useMemo } from 'react';
|
||||
import { sendMessage } from 'webext-bridge/popup';
|
||||
|
||||
import type { VaultMetadata } from '@/utils/dist/shared/models/metadata';
|
||||
import type { VaultResponse } from '@/utils/dist/shared/models/webapi';
|
||||
import EncryptionUtility from '@/utils/EncryptionUtility';
|
||||
import type { VaultMetadata } from '@/utils/shared/models/metadata';
|
||||
import type { VaultResponse } from '@/utils/shared/models/webapi';
|
||||
import SqliteClient from '@/utils/SqliteClient';
|
||||
import { StoreVaultRequest } from '@/utils/types/messaging/StoreVaultRequest';
|
||||
import type { VaultResponse as messageVaultResponse } from '@/utils/types/messaging/VaultResponse';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useAuth } from '@/entrypoints/popup/context/AuthContext';
|
||||
import { useDb } from '@/entrypoints/popup/context/DbContext';
|
||||
import { useWebApi } from '@/entrypoints/popup/context/WebApiContext';
|
||||
|
||||
import type { VaultResponse } from '@/utils/shared/models/webapi';
|
||||
import type { VaultResponse } from '@/utils/dist/shared/models/webapi';
|
||||
|
||||
/**
|
||||
* Utility function to ensure a minimum time has elapsed for an operation
|
||||
|
||||
@@ -14,9 +14,9 @@ import { useHeaderButtons } from '@/entrypoints/popup/context/HeaderButtonsConte
|
||||
import { useWebApi } from '@/entrypoints/popup/context/WebApiContext';
|
||||
import { useVaultMutate } from '@/entrypoints/popup/hooks/useVaultMutate';
|
||||
|
||||
import { IdentityHelperUtils, CreateIdentityGenerator, CreateUsernameEmailGenerator, Identity, Gender } from '@/utils/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import { CreatePasswordGenerator } from '@/utils/shared/password-generator';
|
||||
import { IdentityHelperUtils, CreateIdentityGenerator, CreateUsernameEmailGenerator, Identity, Gender } from '@/utils/dist/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import { CreatePasswordGenerator } from '@/utils/dist/shared/password-generator';
|
||||
|
||||
import LoadingSpinner from '../components/LoadingSpinner';
|
||||
import { useLoading } from '../context/LoadingContext';
|
||||
|
||||
@@ -15,7 +15,7 @@ import { useDb } from '@/entrypoints/popup/context/DbContext';
|
||||
import { useHeaderButtons } from '@/entrypoints/popup/context/HeaderButtonsContext';
|
||||
import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
/**
|
||||
* Credential details page.
|
||||
|
||||
@@ -12,7 +12,7 @@ import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
|
||||
import { useWebApi } from '@/entrypoints/popup/context/WebApiContext';
|
||||
import { useVaultSync } from '@/entrypoints/popup/hooks/useVaultSync';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
|
||||
import { useWebApi } from '@/entrypoints/popup/context/WebApiContext';
|
||||
import ConversionUtility from '@/entrypoints/popup/utils/ConversionUtility';
|
||||
|
||||
import type { EmailAttachment, Email } from '@/utils/dist/shared/models/webapi';
|
||||
import EncryptionUtility from '@/utils/EncryptionUtility';
|
||||
import type { EmailAttachment, Email } from '@/utils/shared/models/webapi';
|
||||
|
||||
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import ReloadButton from '@/entrypoints/popup/components/ReloadButton';
|
||||
import { useDb } from '@/entrypoints/popup/context/DbContext';
|
||||
import { useWebApi } from '@/entrypoints/popup/context/WebApiContext';
|
||||
|
||||
import type { MailboxBulkRequest, MailboxBulkResponse, MailboxEmail } from '@/utils/dist/shared/models/webapi';
|
||||
import EncryptionUtility from '@/utils/EncryptionUtility';
|
||||
import type { MailboxBulkRequest, MailboxBulkResponse, MailboxEmail } from '@/utils/shared/models/webapi';
|
||||
|
||||
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import { useWebApi } from '@/entrypoints/popup/context/WebApiContext';
|
||||
import SrpUtility from '@/entrypoints/popup/utils/SrpUtility';
|
||||
|
||||
import { AppInfo } from '@/utils/AppInfo';
|
||||
import type { VaultResponse, LoginResponse } from '@/utils/dist/shared/models/webapi';
|
||||
import EncryptionUtility from '@/utils/EncryptionUtility';
|
||||
import type { VaultResponse, LoginResponse } from '@/utils/shared/models/webapi';
|
||||
import { ApiAuthError } from '@/utils/types/errors/ApiAuthError';
|
||||
|
||||
import ConversionUtility from '../utils/ConversionUtility';
|
||||
|
||||
@@ -11,8 +11,8 @@ import { useWebApi } from '@/entrypoints/popup/context/WebApiContext';
|
||||
import SrpUtility from '@/entrypoints/popup/utils/SrpUtility';
|
||||
|
||||
import { VAULT_LOCKED_DISMISS_UNTIL_KEY } from '@/utils/Constants';
|
||||
import type { VaultResponse } from '@/utils/dist/shared/models/webapi';
|
||||
import EncryptionUtility from '@/utils/EncryptionUtility';
|
||||
import type { VaultResponse } from '@/utils/shared/models/webapi';
|
||||
|
||||
import { storage } from '#imports';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import srp from 'secure-remote-password/client'
|
||||
|
||||
import type { LoginRequest, LoginResponse, ValidateLoginRequest, ValidateLoginRequest2Fa, ValidateLoginResponse, BadRequestResponse } from '@/utils/shared/models/webapi';
|
||||
import type { LoginRequest, LoginResponse, ValidateLoginRequest, ValidateLoginRequest2Fa, ValidateLoginResponse, BadRequestResponse } from '@/utils/dist/shared/models/webapi';
|
||||
import { ApiAuthError } from '@/utils/types/errors/ApiAuthError';
|
||||
import { WebApiService } from '@/utils/WebApiService';
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { Buffer } from 'buffer';
|
||||
|
||||
import argon2 from 'argon2-browser/dist/argon2-bundled.min.js';
|
||||
|
||||
import type { EncryptionKey } from '@/utils/shared/models/vault';
|
||||
import type { Email, MailboxEmail } from '@/utils/shared/models/webapi';
|
||||
import type { EncryptionKey } from '@/utils/dist/shared/models/vault';
|
||||
import type { Email, MailboxEmail } from '@/utils/dist/shared/models/webapi';
|
||||
|
||||
/**
|
||||
* Utility class for encryption operations including:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import initSqlJs, { Database } from 'sql.js';
|
||||
|
||||
import type { Credential, EncryptionKey, PasswordSettings, TotpCode } from '@/utils/shared/models/vault';
|
||||
import type { Credential, EncryptionKey, PasswordSettings, TotpCode } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
/**
|
||||
* Placeholder base64 image for credentials without a logo.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { StatusResponse, VaultResponse } from '@/utils/shared/models/webapi';
|
||||
import type { StatusResponse, VaultResponse } from '@/utils/dist/shared/models/webapi';
|
||||
|
||||
import { AppInfo } from "./AppInfo";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Gender, IdentityHelperUtils } from "@/utils/dist/shared/identity-generator";
|
||||
import type { Credential } from "@/utils/dist/shared/models/vault";
|
||||
import { CombinedDateOptionPatterns, CombinedGenderOptionPatterns } from "@/utils/formDetector/FieldPatterns";
|
||||
import { FormFields } from "@/utils/formDetector/types/FormFields";
|
||||
import { Gender, IdentityHelperUtils } from "@/utils/shared/identity-generator";
|
||||
import type { Credential } from "@/utils/shared/models/vault";
|
||||
/**
|
||||
* Class to fill the fields of a form with the given credential.
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { JSDOM } from 'jsdom';
|
||||
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
import { FormFiller } from '../FormFiller';
|
||||
import { FormFields } from '../types/FormFields';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { JSDOM } from 'jsdom';
|
||||
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
import { FormFiller } from '../FormFiller';
|
||||
import { FormFields } from '../types/FormFields';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { JSDOM } from 'jsdom';
|
||||
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
import { FormFiller } from '../FormFiller';
|
||||
import { FormFields } from '../types/FormFields';
|
||||
|
||||
@@ -4,10 +4,10 @@ import { join } from 'path';
|
||||
import { JSDOM, DOMWindow } from 'jsdom';
|
||||
import { it, expect, vi } from 'vitest';
|
||||
|
||||
import { Gender } from '@/utils/dist/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import { FormDetector } from '@/utils/formDetector/FormDetector';
|
||||
import { FormFields } from '@/utils/formDetector/types/FormFields';
|
||||
import { Gender } from '@/utils/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
|
||||
export enum FormField {
|
||||
Username = 'username',
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
export { }
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Credential } from "@/utils/shared/models/vault";
|
||||
import type { Credential } from "@/utils/dist/shared/models/vault";
|
||||
|
||||
export type CredentialsResponse = {
|
||||
success: boolean,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PasswordSettings } from "@/utils/shared/models/vault";
|
||||
import type { PasswordSettings } from "@/utils/dist/shared/models/vault";
|
||||
|
||||
export type PasswordSettingsResponse = {
|
||||
success: boolean,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
ignorePatterns: ["dist/**", "node_modules/**", "utils/shared/**", "expo-env.d.ts", "*.js"],
|
||||
ignorePatterns: ["dist/**", "node_modules/**", "utils/dist/shared/**", "expo-env.d.ts", "*.js"],
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
ecmaFeatures: { jsx: true },
|
||||
|
||||
1
apps/mobile-app/.gitignore
vendored
1
apps/mobile-app/.gitignore
vendored
@@ -6,6 +6,7 @@ node_modules/
|
||||
# Expo
|
||||
.expo/
|
||||
dist/
|
||||
!utils/dist
|
||||
web-build/
|
||||
expo-env.d.ts
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useCallback, useEffect, useState } from 'react';
|
||||
import { ActivityIndicator, View, Text, StyleSheet, TouchableOpacity, Linking, Pressable } from 'react-native';
|
||||
import Toast from 'react-native-toast-message';
|
||||
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import emitter from '@/utils/EventEmitter';
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ import { StyleSheet, View, TouchableOpacity, Alert, Keyboard, KeyboardAvoidingVi
|
||||
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
||||
import Toast from 'react-native-toast-message';
|
||||
|
||||
import { CreateIdentityGenerator, IdentityHelperUtils, IdentityGenerator } from '@/utils/dist/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import type { FaviconExtractModel } from '@/utils/dist/shared/models/webapi';
|
||||
import { CreatePasswordGenerator, PasswordGenerator } from '@/utils/dist/shared/password-generator';
|
||||
import emitter from '@/utils/EventEmitter';
|
||||
import { CreateIdentityGenerator, IdentityHelperUtils, IdentityGenerator } from '@/utils/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { FaviconExtractModel } from '@/utils/shared/models/webapi';
|
||||
import { CreatePasswordGenerator, PasswordGenerator } from '@/utils/shared/password-generator';
|
||||
import { extractServiceNameFromUrl } from '@/utils/UrlUtility';
|
||||
import { credentialSchema } from '@/utils/ValidationSchema';
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ import { StyleSheet, Text, FlatList, TouchableOpacity, TextInput, RefreshControl
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import Toast from 'react-native-toast-message';
|
||||
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import emitter from '@/utils/EventEmitter';
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
|
||||
|
||||
@@ -5,9 +5,9 @@ import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { StyleSheet, View, TouchableOpacity, ActivityIndicator, Alert, Share, useColorScheme, TextInput, Linking } from 'react-native';
|
||||
import { WebView } from 'react-native-webview';
|
||||
|
||||
import type { Email } from '@/utils/dist/shared/models/webapi';
|
||||
import EncryptionUtility from '@/utils/EncryptionUtility';
|
||||
import emitter from '@/utils/EventEmitter';
|
||||
import type { Email } from '@/utils/shared/models/webapi';
|
||||
import type { Credential } from '@/utils/types/Credential';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
|
||||
@@ -5,9 +5,9 @@ import { StyleSheet, View, ScrollView, RefreshControl, Animated , Platform } fro
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import Toast from 'react-native-toast-message';
|
||||
|
||||
import type { MailboxBulkRequest, MailboxBulkResponse, MailboxEmail } from '@/utils/dist/shared/models/webapi';
|
||||
import EncryptionUtility from '@/utils/EncryptionUtility';
|
||||
import emitter from '@/utils/EventEmitter';
|
||||
import type { MailboxBulkRequest, MailboxBulkResponse, MailboxEmail } from '@/utils/shared/models/webapi';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useState, useEffect, useCallback } from 'react';
|
||||
import { StyleSheet, View, TouchableOpacity, Alert, RefreshControl, Platform } from 'react-native';
|
||||
import Toast from 'react-native-toast-message';
|
||||
|
||||
import type { RefreshToken } from '@/utils/shared/models/webapi';
|
||||
import type { RefreshToken } from '@/utils/dist/shared/models/webapi';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
|
||||
|
||||
@@ -3,8 +3,8 @@ import { useState, useEffect, useCallback } from 'react';
|
||||
import { StyleSheet, View, RefreshControl, Platform } from 'react-native';
|
||||
import Toast from 'react-native-toast-message';
|
||||
|
||||
import type { AuthLogModel } from '@/utils/shared/models/webapi';
|
||||
import { AuthEventType } from '@/utils/shared/models/webapi';
|
||||
import type { AuthLogModel } from '@/utils/dist/shared/models/webapi';
|
||||
import { AuthEventType } from '@/utils/dist/shared/models/webapi';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useState } from 'react';
|
||||
import { StyleSheet, View, Alert, KeyboardAvoidingView, Platform } from 'react-native';
|
||||
import srp from 'secure-remote-password/client';
|
||||
|
||||
import type { DeleteAccountInitiateRequest, DeleteAccountInitiateResponse, DeleteAccountRequest } from '@/utils/shared/models/webapi';
|
||||
import type { DeleteAccountInitiateRequest, DeleteAccountInitiateResponse, DeleteAccountRequest } from '@/utils/dist/shared/models/webapi';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import { StyleSheet, View, Text, SafeAreaView, TextInput, TouchableOpacity, Acti
|
||||
|
||||
import { AppInfo } from '@/utils/AppInfo';
|
||||
import ConversionUtility from '@/utils/ConversionUtility';
|
||||
import type { EncryptionKeyDerivationParams } from '@/utils/dist/shared/models/metadata';
|
||||
import type { LoginResponse, VaultResponse } from '@/utils/dist/shared/models/webapi';
|
||||
import EncryptionUtility from '@/utils/EncryptionUtility';
|
||||
import type { EncryptionKeyDerivationParams } from '@/utils/shared/models/metadata';
|
||||
import type { LoginResponse, VaultResponse } from '@/utils/shared/models/webapi';
|
||||
import { SrpUtility } from '@/utils/SrpUtility';
|
||||
import { ApiAuthError } from '@/utils/types/errors/ApiAuthError';
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { router } from 'expo-router';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { StyleSheet, View, TouchableOpacity } from 'react-native';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { MailboxEmail } from '@/utils/shared/models/webapi';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
import type { MailboxEmail } from '@/utils/dist/shared/models/webapi';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { StyleSheet, View, Text, TouchableOpacity, Keyboard, Platform, Alert } f
|
||||
import ContextMenu, { OnPressMenuItemEvent } from 'react-native-context-menu-view';
|
||||
import Toast from 'react-native-toast-message';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { IdentityHelperUtils } from '@/utils/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import { IdentityHelperUtils } from '@/utils/dist/shared/identity-generator';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
import FormInputCopyToClipboard from '@/components/form/FormInputCopyToClipboard';
|
||||
import { ThemedText } from '@/components/themed/ThemedText';
|
||||
|
||||
@@ -4,8 +4,8 @@ import React, { useState, useEffect, useCallback } from 'react';
|
||||
import { View, StyleSheet, TouchableOpacity, Linking, AppState } from 'react-native';
|
||||
|
||||
import { AppInfo } from '@/utils/AppInfo';
|
||||
import type { MailboxBulkRequest, MailboxBulkResponse, MailboxEmail } from '@/utils/dist/shared/models/webapi';
|
||||
import EncryptionUtility from '@/utils/EncryptionUtility';
|
||||
import type { MailboxBulkRequest, MailboxBulkResponse, MailboxEmail } from '@/utils/shared/models/webapi';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
import FormInputCopyToClipboard from '@/components/form/FormInputCopyToClipboard';
|
||||
import { ThemedText } from '@/components/themed/ThemedText';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { View, Text, StyleSheet, Linking, Pressable } from 'react-native';
|
||||
|
||||
import type { Credential } from '@/utils/shared/models/vault';
|
||||
import type { Credential } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import { View, StyleSheet, TouchableOpacity, Platform } from 'react-native';
|
||||
import Toast from 'react-native-toast-message';
|
||||
|
||||
import type { Credential, TotpCode } from '@/utils/shared/models/vault';
|
||||
import type { Credential, TotpCode } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
import { useColors } from '@/hooks/useColorScheme';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { createContext, useContext, useState, useEffect, useCallback, useMemo } from 'react';
|
||||
|
||||
import type { EncryptionKeyDerivationParams, VaultMetadata } from '@/utils/shared/models/metadata';
|
||||
import type { VaultResponse } from '@/utils/shared/models/webapi';
|
||||
import type { EncryptionKeyDerivationParams, VaultMetadata } from '@/utils/dist/shared/models/metadata';
|
||||
import type { VaultResponse } from '@/utils/dist/shared/models/webapi';
|
||||
import SqliteClient from '@/utils/SqliteClient';
|
||||
|
||||
import NativeVaultManager from '@/specs/NativeVaultManager';
|
||||
|
||||
@@ -2,9 +2,9 @@ import { useCallback, useState } from 'react';
|
||||
import Toast from 'react-native-toast-message';
|
||||
import srp from 'secure-remote-password/client';
|
||||
|
||||
import type { EncryptionKeyDerivationParams } from '@/utils/dist/shared/models/metadata';
|
||||
import type { PasswordChangeInitiateResponse, Vault, VaultPasswordChangeRequest } from '@/utils/dist/shared/models/webapi';
|
||||
import EncryptionUtility from '@/utils/EncryptionUtility';
|
||||
import type { EncryptionKeyDerivationParams } from '@/utils/shared/models/metadata';
|
||||
import type { PasswordChangeInitiateResponse, Vault, VaultPasswordChangeRequest } from '@/utils/shared/models/webapi';
|
||||
|
||||
import { useVaultSync } from '@/hooks/useVaultSync';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { AppInfo } from '@/utils/AppInfo';
|
||||
import type { VaultResponse } from '@/utils/shared/models/webapi';
|
||||
import type { VaultResponse } from '@/utils/dist/shared/models/webapi';
|
||||
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useDb } from '@/context/DbContext';
|
||||
|
||||
@@ -3,8 +3,8 @@ import { Buffer } from 'buffer';
|
||||
import AesGcmCrypto from 'react-native-aes-gcm-crypto';
|
||||
import argon2 from 'react-native-argon2';
|
||||
|
||||
import type { EncryptionKey } from '@/utils/shared/models/vault';
|
||||
import type { Email, MailboxEmail } from '@/utils/shared/models/webapi';
|
||||
import type { EncryptionKey } from '@/utils/dist/shared/models/vault';
|
||||
import type { Email, MailboxEmail } from '@/utils/dist/shared/models/webapi';
|
||||
|
||||
/**
|
||||
* Utility class for encryption operations including:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { EncryptionKeyDerivationParams, VaultMetadata } from '@/utils/shared/models/metadata';
|
||||
import type { Credential, EncryptionKey, PasswordSettings, TotpCode } from '@/utils/shared/models/vault';
|
||||
import type { EncryptionKeyDerivationParams, VaultMetadata } from '@/utils/dist/shared/models/metadata';
|
||||
import type { Credential, EncryptionKey, PasswordSettings, TotpCode } from '@/utils/dist/shared/models/vault';
|
||||
|
||||
import NativeVaultManager from '@/specs/NativeVaultManager';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import srp from 'secure-remote-password/client';
|
||||
|
||||
import type { BadRequestResponse, LoginResponse, ValidateLoginRequest2Fa, ValidateLoginResponse } from '@/utils/shared/models/webapi';
|
||||
import type { BadRequestResponse, LoginResponse, ValidateLoginRequest2Fa, ValidateLoginResponse } from '@/utils/dist/shared/models/webapi';
|
||||
import { ApiAuthError } from '@/utils/types/errors/ApiAuthError';
|
||||
import { WebApiService } from '@/utils/WebApiService';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
|
||||
import { AppInfo } from '@/utils/AppInfo';
|
||||
import type { StatusResponse, VaultResponse, AuthLogModel, RefreshToken } from '@/utils/shared/models/webapi';
|
||||
import type { StatusResponse, VaultResponse, AuthLogModel, RefreshToken } from '@/utils/dist/shared/models/webapi';
|
||||
|
||||
type RequestInit = globalThis.RequestInit;
|
||||
|
||||
|
||||
@@ -24,14 +24,14 @@ interface IIdentityGenerator {
|
||||
* Base identity generator.
|
||||
*/
|
||||
declare abstract class IdentityGenerator implements IIdentityGenerator {
|
||||
protected firstNamesMale: string[];
|
||||
protected firstNamesFemale: string[];
|
||||
protected lastNames: string[];
|
||||
private readonly random;
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
constructor();
|
||||
protected firstNamesMale: string[];
|
||||
protected firstNamesFemale: string[];
|
||||
protected lastNames: string[];
|
||||
private readonly random;
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
constructor();
|
||||
protected abstract getFirstNamesMaleJson(): string[];
|
||||
protected abstract getFirstNamesFemaleJson(): string[];
|
||||
protected abstract getLastNamesJson(): string[];
|
||||
@@ -49,87 +49,87 @@ declare abstract class IdentityGenerator implements IIdentityGenerator {
|
||||
* Identity generator for English language using English word dictionaries.
|
||||
*/
|
||||
declare class IdentityGeneratorEn extends IdentityGenerator {
|
||||
/**
|
||||
* Get the male first names.
|
||||
*/
|
||||
protected getFirstNamesMaleJson(): string[];
|
||||
/**
|
||||
* Get the female first names.
|
||||
*/
|
||||
protected getFirstNamesFemaleJson(): string[];
|
||||
/**
|
||||
* Get the last names.
|
||||
*/
|
||||
protected getLastNamesJson(): string[];
|
||||
/**
|
||||
* Get the male first names.
|
||||
*/
|
||||
protected getFirstNamesMaleJson(): string[];
|
||||
/**
|
||||
* Get the female first names.
|
||||
*/
|
||||
protected getFirstNamesFemaleJson(): string[];
|
||||
/**
|
||||
* Get the last names.
|
||||
*/
|
||||
protected getLastNamesJson(): string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Identity generator for Dutch language using Dutch word dictionaries.
|
||||
*/
|
||||
declare class IdentityGeneratorNl extends IdentityGenerator {
|
||||
/**
|
||||
* Get the male first names.
|
||||
*/
|
||||
protected getFirstNamesMaleJson(): string[];
|
||||
/**
|
||||
* Get the female first names.
|
||||
*/
|
||||
protected getFirstNamesFemaleJson(): string[];
|
||||
/**
|
||||
* Get the last names.
|
||||
*/
|
||||
protected getLastNamesJson(): string[];
|
||||
/**
|
||||
* Get the male first names.
|
||||
*/
|
||||
protected getFirstNamesMaleJson(): string[];
|
||||
/**
|
||||
* Get the female first names.
|
||||
*/
|
||||
protected getFirstNamesFemaleJson(): string[];
|
||||
/**
|
||||
* Get the last names.
|
||||
*/
|
||||
protected getLastNamesJson(): string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper utilities for identity generation that can be used by multiple client applications.
|
||||
*/
|
||||
declare class IdentityHelperUtils {
|
||||
/**
|
||||
* Normalize a birth date for display.
|
||||
*/
|
||||
static normalizeBirthDateForDisplay(birthDate: string | undefined): string;
|
||||
/**
|
||||
* Normalize a birth date for database.
|
||||
*/
|
||||
static normalizeBirthDateForDb(input: string | undefined): string;
|
||||
/**
|
||||
* Check if a birth date is valid.
|
||||
*/
|
||||
static isValidBirthDate(input: string | undefined): boolean;
|
||||
/**
|
||||
* Normalize a birth date for display.
|
||||
*/
|
||||
static normalizeBirthDateForDisplay(birthDate: string | undefined): string;
|
||||
/**
|
||||
* Normalize a birth date for database.
|
||||
*/
|
||||
static normalizeBirthDateForDb(input: string | undefined): string;
|
||||
/**
|
||||
* Check if a birth date is valid.
|
||||
*/
|
||||
static isValidBirthDate(input: string | undefined): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a username or email prefix.
|
||||
*/
|
||||
declare class UsernameEmailGenerator {
|
||||
private static readonly MIN_LENGTH;
|
||||
private static readonly MAX_LENGTH;
|
||||
private readonly symbols;
|
||||
/**
|
||||
* Generate a username based on an identity.
|
||||
*/
|
||||
generateUsername(identity: Identity): string;
|
||||
/**
|
||||
* Generate an email prefix based on an identity.
|
||||
*/
|
||||
generateEmailPrefix(identity: Identity): string;
|
||||
/**
|
||||
* Sanitize an email prefix.
|
||||
*/
|
||||
private sanitizeEmailPrefix;
|
||||
/**
|
||||
* Get a random symbol.
|
||||
*/
|
||||
private getRandomSymbol;
|
||||
/**
|
||||
* Generate a random string.
|
||||
*/
|
||||
private generateRandomString;
|
||||
/**
|
||||
* Generate a secure random integer between 0 (inclusive) and max (exclusive)
|
||||
*/
|
||||
private getSecureRandom;
|
||||
private static readonly MIN_LENGTH;
|
||||
private static readonly MAX_LENGTH;
|
||||
private readonly symbols;
|
||||
/**
|
||||
* Generate a username based on an identity.
|
||||
*/
|
||||
generateUsername(identity: Identity): string;
|
||||
/**
|
||||
* Generate an email prefix based on an identity.
|
||||
*/
|
||||
generateEmailPrefix(identity: Identity): string;
|
||||
/**
|
||||
* Sanitize an email prefix.
|
||||
*/
|
||||
private sanitizeEmailPrefix;
|
||||
/**
|
||||
* Get a random symbol.
|
||||
*/
|
||||
private getRandomSymbol;
|
||||
/**
|
||||
* Generate a random string.
|
||||
*/
|
||||
private generateRandomString;
|
||||
/**
|
||||
* Generate a secure random integer between 0 (inclusive) and max (exclusive)
|
||||
*/
|
||||
private getSecureRandom;
|
||||
}
|
||||
|
||||
/**
|
||||
120
apps/mobile-app/utils/dist/shared/password-generator/index.d.ts
vendored
Normal file
120
apps/mobile-app/utils/dist/shared/password-generator/index.d.ts
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* Settings for password generation stored in SQLite database settings table as string.
|
||||
*/
|
||||
type PasswordSettings = {
|
||||
/**
|
||||
* The length of the password.
|
||||
*/
|
||||
Length: number;
|
||||
/**
|
||||
* Whether to use lowercase letters.
|
||||
*/
|
||||
UseLowercase: boolean;
|
||||
/**
|
||||
* Whether to use uppercase letters.
|
||||
*/
|
||||
UseUppercase: boolean;
|
||||
/**
|
||||
* Whether to use numbers.
|
||||
*/
|
||||
UseNumbers: boolean;
|
||||
/**
|
||||
* Whether to use special characters.
|
||||
*/
|
||||
UseSpecialChars: boolean;
|
||||
/**
|
||||
* Whether to use non-ambiguous characters.
|
||||
*/
|
||||
UseNonAmbiguousChars: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generate a random password.
|
||||
*/
|
||||
declare class PasswordGenerator {
|
||||
private readonly lowercaseChars;
|
||||
private readonly uppercaseChars;
|
||||
private readonly numberChars;
|
||||
private readonly specialChars;
|
||||
private readonly ambiguousChars;
|
||||
private length;
|
||||
private useLowercase;
|
||||
private useUppercase;
|
||||
private useNumbers;
|
||||
private useSpecial;
|
||||
private useNonAmbiguous;
|
||||
/**
|
||||
* Create a new instance of PasswordGenerator.
|
||||
* @param settings Optional password settings to initialize with.
|
||||
*/
|
||||
constructor(settings?: PasswordSettings);
|
||||
/**
|
||||
* Apply password settings to this generator.
|
||||
*/
|
||||
applySettings(settings: PasswordSettings): this;
|
||||
/**
|
||||
* Set the length of the password.
|
||||
*/
|
||||
setLength(length: number): this;
|
||||
/**
|
||||
* Set if lowercase letters should be used.
|
||||
*/
|
||||
useLowercaseLetters(use: boolean): this;
|
||||
/**
|
||||
* Set if uppercase letters should be used.
|
||||
*/
|
||||
useUppercaseLetters(use: boolean): this;
|
||||
/**
|
||||
* Set if numeric characters should be used.
|
||||
*/
|
||||
useNumericCharacters(use: boolean): this;
|
||||
/**
|
||||
* Set if special characters should be used.
|
||||
*/
|
||||
useSpecialCharacters(use: boolean): this;
|
||||
/**
|
||||
* Set if only non-ambiguous characters should be used.
|
||||
*/
|
||||
useNonAmbiguousCharacters(use: boolean): this;
|
||||
/**
|
||||
* Get a random index from the crypto module.
|
||||
*/
|
||||
private getUnbiasedRandomIndex;
|
||||
/**
|
||||
* Generate a random password.
|
||||
*/
|
||||
generateRandomPassword(): string;
|
||||
/**
|
||||
* Build character set based on selected options.
|
||||
*/
|
||||
private buildCharacterSet;
|
||||
/**
|
||||
* Remove ambiguous characters from a character set.
|
||||
*/
|
||||
private removeAmbiguousCharacters;
|
||||
/**
|
||||
* Generate initial random password.
|
||||
*/
|
||||
private generateInitialPassword;
|
||||
/**
|
||||
* Ensure the generated password meets all specified requirements.
|
||||
*/
|
||||
private ensureRequirements;
|
||||
/**
|
||||
* Get a character set with ambiguous characters removed if needed.
|
||||
*/
|
||||
private getSafeCharacterSet;
|
||||
/**
|
||||
* Add a character from the given set at a random position in the password.
|
||||
*/
|
||||
private addCharacterFromSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new password generator.
|
||||
* @param settings - The settings for the password generator.
|
||||
* @returns A new password generator instance.
|
||||
*/
|
||||
declare const CreatePasswordGenerator: (settings: PasswordSettings) => PasswordGenerator;
|
||||
|
||||
export { CreatePasswordGenerator, PasswordGenerator, type PasswordSettings };
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -26,8 +26,8 @@ public sealed class JsInteropService(IJSRuntime jsRuntime)
|
||||
/// <returns>A task representing the asynchronous operation.</returns>
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
_identityGeneratorModule = await jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/shared/identity-generator/index.mjs");
|
||||
_passwordGeneratorModule = await jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/shared/password-generator/index.mjs");
|
||||
_identityGeneratorModule = await jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/dist/shared/identity-generator/index.mjs");
|
||||
_passwordGeneratorModule = await jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/dist/shared/password-generator/index.mjs");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -945,6 +945,14 @@ video {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.h-32 {
|
||||
height: 8rem;
|
||||
}
|
||||
|
||||
.h-screen {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.max-h-\[90vh\] {
|
||||
max-height: 90vh;
|
||||
}
|
||||
@@ -1041,6 +1049,10 @@ video {
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.w-32 {
|
||||
width: 8rem;
|
||||
}
|
||||
|
||||
.min-w-0 {
|
||||
min-width: 0px;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user