Compare commits

..

No commits in common. "master" and "2.3.2" have entirely different histories.

23 changed files with 22216 additions and 18230 deletions

View File

@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
node-version: [ 16 ]
node-version: [ lts/* ]
steps:
- uses: actions/checkout@v3
@ -21,7 +21,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Clean install, build, test
run: |
@ -34,12 +33,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
- name: Use Node.js latest
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
node-version: latest
- name: Clean install, lint
run: |
npm ci

View File

@ -2,10 +2,6 @@ export declare const OIDS_DICTIONARY: {
'1.2.643.2.2.34.6': string;
'1.2.643.2.39.1.1': string;
'1.2.643.3.131.1.1': string;
'1.2.643.100.4': string;
'1.2.643.100.1': string;
'1.2.643.100.5': string;
'1.2.643.100.3': string;
'1.2.643.3.141.1.1': string;
'1.2.643.3.141.1.2': string;
'1.2.643.3.2.100.65.13.11': string;

View File

@ -1,4 +1,4 @@
// Type definitions for crypto-pro-js 2.3.3
// Type definitions for crypto-pro-js 2.3.2
// Project: crypto-pro-js
// Definitions by: Artem Vasilev https://github.com/kernusr

195
dist/crypto-pro-js.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
export declare const _extractCommonName: (subjectName: string) => string | undefined;
export declare const _extractCommonName: (subjectName: string) => string;

View File

@ -1 +1 @@
export declare const _extractMeaningfulErrorMessage: (error: Error) => string | null;
export declare const _extractMeaningfulErrorMessage: (error: Error) => string;

33
examples/script-tag/package-lock.json generated Normal file → Executable file
View File

@ -1,14 +1,14 @@
{
"name": "crypto-pro-example-es5-script-tag",
"version": "2.3.3",
"version": "0.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "crypto-pro-example-es5-script-tag",
"version": "2.3.3",
"version": "0.0.0",
"dependencies": {
"crypto-pro-js": "^2.3.3"
"crypto-pro-js": "^2.3.2"
},
"devDependencies": {
"node-static": "0.7.11",
@ -59,12 +59,9 @@
"dev": true
},
"node_modules/crypto-pro-js": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/crypto-pro-js/-/crypto-pro-js-2.3.3.tgz",
"integrity": "sha512-ge6PXRw6pu2kXeaqwEpHvmQEuSRQWJcVfQfPfF5gGONIi+jUHFsvkeS5ojFcKKBDqFHnYUQXFZ1aMKDGdoVRqg==",
"engines": {
"node": "~16"
}
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/crypto-pro-js/-/crypto-pro-js-2.3.2.tgz",
"integrity": "sha512-XD5STnobroyuli5k/8udnv5oOwZpVhf1/3uoD7/FMSbBQSTstu1IOS+uckFC3I2LRvDOmdzntYAZqyY/1/NB1A=="
},
"node_modules/fs.realpath": {
"version": "1.0.0",
@ -145,9 +142,9 @@
}
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"dependencies": {
"brace-expansion": "^1.1.7"
@ -314,9 +311,9 @@
"dev": true
},
"crypto-pro-js": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/crypto-pro-js/-/crypto-pro-js-2.3.3.tgz",
"integrity": "sha512-ge6PXRw6pu2kXeaqwEpHvmQEuSRQWJcVfQfPfF5gGONIi+jUHFsvkeS5ojFcKKBDqFHnYUQXFZ1aMKDGdoVRqg=="
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/crypto-pro-js/-/crypto-pro-js-2.3.2.tgz",
"integrity": "sha512-XD5STnobroyuli5k/8udnv5oOwZpVhf1/3uoD7/FMSbBQSTstu1IOS+uckFC3I2LRvDOmdzntYAZqyY/1/NB1A=="
},
"fs.realpath": {
"version": "1.0.0",
@ -382,9 +379,9 @@
"dev": true
},
"minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"

View File

@ -1,6 +1,6 @@
{
"name": "crypto-pro-example-es5-script-tag",
"version": "2.3.3",
"version": "0.0.0",
"description": "Пример использования пакета crypto-pro через тэг script",
"private": true,
"scripts": {
@ -13,6 +13,6 @@
"symlink-dir": "3.1.2"
},
"dependencies": {
"crypto-pro-js": "^2.3.3"
"crypto-pro-js": "^2.3.2"
}
}

View File

@ -2,10 +2,6 @@ export declare const OIDS_DICTIONARY: {
'1.2.643.2.2.34.6': string;
'1.2.643.2.39.1.1': string;
'1.2.643.3.131.1.1': string;
'1.2.643.100.4': string;
'1.2.643.100.1': string;
'1.2.643.100.5': string;
'1.2.643.100.3': string;
'1.2.643.3.141.1.1': string;
'1.2.643.3.141.1.2': string;
'1.2.643.3.2.100.65.13.11': string;

View File

@ -1,4 +1,4 @@
// Type definitions for crypto-pro-js 2.3.3
// Type definitions for crypto-pro-js 2.3.2
// Project: crypto-pro-js
// Definitions by: Artem Vasilev https://github.com/kernusr

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
export declare const _extractCommonName: (subjectName: string) => string | undefined;
export declare const _extractCommonName: (subjectName: string) => string;

View File

@ -1 +1 @@
export declare const _extractMeaningfulErrorMessage: (error: Error) => string | null;
export declare const _extractMeaningfulErrorMessage: (error: Error) => string;

39735
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,90 +1,87 @@
{
"name": "crypto-pro-js",
"version": "2.3.3",
"description": "Асинхронный JavaScript API для работы с КриптоПРО ЭЦП Browser Plug-In. Forked from https://github.com/vgoma/crypto-pro",
"main": "./lib/crypto-pro-js.js",
"types": "./lib/crypto-pro-js.d.ts",
"files": [
"lib/**/*",
"dist/**/*",
"bower.json"
],
"scripts": {
"clean": "rimraf dist lib package coverage",
"start": "cross-env TS_CONFIG=tsconfig-es5.json webpack --watch",
"build:uncompressed:es5": "cross-env TS_CONFIG=tsconfig-es5.json webpack",
"build:compressed:es5": "cross-env TS_CONFIG=tsconfig-es5.json NODE_ENV=production webpack",
"build:definition-header:es5": "cross-env TS_CONFIG=tsconfig-es5.json node definition-header.js",
"build:es5": "npm run build:uncompressed:es5 && npm run build:compressed:es5 && npm run build:definition-header:es5",
"build:uncompressed:esm": "cross-env TS_CONFIG=tsconfig-esm.json webpack",
"build:definition-header:esm": "cross-env TS_CONFIG=tsconfig-esm.json node definition-header.js",
"build:esm": "npm run build:uncompressed:esm && npm run build:definition-header:esm",
"build": "npm run clean && npm run build:es5 && npm run build:esm",
"pack:clean": "cross-env rimraf %npm_package_name%-%npm_package_version%.tgz",
"pack:uncompress": "cross-env tar xopf %npm_package_name%-%npm_package_version%.tgz",
"test": "jest --coverage",
"lint": "eslint --config .eslintrc.js --ext .ts --ext .js src",
"lint:fix": "eslint --fix --config .eslintrc.js --ext .ts --ext .js src",
"examples-update": "npm run examples-update:script-tag",
"examples-update:script-tag": "npm --prefix ./examples/script-tag r crypto-pro-js && npm --prefix ./examples/script-tag i crypto-pro-js",
"prepack": "npm run build",
"prepublishOnly": "npm run lint && jest && npm run build",
"postpublish": "npm run examples-update"
},
"repository": {
"type": "git",
"url": "https://github.com/webmasterskaya/crypto-pro-js"
},
"author": {
"name": "Artem Vasilev",
"email": "kern.usr@gmail.com",
"url": "https://github.com/kernusr"
},
"contributors": [
{
"name": "Vitalii Goma",
"email": "vgoma@yandex.ru",
"url": "https://github.com/vgoma"
},
{
"name": "German Arutyunov",
"email": "germanarutyunov@gmail.com",
"url": "https://github.com/gaarutyunov"
}
],
"keywords": [
"crypto",
"cryptopro",
"crypto-pro",
"crypto-pro-js",
"cades",
"КриптоПро",
"Крипто ПРО"
],
"license": "MIT",
"devDependencies": {
"@types/jest": "25.1.4",
"@types/lodash": "4.14.149",
"@types/node": "13.9.5",
"@typescript-eslint/eslint-plugin": "2.25.0",
"@typescript-eslint/parser": "2.25.0",
"coveralls": "3.0.11",
"cross-env": "^7.0.2",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.1",
"eslint-plugin-prettier": "3.1.2",
"jest": "^25.5.4",
"prettier": "2.0.2",
"rimraf": "3.0.2",
"sinon": "9.0.1",
"tar": "6.1.9",
"ts-jest": "^25.5.1",
"ts-loader": "^9.4.2",
"typescript": "^3.9.10",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
},
"engines": {
"node": "~16"
}
"name": "crypto-pro-js",
"version": "2.3.2",
"description": "Асинхронный JavaScript API для работы с КриптоПРО ЭЦП Browser Plug-In. Forked from https://github.com/vgoma/crypto-pro",
"main": "./lib/crypto-pro-js.js",
"types": "./lib/crypto-pro-js.d.ts",
"files": [
"lib/**/*",
"dist/**/*",
"bower.json"
],
"scripts": {
"clean": "rimraf dist lib package coverage",
"start": "cross-env TS_CONFIG=tsconfig-es5.json webpack --watch",
"build:uncompressed:es5": "cross-env TS_CONFIG=tsconfig-es5.json webpack",
"build:compressed:es5": "cross-env TS_CONFIG=tsconfig-es5.json NODE_ENV=production webpack",
"build:definition-header:es5": "cross-env TS_CONFIG=tsconfig-es5.json node definition-header.js",
"build:es5": "npm run build:uncompressed:es5 && npm run build:compressed:es5 && npm run build:definition-header:es5",
"build:uncompressed:esm": "cross-env TS_CONFIG=tsconfig-esm.json webpack",
"build:definition-header:esm": "cross-env TS_CONFIG=tsconfig-esm.json node definition-header.js",
"build:esm": "npm run build:uncompressed:esm && npm run build:definition-header:esm",
"build": "npm run clean && npm run build:es5 && npm run build:esm",
"pack:clean": "cross-env rimraf %npm_package_name%-%npm_package_version%.tgz",
"pack:uncompress": "cross-env tar xopf %npm_package_name%-%npm_package_version%.tgz",
"test": "jest --coverage",
"lint": "eslint --config .eslintrc.js --ext .ts --ext .js src",
"lint:fix": "eslint --fix --config .eslintrc.js --ext .ts --ext .js src",
"examples-update": "npm run examples-update:script-tag",
"examples-update:script-tag": "npm --prefix ./examples/script-tag r crypto-pro-js && npm --prefix ./examples/script-tag i crypto-pro-js",
"prepack": "npm run build",
"prepublishOnly": "npm run lint && jest && npm run build",
"postpublish": "npm run examples-update"
},
"repository": {
"type": "git",
"url": "https://github.com/webmasterskaya/crypto-pro-js"
},
"author": {
"name": "Artem Vasilev",
"email": "kern.usr@gmail.com",
"url": "https://github.com/kernusr"
},
"contributors": [
{
"name": "Vitalii Goma",
"email": "vgoma@yandex.ru",
"url": "https://github.com/vgoma"
},
{
"name": "German Arutyunov",
"email": "germanarutyunov@gmail.com",
"url": "https://github.com/gaarutyunov"
}
],
"keywords": [
"crypto",
"cryptopro",
"crypto-pro",
"crypto-pro-js",
"cades",
"КриптоПро",
"Крипто ПРО"
],
"license": "MIT",
"devDependencies": {
"@types/jest": "25.1.4",
"@types/lodash": "4.14.149",
"@types/node": "13.9.5",
"@typescript-eslint/eslint-plugin": "2.25.0",
"@typescript-eslint/parser": "2.25.0",
"coveralls": "3.0.11",
"cross-env": "^7.0.2",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.1",
"eslint-plugin-prettier": "3.1.2",
"jest": "25.2.3",
"prettier": "2.0.2",
"rimraf": "3.0.2",
"sinon": "9.0.1",
"tar": "6.1.9",
"ts-jest": "^25.5.1",
"ts-loader": "6.2.2",
"typescript": "3.8.3",
"webpack": "4.42.1",
"webpack-cli": "3.3.11"
}
}

