Skip to content

Commit

Permalink
chore(Setup): Improve setup
Browse files Browse the repository at this point in the history
  • Loading branch information
m-arrieta-r committed Apr 6, 2024
1 parent d5dce9e commit 28c217a
Show file tree
Hide file tree
Showing 5 changed files with 674 additions and 1,061 deletions.
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@facturacr/atv-sdk",
"version": "0.0.14-beta",
"version": "0.0.16-beta",
"description": "Librería (SDK) de Javascript/NodeJS para acceder al API de Administración Tributaria Virtual (ATV) del Ministerio de Hacienda.",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand All @@ -15,7 +15,6 @@
"dev": "dotenv -- nodemon -e ts,graphql -x 'yarn lint & ts-node -r tsconfig-paths/register src/index.ts'",
"build": "tsc",
"lint": "eslint --ext .ts, --ignore-path .gitignore .",
"publish": "yarn build & npm publish",
"test:createAndSend": "yarn ts-node -r tsconfig-paths/register --require dotenv/config examples/createAndSend.ts"
},
"repository": {
Expand All @@ -37,6 +36,7 @@
"@types/node": "^14.14.39",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@zerollup/ts-transform-paths": "^1.7.18",
"dotenv-cli": "^4.0.0",
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
Expand All @@ -50,9 +50,8 @@
"nodemon": "^2.0.19",
"ts-jest": "^29.1",
"ts-node": "10.9.1",
"tsc": "^1.20150623.0",
"tsconfig-paths": "^4.2.0",
"typescript": "^4.2.4"
"typescript": "^5.4.4"
},
"dependencies": {
"@peculiar/webcrypto": "^1.1.6",
Expand All @@ -65,5 +64,8 @@
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
},
"engines": {
"node": ">=18"
}
}
21 changes: 2 additions & 19 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
import confirmXML from '@src/confirmXML'
import { sendToCustomURL } from '@src/services/send/index'
import getToken from '@src/services/getToken'
import genJSON from '@src/lib/genJSON'
import eletronicBill from '@src/electronicBill'
import * as genClaveTools from '@src/lib/genClave'
import { ATV } from './ATV'
// import creditNote from '@src/creditNote'
// import debitNote from '@src/debitNote'

export {
ATV,
confirmXML,
sendToCustomURL,
getToken,
eletronicBill,
genJSON,
genClaveTools
}
export { ATV } from './ATV'
export { CreateDocumentInput } from './ATV/useCases/createDocument/types'
2 changes: 2 additions & 0 deletions src/lib/genXML/sigXML/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ export default async function signXML(xmlStr: string, p12: string, p12Password:
}
const crypto = new Crypto()
const referenceId = generateId(crypto)
//@ts-expect-error
Application.setEngine('OpenSSL', crypto)
const xadesXml = new SignedXml()
const algorithm = getAlgorithm()
//@ts-expect-error
const result = genKeysAndCert(crypto, {
algorithm,
keyStr: p12,
Expand Down
7 changes: 6 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"paths": {
"@src/*": ["src/*"],
"@test/*": ["__tests__/*"]
}
},
"plugins": [
{
"transform": "@zerollup/ts-transform-paths"
}
]
},
"include": ["./src/**/*", "__tests__/**/*", "__tests__/stubs", "examples"],
"exclude": ["node_modules/**/*"]
Expand Down
Loading

0 comments on commit 28c217a

Please sign in to comment.