Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,563 changes: 1,997 additions & 1,566 deletions package-lock.json

Large diffs are not rendered by default.

58 changes: 28 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,55 @@
{
"name": "@web-eid/web-eid-library",
"version": "2.1.0-beta.0",
"description": "",
"version": "3.0.0-beta.0",
"description": "Secure authentication and digital signing with electronic ID smart cards for web applications",
"scripts": {
"lint": "eslint",
"build": "npm run clean && npm run compile && npm run bundle",
"build": "npm run clean && npm run bundle",
"clean": "rimraf ./dist",
"compile": "tsc",
"bundle": "rollup -c",
"test": "jest -i --silent --verbose",
"prepare": "npm run build",
"prepack": "npm run test && cp -R ./dist/node/* ./",
"postpack": "rimraf ./web-eid.js ./config.js ./errors ./models ./services ./utils ./*.d.ts ./*.map"
"prepack": "npm run test",
"postpack": "rimraf --glob ./web-eid.js ./config.js ./errors ./models ./services ./utils ./*.d.ts ./*.map"
},
"repository": {
"type": "git",
"url": "git@github.com:web-eid/web-eid.js.git"
},
"module": "web-eid.js",
"main": "./dist/umd/web-eid.js",
"module": "./dist/es/index.js",
"types": "./dist/es/index.d.ts",
"exports": {
".": {
"types": "./dist/es/index.d.ts",
"import": "./dist/es/index.js",
"require": "./dist/umd/web-eid.js",
"default": "./dist/iife/web-eid.js"
}
},
"files": [
"config.d.ts",
"config.d.ts.map",
"config.js",
"config.js.map",
"web-eid.d.ts",
"web-eid.d.ts.map",
"web-eid.js",
"web-eid.js.map",
"errors/**/*",
"models/**/*",
"services/**/*",
"utils/**/*",
"dist/es/*",
"dist/es/**/*",
"dist/iife/*",
"dist/umd/*"
],
"types": "web-eid.d.ts",
"author": "Tanel Metsar",
"license": "MIT",
"devDependencies": {
"@rollup/plugin-terser": "^0.4.4",
"@stylistic/eslint-plugin-js": "^3.1.0",
"@stylistic/eslint-plugin-ts": "^3.0.1",
"@stylistic/eslint-plugin-js": "^4.4.1",
"@stylistic/eslint-plugin-ts": "^4.4.1",
"@types/jest": "^29.5.14",
"eslint": "^9.19.0",
"eslint": "^9.39.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"rimraf": "^6.0.1",
"rollup": "^4.34.0",
"rimraf": "^6.1.2",
"rollup": "^4.57.1",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-license": "^3.5.3",
"ts-jest": "^29.2.5",
"typescript": "^5.7.3",
"typescript-eslint": "^8.22.0"
"rollup-plugin-dts": "^6.3.0",
"rollup-plugin-esbuild": "^6.2.1",
"rollup-plugin-license": "^3.6.0",
"ts-jest": "^29.4.6",
"typescript": "^5.9.3",
"typescript-eslint": "^8.54.0"
}
}
107 changes: 61 additions & 46 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,54 +1,69 @@
import path from "path";

import cleanup from "rollup-plugin-cleanup";
import { defineConfig } from "rollup";
import { dts } from "rollup-plugin-dts";
import esbuild from "rollup-plugin-esbuild";
import license from "rollup-plugin-license";
import terser from "@rollup/plugin-terser";