View File

@ -1,19 +1,18 @@
import { TagsTranslations } from './tags-translations';
export const ISSUER_TAGS_TRANSLATIONS: TagsTranslations[] = [
{ possibleNames: ['UN', 'UnstructuredName'], translation: 'Неструктурированное имя' },
{ possibleNames: ['CN', 'commonName'], translation: 'Удостоверяющий центр' },
{ possibleNames: ['C', 'countryName'], translation: 'Страна' },
{ possibleNames: ['S', 'ST', 'stateOrProvinceName'], translation: 'Регион' },
{ possibleNames: ['STREET', 'streetAddress'], translation: 'Адрес' },
{ possibleNames: ['O', 'organizationName'], translation: 'Компания' },
{ possibleNames: ['OU', 'organizationalUnitName'], translation: 'Тип' },
{ possibleNames: ['T', 'TITLE'], translation: 'Должность' },
{ possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' },
{ possibleNames: ['CN'], translation: 'Удостоверяющий центр' },
{ possibleNames: ['C'], translation: 'Страна' },
{ possibleNames: ['S'], translation: 'Регион' },
{ possibleNames: ['STREET'], translation: 'Адрес' },
{ possibleNames: ['O'], translation: 'Компания' },
{ possibleNames: ['OU'], translation: 'Тип' },
{ possibleNames: ['T'], translation: 'Должность' },
{ possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },
{ possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },
{ possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },
{ possibleNames: ['ИНН', 'ИННФЛ', 'ИНН ФЛ', 'INN', 'ИНН физического лица'], translation: 'ИНН' },
{ possibleNames: ['ИННЮЛ', 'ИНН ЮЛ', 'INN LE', 'INNLE', 'ИНН организации'], translation: 'ИНН организации' },
{ possibleNames: ['E', 'email', 'emailAddress', 'pkcs9email'], translation: 'Email' },
{ possibleNames: ['L', 'localityName'], translation: 'Город' },
{ possibleNames: ['ИНН', 'INN', 'ИНН организации'], translation: 'ИНН' },
{ possibleNames: ['E'], translation: 'Email' },
{ possibleNames: ['L'], translation: 'Город' },
];

View File

@ -2,10 +2,6 @@ export const OIDS_DICTIONARY = {
'1.2.643.2.2.34.6': 'Пользователь Центра Регистрации',
'1.2.643.2.39.1.1': 'Использование в программных продуктах системы "1С:Предприятие 8"',
'1.2.643.3.131.1.1': 'ИНН',
'1.2.643.100.4': 'ИНН организации',
'1.2.643.100.1': 'ОГРН',
'1.2.643.100.5': 'ОГРНИП',
'1.2.643.100.3': 'СНИЛС',
'1.2.643.3.141.1.1': 'РНС ФСС',
'1.2.643.3.141.1.2': 'КП ФСС',
'1.2.643.3.2.100.65.13.11': 'Использование в системе АИС "Госзакупки" Сахалинской области.',

View File

@ -1,21 +1,20 @@
import { TagsTranslations } from './tags-translations';
export const SUBJECT_TAGS_TRANSLATIONS: TagsTranslations[] = [
{ possibleNames: ['UN', 'UnstructuredName'], translation: 'Неструктурированное имя' },
{ possibleNames: ['CN', 'commonName'], translation: 'Владелец' },
{ possibleNames: ['SN', 'surname'], translation: 'Фамилия' },
{ possibleNames: ['G', 'givenName', 'gn'], translation: 'Имя Отчество' },
{ possibleNames: ['C', 'countryName'], translation: 'Страна' },
{ possibleNames: ['S', 'ST', 'stateOrProvinceName'], translation: 'Регион' },
{ possibleNames: ['STREET', 'streetAddress'], translation: 'Адрес' },
{ possibleNames: ['O', 'organizationName'], translation: 'Компания' },
{ possibleNames: ['OU', 'organizationalUnitName'], translation: 'Отдел/подразделение' },
{ possibleNames: ['T', 'TITLE'], translation: 'Должность' },
{ possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' },
{ possibleNames: ['CN'], translation: 'Владелец' },
{ possibleNames: ['SN'], translation: 'Фамилия' },
{ possibleNames: ['G'], translation: 'Имя Отчество' },
{ possibleNames: ['C'], translation: 'Страна' },
{ possibleNames: ['S'], translation: 'Регион' },
{ possibleNames: ['STREET'], translation: 'Адрес' },
{ possibleNames: ['O'], translation: 'Компания' },
{ possibleNames: ['OU'], translation: 'Отдел/подразделение' },
{ possibleNames: ['T'], translation: 'Должность' },
{ possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },
{ possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },
{ possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },
{ possibleNames: ['ИНН', 'ИННФЛ', 'ИНН ФЛ', 'INN', 'ИНН физического лица'], translation: 'ИНН' },
{ possibleNames: ['ИННЮЛ', 'ИНН ЮЛ', 'INN LE', 'INNLE', 'ИНН организации'], translation: 'ИНН организации' },
{ possibleNames: ['E', 'email', 'emailAddress', 'pkcs9email'], translation: 'Email' },
{ possibleNames: ['L', 'localityName'], translation: 'Город' },
{ possibleNames: ['ИНН', 'INN', 'ИНН организации'], translation: 'ИНН' },
{ possibleNames: ['E'], translation: 'Email' },
{ possibleNames: ['L'], translation: 'Город' },
];

View File

@ -18,8 +18,8 @@ describe('_parseCertInfo', () => {
'OID.1.2.643.6.3.1.4.1=Петров',
'UNKNOWN=неизвестный тэг',
'E=email@example.ru',
'INN=997811514257',
'ИНН ЮЛ=007811514257',
'INN=007811514257',
'ИНН организации=007811514257',
'OGRN=1127847087885',
'SNILS=11617693460',
].join(', ');
@ -96,13 +96,13 @@ describe('_parseCertInfo', () => {
isTranslated: true,
},
{
description: '997811514257',
description: '007811514257',
title: 'ИНН',
isTranslated: true,
},
{
description: '007811514257',
title: 'ИНН организации',
title: 'ИНН',
isTranslated: true,
},
{
@ -128,8 +128,8 @@ describe('_parseCertInfo', () => {
'L=Санкт-Петербург',
'S=78 Санкт-Петербург',
'C=RU',
'INN=997813317783',
'INNLE=007813317783',
'INN=007813317783',
'ИНН организации=007813317783',
'OGRN=1057810150892',
'E=uc@sampokey.ru',
].join(', ');
@ -176,13 +176,13 @@ describe('_parseCertInfo', () => {
isTranslated: true,
},
{
description: '997813317783',
description: '007813317783',
title: 'ИНН',
isTranslated: true,
},
{
description: '007813317783',
title: 'ИНН организации',
title: 'ИНН',
isTranslated: true,
},
{