index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/eslint-config-proton/index.js | const path = require('path');
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
jest: true,
node: true,
},
extends: ['airbnb-typescript', 'prettier', 'plugin:monorepo-cop/recommended', 'plugin:jsx-a11y/recommended'],
parser: '@typescript-eslint/... | 7,300 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/eslint-config-proton/package.json | {
"name": "@proton/eslint-config-proton",
"description": "Modern eslint config for a more civilized age",
"keywords": [
"eslint",
"eslintconfig",
"config",
"airbnb",
"javascript",
"styleguide",
"es2015",
"es2016",
"es2017",
"es2... | 7,301 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/eslint-config-proton/tsconfig.json | {
"extends": "../../tsconfig.base.json"
}
| 7,302 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/eslint-plugin-custom-rules/deprecate-classes.js | /* eslint-env es6 */
// suggestedClassName is optional
const deprecatedClassNames = [
{
deprecatedClassName: 'mauto',
suggestedClassName: 'm-auto',
},
{
deprecatedClassName: 'center',
suggestedClassName: 'mx-auto',
},
{
deprecatedClassName: 'mxauto',
... | 7,303 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/eslint-plugin-custom-rules/deprecate-responsive-utility-classes.js | /* eslint-env es6 */
const deprecatedClasses = [
{
pattern: /\b(on|no|auto)-(tiny-mobile|mobile|tablet|desktop)(-)?\b/,
getMessage: (match) =>
`"${match}" is deprecated. Please migrate to the new responsive utilities https://design-system.protontech.ch/?path=/docs/css-utilities-responsiv... | 7,304 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/eslint-plugin-custom-rules/deprecate-sizing-classes.js | /* eslint-env es6 */
const deprecatedClasses = [
{
pattern: /\b((min|max)-)?w\d+(p|e|r|ch)?\b/,
getMessage: (match) =>
`"${match}" is deprecated. Please migrate to the new sizing utilities https://design-system.protontech.ch/?path=/docs/css-utilities-sizing--fractions`,
},
{
... | 7,305 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/eslint-plugin-custom-rules/deprecate-spacing-utility-classes.js | /* eslint-env es6 */
const deprecatedClasses = [
{
pattern: /\b(on-(tiny-mobile|mobile|tablet|desktop)-)?[m][btlrxy]?\d+(-\d+)?\b/,
getMessage: (match) =>
`"${match}" is deprecated. Please migrate to the new margin utilities https://design-system.protontech.ch/?path=/docs/css-utilities-m... | 7,306 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/eslint-plugin-custom-rules/index.js | module.exports = {
rules: {
'deprecate-spacing-utility-classes': require('./deprecate-spacing-utility-classes'),
'deprecate-responsive-utility-classes': require('./deprecate-responsive-utility-classes'),
'deprecate-sizing-classes': require('./deprecate-sizing-classes'),
'deprecate-cl... | 7,307 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/eslint-plugin-custom-rules/no-template-in-translator-context.js | /* eslint-env es6 */
const isValidTranslatorNode = (node) => {
return node.callee && node.callee.type === 'Identifier' && node.callee.name === 'c' && node.arguments.length === 1;
};
module.exports = {
meta: {
type: 'problem',
fixable: 'code',
docs: {
description: 'Forbid te... | 7,308 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/eslint-plugin-custom-rules/package.json | {
"name": "eslint-plugin-custom-rules",
"version": "1.0.0",
"main": "index.js"
}
| 7,309 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/.eslintrc.js | module.exports = {
extends: ['@proton/eslint-config-proton'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
ignorePatterns: ['.eslintrc.js'],
};
| 7,310 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/README.md | Generic business-agnostic utility react hooks.
1 module per hook. 1 test per hook.
| 7,311 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/index.ts | export { default as useCombinedRefs } from './useCombinedRefs';
export { default as useDateCountdown } from './useDateCountdown';
export { default as useInstance } from './useInstance';
export { default as useInterval } from './useInterval';
export { default as useLoading } from './useLoading';
export { default as useS... | 7,312 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/jest.config.js | module.exports = {
preset: 'ts-jest',
clearMocks: true,
testEnvironment: 'jsdom',
collectCoverageFrom: ['*.ts', '!index.ts'],
coverageReporters: ['text', 'lcov', 'cobertura'],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
... | 7,313 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/package.json | {
"name": "@proton/hooks",
"description": "Generic business use-case agnostic helper hooks",
"scripts": {
"check-types": "tsc",
"lint": "eslint . --ext ts --quiet --cache",
"test": "jest --coverage --runInBand --ci",
"test:dev": "jest --watch"
},
"dependencies": {
... | 7,314 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/tsconfig.json | {
"extends": "../../tsconfig.base.json"
}
| 7,315 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useCombinedRefs.test.ts | import { createElement, useEffect, useRef } from 'react';
import { render } from '@testing-library/react';
import useCombinedRefs from './useCombinedRefs';
describe('useCombinedRefs', () => {
it('should correctly combine refs into one ref', async () => {
const cbRef = jest.fn();
const refs: { a: ... | 7,316 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useCombinedRefs.ts | import { Ref, useCallback } from 'react';
const useCombinedRefs = <T extends any>(...refs: (Ref<T> | undefined)[]): Ref<T> =>
useCallback(
(element: T) =>
refs.forEach((ref) => {
if (!ref) {
return;
}
// Ref can have two types... | 7,317 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useControlled.test.ts | import { act, renderHook } from '@testing-library/react-hooks';
import useControlled from './useControlled';
describe('useControlled()', () => {
it('initializes with its passed value', () => {
const initial = 0;
const hook = renderHook(() => useControlled(initial));
const [state] = hook.... | 7,318 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useControlled.ts | import { useCallback, useState } from 'react';
export default function useControlled<V>(controlled: V, defaultValue?: V) {
const isControlled = controlled !== undefined;
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
const setValueIfUncontrolled = useCallback((v: V) => {
... | 7,319 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useDateCountdown.test.ts | import { act, renderHook } from '@testing-library/react-hooks';
import { DAY, HOUR, MINUTE, SECOND } from '@proton/shared/lib/constants';
import useDateCountdown from './useDateCountdown';
describe('useDateCountdown', () => {
beforeAll(() => {
jest.useFakeTimers();
});
afterEach(() => {
... | 7,320 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useDateCountdown.ts | import { useState } from 'react';
import { differenceInMilliseconds } from 'date-fns';
import { DAY, HOUR, MINUTE, SECOND } from '@proton/shared/lib/constants';
import useInterval from './useInterval';
const EVERY_SECOND = SECOND;
export interface DateCountdown {
/**
* Difference between the two dates in ... | 7,321 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useInstance.test.ts | import { act, renderHook } from '@testing-library/react-hooks';
import useInstance from './useInstance';
describe('useInstance()', () => {
it('initiates with the value returned from its callback argument', () => {
const hook = renderHook(() => useInstance(() => 'initial'));
expect(hook.result.cur... | 7,322 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useInstance.ts | import { useRef } from 'react';
/**
* Use ref with callback support.
*/
const useInstance = <T>(fn: () => T): T => {
const ref = useRef<T>();
if (!ref.current) {
ref.current = fn();
}
return ref.current;
};
export default useInstance;
| 7,323 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useInterval.test.ts | import { renderHook } from '@testing-library/react-hooks';
import useInterval from './useInterval';
describe('useInterval', () => {
let callback: jest.Mock<any, any>;
let setInterval: jest.SpyInstance<any, any>;
let clearInterval: jest.SpyInstance<any, any>;
beforeEach(() => {
callback = jest... | 7,324 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useInterval.ts | // https://usehooks-ts.com/react-hook/use-interval
// See also https://overreacted.io/making-setinterval-declarative-with-react-hooks/
import { useEffect, useRef } from 'react';
import noop from '@proton/utils/noop';
const useInterval = (callback: () => void, delay: number | null) => {
const savedCallback = useRe... | 7,325 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useIsMounted.test.ts | import { act, renderHook } from '@testing-library/react-hooks';
import useIsMounted from './useIsMounted';
describe('useIsMounted()', () => {
it('returns false initially', () => {
const hook = renderHook(() => useIsMounted());
const isMounted = hook.result.current();
/**
* TODO:... | 7,326 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useIsMounted.ts | import { useCallback, useEffect, useRef } from 'react';
const useIsMounted = () => {
const ref = useRef(false);
useEffect(() => {
ref.current = true;
return () => {
ref.current = false;
};
}, []);
return useCallback(() => {
return ref.current;
}, []);
}... | 7,327 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useLoading.test.ts | import { act, renderHook } from '@testing-library/react-hooks';
import useLoading, { useLoadingByKey } from '@proton/hooks/useLoading';
import { createPromise } from '@proton/shared/lib/helpers/promise';
describe('useLoading', () => {
it('should return loading false by default', () => {
const { result } =... | 7,328 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useLoading.ts | import { useCallback, useEffect, useRef, useState } from 'react';
import { SimpleMap } from '@proton/shared/lib/interfaces';
import isFunction from '@proton/utils/isFunction';
export type WithLoading = <T>(promise: undefined | Promise<T | void> | (() => Promise<T | void>)) => Promise<T | void>;
export type WithLoadin... | 7,329 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/usePrevious.test.ts | import { renderHook } from '@testing-library/react-hooks';
import usePrevious from './usePrevious';
describe('usePrevious()', () => {
it('remembers the value passed to it in the previous render cycle', () => {
const hook = renderHook(({ initial }) => usePrevious(initial), { initialProps: { initial: 0 } })... | 7,330 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/usePrevious.ts | import { useEffect, useRef } from 'react';
const usePrevious = <T>(value: T) => {
const ref = useRef<T>();
useEffect(() => {
ref.current = value;
});
return ref.current;
};
export default usePrevious;
| 7,331 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useSynchronizingState.test.ts | import { act, renderHook } from '@testing-library/react-hooks';
import useSynchronizingState from './useSynchronizingState';
describe('useSynchronizingState()', () => {
it('initiates with the value passed to it', () => {
const hook = renderHook(() => useSynchronizingState('initial'));
const [valu... | 7,332 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/hooks/useSynchronizingState.ts | import { useEffect, useState } from 'react';
/*
* Same as setState with the difference being that the value
* passed in the argument of the hook is not only an initial
* value but will synchronize with the returned state should
* it change (pointer identity).
*/
const useSynchronizingState = <V>(value: V) => {
... | 7,333 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/i18n/.eslintrc.js | module.exports = {
extends: ['@proton/eslint-config-proton'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
rules: {
'import/no-dynamic-require': 'off',
'global-require': 'off',
'no-console': '... | 7,334 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/i18n/.prettierignore | test
| 7,335 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/i18n/LICENSE | The MIT License (MIT)
Copyright (c) 2019 by Proton Technologies A.G. (Switzerland) Email: contact@protonmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including wit... | 7,336 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/i18n/Readme.md | # Proton I18N
A CLI to manage translations - validation - extraction
We use [ttag](https://github.com/ttag-org/ttag) for our React projects and [angular-gettext](https://github.com/rubenv/angular-gettext) for our [WebClient](https://github.com/ProtonMail/WebClient).
## Commands
```sh
$ npx proton-i18n help
Usage: $... | 7,337 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/i18n/config.js | const path = require('path');
module.exports = {
TEMPLATE_FILE: process.env.I18N_TEMPLATE_FILE || path.join('po', 'template.pot'),
};
| 7,338 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/i18n/help | Usage: $ proton-i18n <command>
Available commands:
- [blue]validate[/blue] [yellow]<type>[/yellow]
To validate the translations, check if we have contexts
- type: default (default) validate we don't have missing context
- type: lint-functions check if we use the right format for ttag
- [blue]... | 7,339 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/i18n/index.js | #!/usr/bin/env node
const { error } = require('./lib/helpers/log')('proton-i18n');
const renderHelp = require('./lib/helpers/help');
const argv = process.argv.slice(2);
const is = (command) => argv.includes(command);
async function main() {
const [, ...options] = argv;
if (is('extract')) {
await req... | 7,340 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/i18n/package.json | {
"name": "@proton/i18n",
"description": "CLI to extract/validate translations from the code",
"keywords": [],
"license": "ISC",
"author": "Proton AG",
"main": "index.js",
"bin": {
"proton-i18n": "index.js"
},
"scripts": {
"lint": "eslint lib index.js config.js --ext ... | 7,341 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/i18n/tsconfig.json | {
"extends": "../../tsconfig.base.json"
}
| 7,342 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n | petrpan-code/ProtonMail/WebClients/packages/i18n/lib/extract.js | const { TEMPLATE_FILE } = require('../config');
const { success, debug } = require('./helpers/log')('proton-i18n');
const { hasDirectory } = require('./helpers/file');
const { script, bash } = require('./helpers/cli');
const PATHS = {
reactComponents: ['{components,containers,helpers,hooks}'],
shared: ['lib'],... | 7,343 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n | petrpan-code/ProtonMail/WebClients/packages/i18n/lib/validate.js | const fs = require('fs');
const path = require('path');
const gettextParser = require('gettext-parser');
const { success, debug } = require('./helpers/log')('proton-i18n');
const { TEMPLATE_FILE } = require('../config');
const { scriptNode } = require('./helpers/cli');
const isLint = process.argv.includes('--lint');
... | 7,344 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/lib | petrpan-code/ProtonMail/WebClients/packages/i18n/lib/helpers/cli.js | const path = require('path');
const execa = require('execa');
const { debug } = require('./log')('proton-i18n');
const bash = (cli, args = [], stdio) => {
debug({ cli, args, stdio }, 'bash');
return execa(cli, args, { shell: '/bin/bash', stdio });
};
// 'inherit'
const script = (cli, args = [], stdio) => {
... | 7,345 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/lib | petrpan-code/ProtonMail/WebClients/packages/i18n/lib/helpers/file.js | const { promises: fs, constants: FS_CONSTANTS } = require('fs');
const path = require('path');
const { warn } = require('./log')('proton-i18n');
/**
* Check if a directory exists, else we create it
* @param {String} filePath Path to a file (or directory if isDir is true)
* @param {Boolean} isDir ... | 7,346 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/lib | petrpan-code/ProtonMail/WebClients/packages/i18n/lib/helpers/help.js | const fs = require('fs');
const path = require('path');
const chalk = require('chalk');
function render(name = 'help') {
const CLI_DIR = path.resolve(__dirname, '..', '..');
const file = fs.readFileSync(path.join(CLI_DIR, name), 'utf8');
const content = file.replace(/\[(\w+)\](<\w+>|\w+|--\w+\|-\w|\w+-\w+)... | 7,347 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/lib | petrpan-code/ProtonMail/WebClients/packages/i18n/lib/helpers/log.js | const chalk = require('chalk');
const { IS_VERBOSE } = process.env;
module.exports = (scope) => {
const warn = (msg, addSpaces = true) => {
addSpaces && console.log();
console.log(chalk.bgMagenta(chalk.white('[warning]')), msg);
addSpaces && console.log();
};
const info = (msg, ad... | 7,348 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n | petrpan-code/ProtonMail/WebClients/packages/i18n/scripts/extract.sh | #!/usr/bin/env bash
set -eo pipefail
##
# Extract all the files we need to parse to get the translations
# - react-components
# - proton-shared
# - app sources
#
# We remove as much files a possible so it's faster
getFileList() {
# Remove what we do not need to filter + it makes find more complex
rm -rf node... | 7,349 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n | petrpan-code/ProtonMail/WebClients/packages/i18n/scripts/linter.mjs | /*
* Usage node linter.mjs [arg]
* - arg can be a directory or a single file (default src)
*/
import { readFile } from 'fs/promises';
import { sync } from 'glob';
import path from 'path';
/**
* @typedef {string} FilePath
* @typedef {'format' | 'usage' | 'backticks' | 'plurals'} BrokenRuleType
* @typedef {{ file... | 7,350 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n | petrpan-code/ProtonMail/WebClients/packages/i18n/test/.env | I18N_JSON_DIR="test/compile"
I18N_EXTRACT_DIR="test/po"
| 7,351 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n | petrpan-code/ProtonMail/WebClients/packages/i18n/test/test-linter.sh | #!/usr/bin/env bash
set -eo pipefail
readonly TEST_FILES='test/input/js';
function main {
local hasError=false;
for file in "$TEST_FILES"/*; do
echo "[~] validate ${file}";
local expectedFile="$(sed 's/\.js$//; s/input/output/' <<< "$file")";
local output="$(node scripts/linter.mjs "$file")";
... | 7,352 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n | petrpan-code/ProtonMail/WebClients/packages/i18n/test/test-validator.sh | #!/usr/bin/env bash
set -eo pipefail
readonly TEST_FILES='test/input/po';
function main {
# $ for file in test/po/*; do
#
# I18N_TEMPLATE_FILE="$file" node index validate > "test/output/po/$(basename "$file")";
#
# done;
local hasError=false;
for file in "$TEST_FILES"/*; do
echo "[~] validate ${file}";... | 7,353 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input/js/broken.js | c('Action').t('Salut')
c('Action').c('Robert')
c('Action').c('jeanne')
c('Action').t('Monique')
c('Action').`OUPS`
c('Action').`OUPS 2`
c('Action').c`Nope monique`
c('Action').c`Nope monique 2`
c('Action').ngettext(msgid`Day`, 'Days', modifiedValue)
c('Action').ngettext(msgid`Miinute`, "Miinutes", modifiedValue)
c('Act... | 7,354 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input/js/valid.js | c('Action').t`Ok monique`;
c('Action').t`Ok monique 2`;
c('Action').ngettext(msgid`Day`, `Days`, modifiedValue);
c('Action').ngettext(msgid`Minute`, `Minutes`, modifiedValue);
| 7,355 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input/po/es.po | msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: protonvpn\n"
"X-Crowdin-Language: es-ES\n"
"X-Crowdin-File: ProtonVPN Settings Application.pot\n"
"Project-Id-Version: protonvpn\n"
"Last-Translator: PMtranslato... | 7,356 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input/po/fr.po | msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: protonvpn\n"
"X-Crowdin-Language: fr-FR\n"
"X-Crowdin-File: ProtonVPN Settings Application.pot\n"
"Project-Id-Version: protonvpn\n"
"Last-Translator: PMtranslato... | 7,357 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input/po/template_empty_context.pot | msgid ""
msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: node_modules/proton-shared/lib/contacts/decrypt.ts:95
msgctxt "Error"
msgid "Missing signature"
msgstr ""
#: node_modules/proton-shared/lib/contacts/decrypt.ts:80
msgctxt ""
msgid "Contact signature not veri... | 7,358 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input/po/template_invalid_variables.pot | msgid ""
msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: node_modules/proton-shared/lib/contacts/decrypt.ts:67
#: node_modules/proton-shared/lib/contacts/decrypt.ts:95
msgctxt "Error"
msgid "Missing signature"
msgstr ""
#: node_modules/react-components/containers/... | 7,359 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input/po/template_ok.pot | msgid ""
msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: node_modules/proton-shared/lib/contacts/decrypt.ts:80
msgctxt "Error"
msgid "Contact signature not verified"
msgstr ""
#: node_modules/react-components/containers/contacts/ContactGroupDropdown.tsx:149
msgctx... | 7,360 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input/po/ua.po | msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: protonvpn\n"
"X-Crowdin-Language: uk\n"
"X-Crowdin-File: ProtonVPN Settings Application.pot\n"
"Project-Id-Version: protonvpn\n"
"Last-Translator: PMtranslator\n... | 7,361 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input | petrpan-code/ProtonMail/WebClients/packages/i18n/test/input/po/zh-TW.po | msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: protonvpn\n"
"X-Crowdin-Language: zh-TW\n"
"X-Crowdin-File: ProtonVPN Settings Application.pot\n"
"Project-Id-Version: protonvpn\n"
"Last-Translator: PMtranslato... | 7,362 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output/js/broken | 🚨 [Error] test/input/js/broken.js:0
match: c('Action').t(
line: c('Action').t('Salut')
fix: You should not use - c(<context>).t(<string>) or c(<context>).c(<string>)
but c(<context>).t`<string>`
🚨 [Error] test/input/js/broken.js:1
match: c('Action').c(
line: c('Action').c('Robert')... | 7,363 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output/po/es.po | [proton-i18n] ✔ All translations have a context, good job !
[proton-i18n] ✔ All translations have matching variables
| 7,364 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output/po/fr.po | [proton-i18n] ✔ All translations have a context, good job !
[proton-i18n] ✔ All translations have matching variables
| 7,365 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output/po/template_empty_context.pot | {
"msgid": "Contact group apply",
"comments": {
"reference": "node_modules/react-components/containers/contacts/ContactGroupDropdown.tsx:149"
},
"msgid_plural": "Contact groups apply",
"msgstr": [
"",
""
]
}
{
"msgid": "Contact signature not verified",
"comments": {
"reference": "node_mo... | 7,366 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output/po/template_invalid_variables.pot | [proton-i18n] ✔ All translations have a context, good job !
{
"msgid": "1 Member",
"msgctxt": "Info",
"comments": {
"reference": "node_modules/react-components/containers/contacts/modals/ContactGroupModal.tsx:187"
},
"msgid_plural": "${ model.contactEmails.length } Members",
"msgstr": [
"",
""
... | 7,367 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output/po/template_ok.pot | [proton-i18n] ✔ All translations have a context, good job !
[proton-i18n] ✔ All translations have matching variables
| 7,368 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output/po/ua.po | [proton-i18n] ✔ All translations have a context, good job !
[proton-i18n] ✔ All translations have matching variables
| 7,369 |
0 | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output | petrpan-code/ProtonMail/WebClients/packages/i18n/test/output/po/zh-TW.po | [proton-i18n] ✔ All translations have a context, good job !
[proton-i18n] ✔ All translations have matching variables
| 7,370 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/key-transparency/.eslintignore | test/**/*data.js
| 7,371 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/key-transparency/.eslintrc.js | module.exports = {
extends: ['@proton/eslint-config-proton'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
ignorePatterns: ['.eslintrc.js'],
};
| 7,372 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/key-transparency/.prettierignore | test
| 7,373 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/key-transparency/LICENSE | The MIT License (MIT)
Copyright (c) 2019 by Proton Technologies A.G. (Switzerland) Email: contact@protonmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including wit... | 7,374 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/key-transparency/package.json | {
"name": "@proton/key-transparency",
"description": "ProtonMail Key Transparency Web Client",
"license": "MIT",
"author": "ProtonMail",
"main": "lib/index.ts",
"scripts": {
"check-types": "tsc",
"i18n:validate": "proton-i18n validate lint-functions",
"i18n:validate:conte... | 7,375 |
0 | petrpan-code/ProtonMail/WebClients/packages | petrpan-code/ProtonMail/WebClients/packages/key-transparency/tsconfig.json | {
"extends": "../../tsconfig.base.json"
}
| 7,376 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/index.ts | export * from './interfaces';
export * from './storage';
export * from './constants';
export * from './helpers';
export * from './verification';
| 7,377 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/interfaces.ts | import { FetchedSignedKeyList } from '@proton/shared/lib/interfaces';
import { KT_CERTIFICATE_ISSUER, KT_DOMAINS } from './constants';
import { KeyTransparencyError } from './helpers';
export enum KTPROOF_TYPE {
ABSENCE,
EXISTENCE,
OBSOLESCENCE,
}
export interface Proof {
Neighbors: (string | null)[]... | 7,378 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/constants/certificates.ts | import { KT_CERTIFICATE_ISSUER } from './constants';
const letsEncryptCerts: string[] = [
// ISRGRootX1:
'-----BEGIN CERTIFICATE-----\nMIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw\nTzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh\ncmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEw... | 7,379 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/constants/constants.ts | import { HOUR } from '@proton/shared/lib/constants';
export const MAX_EPOCH_INTERVAL = 72 * HOUR;
export const EXPECTED_EPOCH_INTERVAL = 4 * HOUR;
// VRF constants
export const vrfHexKeyDev = '2d7688feb429f714f102f758412cd4b81337b307122770f620ad9e4ac898a2eb';
export const vrfHexKeyProd = '90a74b3d3ad9cb92e62c4e9c32ac... | 7,380 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/constants/domains.ts | export const NO_KT_DOMAINS = [
// Google
'@gmail.com',
'@googlemail.com',
'@google.com',
'@googlegroups.com',
// Microsoft
'@charter.com',
'@compaq.net',
'@hotmail.be',
'@hotmail.ca',
'@hotmail.ch',
'@hotmail.cl',
'@hotmail.co.id',
'@hotmail.co.il',
'@hotmail.... | 7,381 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/constants/index.ts | export * from './certificates';
export * from './constants';
export * from './domains';
| 7,382 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/helpers/api.ts | export interface GetEpochsParams {
SinceEpochID?: number;
Page?: number;
PageSize?: number;
}
export const getEpochsRoute = (params: GetEpochsParams) => ({
url: 'kt/epochs',
method: 'get',
params,
});
export interface GetCertificateParams {
EpochID: number;
}
export const getCertificateRo... | 7,383 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/helpers/apiHelpers.ts | import { CryptoProxy, PrivateKeyReference, PublicKeyReference, VERIFICATION_STATUS } from '@proton/crypto';
import {
getSignedKeyListRoute,
getSignedKeyListsRoute,
updateSignedKeyListRoute,
updateSignedKeyListSignatureRoute,
} from '@proton/shared/lib/api/keys';
import { HTTP_STATUS_CODE } from '@proton... | 7,384 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/helpers/index.ts | export * from './api';
export * from './apiHelpers';
export * from './utils';
| 7,385 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/helpers/utils.ts | import { sub } from 'date-fns';
import { serverTime } from '@proton/crypto';
import { TelemetryKeyTransparencyErrorEvents, TelemetryMeasurementGroups } from '@proton/shared/lib/api/telemetry';
import { PROTON_DOMAINS } from '@proton/shared/lib/constants';
import { sendTelemetryReport } from '@proton/shared/lib/helpers... | 7,386 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/storage/index.ts | export * from './storageHelpers';
export * from './ktStorageAPI';
| 7,387 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/storage/ktStorageAPI.ts | import { instance } from '@proton/cross-storage/account-impl/guestInstance';
import { APPS, APP_NAMES } from '@proton/shared/lib/constants';
import { KTLocalStorageAPI } from '@proton/shared/lib/interfaces';
import { getDefaultKTLS } from '@proton/shared/lib/keyTransparency';
const isCrossStorageAvailable = ((): (() =... | 7,388 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/storage/storageHelpers.ts | import { CryptoProxy, PrivateKeyReference, PublicKeyReference } from '@proton/crypto';
import { KTLocalStorageAPI } from '@proton/shared/lib/interfaces';
import { ktSentryReportError, throwKTError } from '../helpers/utils';
import { KTBlobContent, KTBlobValuesWithInfo, SelfAuditResult } from '../interfaces';
/**
* G... | 7,389 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification/index.ts | export * from './verifyCertificates';
export * from './verifyEpochs';
export * from './verifyKeys';
export * from './verifyProofs';
export * from './vrf';
export * from './self-audit';
export * from './verifyAddress';
| 7,390 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification/verifyAddress.ts | import { Api, FetchedSignedKeyList } from '@proton/shared/lib/interfaces';
import { fetchProof, throwKTError } from '../helpers';
import { Epoch } from '../interfaces';
import {
verifyProofOfAbsenceForAllRevision,
verifyProofOfAbsenceForRevision,
verifyProofOfObsolescence,
} from './verifyProofs';
/**
* ... | 7,391 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification/verifyCertificates.ts | import { fromBER } from 'asn1js';
import { Certificate, CertificateChainValidationEngine, GeneralName, verifySCTsForCertificate } from 'pkijs';
import { getParametersValue } from 'pvutils';
import { hexStringToArray } from '@proton/crypto/lib/utils';
import { base64StringToUint8Array, uint8ArrayToBase64String } from '... | 7,392 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification/verifyEpochs.ts | import { CryptoProxy, serverTime } from '@proton/crypto';
import { arrayToHexString, hexStringToArray } from '@proton/crypto/lib/utils';
import { throwKTError } from '../helpers/utils';
import { Epoch } from '../interfaces';
import { parseCertChain, parseCertTime, verifyAltName, verifyCertChain, verifySCT } from './ve... | 7,393 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification/verifyKeys.ts | import { CryptoProxy, KeyReference, PublicKeyReference, VERIFICATION_STATUS } from '@proton/crypto';
import {
Api,
FetchedSignedKeyList,
GetLatestEpoch,
KT_VERIFICATION_STATUS,
KeyTransparencyVerificationResult,
ProcessedApiAddressKey,
SaveSKLToLS,
SignedKeyListItem,
} from '@proton/shar... | 7,394 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification/verifyProofs.ts | import { CryptoProxy } from '@proton/crypto';
import { arrayToHexString, binaryStringToArray, hexStringToArray } from '@proton/crypto/lib/utils';
import { canonicalizeInternalEmail } from '@proton/shared/lib/helpers/email';
import { FetchedSignedKeyList } from '@proton/shared/lib/interfaces';
import mergeUint8Arrays fr... | 7,395 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification/vrf.ts | import { CURVE, Point } from '@noble/ed25519';
import { CryptoProxy } from '@proton/crypto';
import { arrayToHexString } from '@proton/crypto/lib/utils';
import mergeUint8Arrays from '@proton/utils/mergeUint8Arrays';
import { CO_FACTOR, N, ptLen } from '../constants/constants';
/**
* Convert an Uint8Array represent... | 7,396 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification/self-audit/addressAudit.ts | import { CryptoProxy, PrivateKeyReference } from '@proton/crypto';
import { KEY_FLAG } from '@proton/shared/lib/constants';
import { hasBit } from '@proton/shared/lib/helpers/bitset';
import {
ActiveSignedKeyList,
Address,
Api,
DecryptedAddressKey,
FetchedSignedKeyList,
KeyPair,
SaveSKLToLS,... | 7,397 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification/self-audit/index.ts | export * from './selfAudit';
| 7,398 |
0 | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification | petrpan-code/ProtonMail/WebClients/packages/key-transparency/lib/verification/self-audit/selfAudit.ts | import { serverTime } from '@proton/crypto';
import { getIsAddressDisabled } from '@proton/shared/lib/helpers/address';
import { Api, KTLocalStorageAPI, SaveSKLToLS, SelfAuditState, UploadMissingSKL } from '@proton/shared/lib/interfaces';
import { getSelfAuditInterval } from '../../helpers';
import { SelfAuditResult }... | 7,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.