export default {
input: "./dist/node/web-eid.js",

plugins: [
cleanup({ comments: ["jsdoc"] }),
license({
banner: {
content: {
file: path.join(import.meta.dirname, "LICENSE"),
encoding: "utf-8",
},
},
}),
],

output: [
{
file: "dist/iife/web-eid.js",
format: "iife",
name: "webeid",
sourcemap: true,
},
{
file: "dist/iife/web-eid.min.js",
format: "iife",
name: "webeid",
sourcemap: false,
plugins: [terser()],
},
{
file: "dist/umd/web-eid.js",
format: "umd",
name: "webeid",
sourcemap: true,
const cleanupOpts = { comments: ["jsdoc"] };
const licenseOpts = {
banner: {
content: {
file: path.join(import.meta.dirname, "LICENSE"),
encoding: "utf-8",
},
{
file: "dist/umd/web-eid.min.js",
format: "umd",
name: "webeid",
sourcemap: false,
plugins: [terser()],
},
{
file: "dist/es/web-eid.js",
format: "es",
},
],
},
};

const outputModules = (format) => ({
dir: `dist/${format}`,
format: format,
exports: "named",
preserveModules: true,
sourcemap: true,
});
const outputBundle = (format, ext) => ({
file: `dist/${format}/web-eid.${ext}`,
name: "webeid",
format: format,
exports: "named",
sourcemap: true,
});
const outputMinifiedBundle = (format, ext) => ({
file: `dist/${format}/web-eid.min.${ext}`,
name: "webeid",
format: format,
exports: "named",
plugins: [terser()],
sourcemap: true,
});
export default [
defineConfig({
input: "src/index.ts",
plugins: [
esbuild({
target: "es2021",
}),
cleanup(cleanupOpts),
license(licenseOpts),
],
output: [
outputModules("es"),
outputBundle("umd", "js"),
outputMinifiedBundle("umd", "js"),
outputBundle("iife", "js"),
outputMinifiedBundle("iife", "js"),
],
}),
defineConfig({
input: "src/index.ts",
plugins: [
dts(),
cleanup(cleanupOpts),
license(licenseOpts),
],
output: [outputModules("es")],
}),
];
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

export default Object.freeze({
VERSION: "2.1.0-beta.0",
VERSION: "3.0.0-beta.0",
EXTENSION_HANDSHAKE_TIMEOUT: 1000, // 1 second
NATIVE_APP_HANDSHAKE_TIMEOUT: 5 * 1000, // 5 seconds
DEFAULT_USER_INTERACTION_TIMEOUT: 2 * 60 * 1000, // 2 minutes
Expand Down
16 changes: 16 additions & 0 deletions src/errors/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export * from "./ActionPendingError";
export * from "./ActionTimeoutError";
export * from "./ContextInsecureError";
export * from "./ErrorCode";
export * from "./ExtensionUnavailableError";
export * from "./KnownErrorConstructors";
export * from "./MissingParameterError";
export * from "./NativeFatalError";
export * from "./NativeInvalidArgumentError";
export * from "./NativeUnavailableError";
export * from "./SerializedError";
export * from "./UnknownError";
export * from "./UserCancelledError";
export * from "./UserTimeoutError";
export * from "./VersionInvalidError";
export * from "./VersionMismatchError";
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from "./errors";
export * from "./models";
export * from "./services";
export * from "./utils";
export * from "./web-eid";
8 changes: 8 additions & 0 deletions src/models/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export * from "./Action";
export * from "./ActionOptions";
export * from "./PendingMessage";
export * from "./RequiresUpdate";
export * from "./SignatureAlgorithm";
export * from "./Versions";

export * from "./message";
5 changes: 5 additions & 0 deletions src/models/message/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from "./NativeRequest";
export * from "./NativeResponse";
export * from "./LibraryResponse";
export * from "./ExtensionRequest";
export * from "./ExtensionResponse";
1 change: 1 addition & 0 deletions src/services/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as WebExtensionService } from "./WebExtensionService";
2 changes: 2 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./errorSerializer";
export * from "./sleep";
12 changes: 11 additions & 1 deletion src/web-eid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,15 @@ export async function sign(
};
}

export { Action, ErrorCode };
export {
Action,
ErrorCode
};
export type {
ActionOptions,
LibraryAuthenticateResponse,
LibraryGetSigningCertificateResponse,
LibrarySignResponse,
LibraryStatusResponse
};
export { config };
Loading