czech-data-box 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +277 -48
  3. package/dist/index.d.ts +5 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +4 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/lib/ISDSBox.d.ts +96 -0
  8. package/dist/lib/ISDSBox.d.ts.map +1 -0
  9. package/dist/lib/ISDSBox.js +662 -0
  10. package/dist/lib/ISDSBox.js.map +1 -0
  11. package/dist/lib/ISDSSentOutFiles.d.ts +14 -0
  12. package/dist/lib/ISDSSentOutFiles.d.ts.map +1 -0
  13. package/dist/lib/ISDSSentOutFiles.js +44 -0
  14. package/dist/lib/ISDSSentOutFiles.js.map +1 -0
  15. package/dist/lib/ISDSSoapClient.d.ts +25 -0
  16. package/dist/lib/ISDSSoapClient.d.ts.map +1 -0
  17. package/dist/lib/ISDSSoapClient.js +178 -0
  18. package/dist/lib/ISDSSoapClient.js.map +1 -0
  19. package/dist/lib/config.d.ts +7 -0
  20. package/dist/lib/config.d.ts.map +1 -0
  21. package/dist/lib/config.js +94 -0
  22. package/dist/lib/config.js.map +1 -0
  23. package/dist/models/DataBox.d.ts +34 -0
  24. package/dist/models/DataBox.d.ts.map +1 -0
  25. package/dist/models/DataBox.js +92 -0
  26. package/dist/models/DataBox.js.map +1 -0
  27. package/dist/models/DataMessage.d.ts +29 -0
  28. package/dist/models/DataMessage.d.ts.map +1 -0
  29. package/dist/models/DataMessage.js +96 -0
  30. package/dist/models/DataMessage.js.map +1 -0
  31. package/dist/models/DataMessageFile.d.ts +22 -0
  32. package/dist/models/DataMessageFile.d.ts.map +1 -0
  33. package/dist/models/DataMessageFile.js +54 -0
  34. package/dist/models/DataMessageFile.js.map +1 -0
  35. package/dist/models/DataMessageFiles.d.ts +9 -0
  36. package/dist/models/DataMessageFiles.d.ts.map +1 -0
  37. package/dist/models/DataMessageFiles.js +17 -0
  38. package/dist/models/DataMessageFiles.js.map +1 -0
  39. package/dist/types.d.ts +420 -0
  40. package/dist/types.d.ts.map +1 -0
  41. package/dist/types.js +2 -0
  42. package/dist/types.js.map +1 -0
  43. package/package.json +66 -40
  44. package/resources/wsdl/ChangePassword.wsdl +83 -83
  45. package/resources/wsdl/ChangePasswordTypes.xsd +68 -68
  46. package/resources/wsdl/dbTypes.xsd +1712 -1688
  47. package/resources/wsdl/db_access.wsdl +199 -197
  48. package/resources/wsdl/db_manipulations.wsdl +600 -598
  49. package/resources/wsdl/db_search.wsdl +389 -362
  50. package/resources/wsdl/dmBaseTypes.xsd +1563 -1497
  51. package/resources/wsdl/dm_VoDZ.wsdl +215 -212
  52. package/resources/wsdl/dm_arch.wsdl +77 -0
  53. package/resources/wsdl/dm_info.wsdl +462 -412
  54. package/resources/wsdl/dm_operations.wsdl +252 -242
  55. package/.gitattributes +0 -16
  56. package/.github/workflows/tests.yml +0 -39
  57. package/.nvmrc +0 -1
  58. package/.prettierignore +0 -1
  59. package/.prettierrc.yaml +0 -6
  60. package/.vscode/launch.json +0 -15
  61. package/.vscode/settings.json +0 -5
  62. package/CHANGELOG.md +0 -17
  63. package/CODE_OF_CONDUCT.md +0 -128
  64. package/CONTRIBUTING.md +0 -84
  65. package/eslint.config.js +0 -26
  66. package/examples/db_login_with_certificate.js +0 -27
  67. package/examples/db_search.js +0 -27
  68. package/examples/dm_operations.js +0 -58
  69. package/src/index.js +0 -5
  70. package/src/lib/ISDSBox.js +0 -309
  71. package/src/lib/ISDSSentOutFiles.js +0 -84
  72. package/src/lib/ISDSSoapClient.js +0 -201
  73. package/src/lib/config.js +0 -71
  74. package/src/models/DataBox.js +0 -194
  75. package/src/models/DataMessage.js +0 -153
  76. package/src/models/DataMessageFile.js +0 -69
  77. package/src/models/DataMessageFiles.js +0 -23
  78. package/test/ISDSBox.test.js +0 -129
  79. package/test/ISDSSentOutFiles.test.js +0 -124
  80. package/test/ISDSSoapClient.test.js +0 -81
  81. package/test/communication_test.pdf +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,57 +1,83 @@
1
1
  {
2
2
  "name": "czech-data-box",
3
- "version": "0.1.2",
4
- "main": "src/index.js",
3
+ "version": "0.2.0",
4
+ "description": "TypeScript-first Node.js client for Czech Data Boxes (ISDS).",
5
+ "license": "MIT",
6
+ "author": "Martin Křivda",
5
7
  "type": "module",
6
- "engines": {
7
- "node": ">=18.0.0"
8
- },
9
- "scripts": {
10
- "lint": "eslint .",
11
- "lint:fix": "eslint . --fix",
12
- "test": "mocha"
8
+ "private": false,
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ },
16
+ "./package.json": "./package.json"
13
17
  },
14
- "keywords": [
15
- "ISDS",
16
- "Czech",
17
- "Data Box",
18
- "SOAP",
19
- "Node.js",
20
- "library",
21
- "knihovna",
22
- "Datové schránky"
18
+ "files": [
19
+ "dist",
20
+ "resources",
21
+ "LICENSE",
22
+ "README.md"
23
23
  ],
24
- "author": "Martin Křivda",
25
- "license": "MIT",
26
- "description": "A Node.js module for interacting with the Czech Data Box system (ISDS).",
24
+ "sideEffects": false,
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
27
28
  "repository": {
28
29
  "type": "git",
29
- "url": "git+https://github.com/martinkrivda/czech-data-box.git"
30
+ "url": "https://github.com/martinkrivda/czech-data-box"
30
31
  },
31
32
  "bugs": {
32
33
  "url": "https://github.com/martinkrivda/czech-data-box/issues"
33
34
  },
34
35
  "homepage": "https://github.com/martinkrivda/czech-data-box",
35
- "directories": {
36
- "lib": "./src/lib",
37
- "test": "./test"
36
+ "engines": {
37
+ "node": ">=22.20.0 <25",
38
+ "pnpm": ">=10.33.0 <11"
38
39
  },
40
+ "keywords": [
41
+ "isds",
42
+ "czech-data-box",
43
+ "datove-schranky",
44
+ "soap",
45
+ "typescript",
46
+ "nodejs",
47
+ "node-library"
48
+ ],
39
49
  "dependencies": {
40
- "node-forge": "^1.3.1",
41
- "soap": "^1.0.3"
50
+ "node-forge": "^1.4.0",
51
+ "soap": "^1.8.0"
42
52
  },
43
53
  "devDependencies": {
44
- "@eslint/js": "^9.4.0",
45
- "@types/eslint__js": "^8.42.3",
46
- "@types/eslint-plugin-mocha": "^10.4.0",
47
- "@types/node-forge": "^1.3.11",
48
- "@types/sinon": "^17.0.3",
49
- "chai": "^5.1.1",
50
- "eslint": "^9.4.0",
51
- "eslint-plugin-mocha": "^10.4.3",
52
- "globals": "^15.3.0",
53
- "mocha": "^10.4.0",
54
- "prettier": "^3.2.5",
55
- "sinon": "^18.0.0"
54
+ "@changesets/cli": "^2.30.0",
55
+ "@eslint/js": "^10.0.1",
56
+ "@types/node": "^25.6.0",
57
+ "@types/node-forge": "^1.3.14",
58
+ "eslint": "^10.2.0",
59
+ "eslint-config-prettier": "^10.1.8",
60
+ "globals": "^17.5.0",
61
+ "husky": "^9.1.7",
62
+ "prettier": "^3.8.2",
63
+ "rimraf": "^6.1.3",
64
+ "typescript": "^6.0.2",
65
+ "typescript-eslint": "^8.58.1",
66
+ "vitest": "^4.1.4"
67
+ },
68
+ "scripts": {
69
+ "build": "tsc -p tsconfig.build.json",
70
+ "changeset": "changeset",
71
+ "clean": "rimraf coverage dist .tmp",
72
+ "format": "prettier --check .",
73
+ "format:write": "prettier --write .",
74
+ "lint": "eslint .",
75
+ "release": "changeset publish",
76
+ "test": "vitest run",
77
+ "test:package": "pnpm build && pnpm pack --pack-destination .tmp/pack",
78
+ "test:watch": "vitest",
79
+ "typecheck": "tsc --noEmit -p tsconfig.json",
80
+ "verify": "pnpm lint && pnpm typecheck && pnpm test && pnpm build",
81
+ "version-packages": "changeset version"
56
82
  }
57
- }
83
+ }
@@ -1,84 +1,84 @@
1
- <?xml version="1.0" encoding="UTF-8" ?>
2
- <!-- *********************************************************************
3
- WSDL pro služby související s OTP přihlašováním
4
-
5
- verze: 2.31
6
- klasifikace: Veřejný dokument
7
-
8
- Seznam služeb:
9
- ==============
10
- ChangePasswordOTP
11
- SendSMSCode
12
-
13
- změny:
14
- 15.9.2011 verze 1.0
15
- 21.11.2017 verze 2.27 - sjednocení verzí
16
- 5.9.2018 verze 2.31 - sjednocení verzí
17
- ************************************************************************ -->
18
-
19
- <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
20
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
21
- xmlns:tns="http://isds.czechpoint.cz/v20/asws"
22
- targetNamespace="http://isds.czechpoint.cz/v20/asws">
23
- <types>
24
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://isds.czechpoint.cz/v20/asws">
25
- <xsd:include schemaLocation="ChangePasswordTypes.xsd"/>
26
- </xsd:schema>
27
- </types>
28
- <message name="SendSMSCodeRequest">
29
- <part element="tns:SendSMSCode" name="SendSMSCode">
30
- </part>
31
- </message>
32
- <message name="SendSMSCodeResponse">
33
- <part element="tns:SendSMSCodeResponse" name="SendSMSCodeResponse">
34
- </part>
35
- </message>
36
- <message name="ChangePasswordOTPRequest">
37
- <part element="tns:ChangePasswordOTP" name="ChangePasswordOTP">
38
- </part>
39
- </message>
40
- <message name="ChangePasswordOTPResponse">
41
- <part element="tns:ChangePasswordOTPResponse" name="ChangePasswordOTPResponse">
42
- </part>
43
- </message>
44
- <portType name="ChangePassword">
45
- <operation name="SendSMSCode">
46
- <input message="tns:SendSMSCodeRequest" name="SendSMSCodeRequest">
47
- </input>
48
- <output message="tns:SendSMSCodeResponse" name="SendSMSCodeResponse">
49
- </output>
50
- </operation>
51
- <operation name="ChangePasswordOTP">
52
- <input message="tns:ChangePasswordOTPRequest" name="ChangePasswordOTPRequest">
53
- </input>
54
- <output message="tns:ChangePasswordOTPResponse" name="ChangePasswordOTPResponse">
55
- </output>
56
- </operation>
57
- </portType>
58
- <binding name="ChangePasswordSoap11" type="tns:ChangePassword">
59
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
60
- <operation name="SendSMSCode">
61
- <soap:operation soapAction=""/>
62
- <input name="SendSMSCodeRequest">
63
- <soap:body use="literal"/>
64
- </input>
65
- <output name="SendSMSCodeResponse">
66
- <soap:body use="literal"/>
67
- </output>
68
- </operation>
69
- <operation name="ChangePasswordOTP">
70
- <soap:operation soapAction=""/>
71
- <input name="ChangePasswordOTPRequest">
72
- <soap:body use="literal"/>
73
- </input>
74
- <output name="ChangePasswordOTPResponse">
75
- <soap:body use="literal"/>
76
- </output>
77
- </operation>
78
- </binding>
79
- <service name="ChangePasswordService">
80
- <port binding="tns:ChangePasswordSoap11" name="ChangePasswordSoap11">
81
- <soap:address location="https://www.mojedatovaschranka.cz/asws/changePassword"/>
82
- </port>
83
- </service>
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <!-- *********************************************************************
3
+ WSDL pro služby související s OTP přihlašováním
4
+
5
+ verze: 2.31
6
+ klasifikace: Veřejný dokument
7
+
8
+ Seznam služeb:
9
+ ==============
10
+ ChangePasswordOTP
11
+ SendSMSCode
12
+
13
+ změny:
14
+ 15.9.2011 verze 1.0
15
+ 21.11.2017 verze 2.27 - sjednocení verzí
16
+ 5.9.2018 verze 2.31 - sjednocení verzí
17
+ ************************************************************************ -->
18
+
19
+ <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
20
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
21
+ xmlns:tns="http://isds.czechpoint.cz/v20/asws"
22
+ targetNamespace="http://isds.czechpoint.cz/v20/asws">
23
+ <types>
24
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://isds.czechpoint.cz/v20/asws">
25
+ <xsd:include schemaLocation="ChangePasswordTypes.xsd"/>
26
+ </xsd:schema>
27
+ </types>
28
+ <message name="SendSMSCodeRequest">
29
+ <part element="tns:SendSMSCode" name="SendSMSCode">
30
+ </part>
31
+ </message>
32
+ <message name="SendSMSCodeResponse">
33
+ <part element="tns:SendSMSCodeResponse" name="SendSMSCodeResponse">
34
+ </part>
35
+ </message>
36
+ <message name="ChangePasswordOTPRequest">
37
+ <part element="tns:ChangePasswordOTP" name="ChangePasswordOTP">
38
+ </part>
39
+ </message>
40
+ <message name="ChangePasswordOTPResponse">
41
+ <part element="tns:ChangePasswordOTPResponse" name="ChangePasswordOTPResponse">
42
+ </part>
43
+ </message>
44
+ <portType name="ChangePassword">
45
+ <operation name="SendSMSCode">
46
+ <input message="tns:SendSMSCodeRequest" name="SendSMSCodeRequest">
47
+ </input>
48
+ <output message="tns:SendSMSCodeResponse" name="SendSMSCodeResponse">
49
+ </output>
50
+ </operation>
51
+ <operation name="ChangePasswordOTP">
52
+ <input message="tns:ChangePasswordOTPRequest" name="ChangePasswordOTPRequest">
53
+ </input>
54
+ <output message="tns:ChangePasswordOTPResponse" name="ChangePasswordOTPResponse">
55
+ </output>
56
+ </operation>
57
+ </portType>
58
+ <binding name="ChangePasswordSoap11" type="tns:ChangePassword">
59
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
60
+ <operation name="SendSMSCode">
61
+ <soap:operation soapAction=""/>
62
+ <input name="SendSMSCodeRequest">
63
+ <soap:body use="literal"/>
64
+ </input>
65
+ <output name="SendSMSCodeResponse">
66
+ <soap:body use="literal"/>
67
+ </output>
68
+ </operation>
69
+ <operation name="ChangePasswordOTP">
70
+ <soap:operation soapAction=""/>
71
+ <input name="ChangePasswordOTPRequest">
72
+ <soap:body use="literal"/>
73
+ </input>
74
+ <output name="ChangePasswordOTPResponse">
75
+ <soap:body use="literal"/>
76
+ </output>
77
+ </operation>
78
+ </binding>
79
+ <service name="ChangePasswordService">
80
+ <port binding="tns:ChangePasswordSoap11" name="ChangePasswordSoap11">
81
+ <soap:address location="https://www.mojedatovaschranka.cz/asws/changePassword"/>
82
+ </port>
83
+ </service>
84
84
  </definitions>
@@ -1,69 +1,69 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!-- ************************************************************************
3
- XSD schema typů použitých v ChangePasswordOTP.wsdl
4
-
5
- verze: 2.31
6
- klasifikace: Veřejný dokument
7
-
8
- změny:
9
- 15.9.2011 verze 1.0
10
- 21.11.2017 verze 2.27 - sjednocení verzí
11
- 5.9.2018 verze 2.31 - sjednocení verzí
12
- **************************************************************************** -->
13
-
14
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:v1="http://isds.czechpoint.cz/v20/asws" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://isds.czechpoint.cz/v20/asws">
15
- <xs:element name="ChangePasswordOTP" type="v1:tChngPasswInputOTP"/>
16
- <xs:complexType name="tChngPasswInputOTP">
17
- <xs:sequence>
18
- <xs:element maxOccurs="1" minOccurs="1" name="dbOldPassword" type="xs:string">
19
- <xs:annotation>
20
- <xs:documentation>původní heslo</xs:documentation>
21
- </xs:annotation>
22
- </xs:element>
23
- <xs:element maxOccurs="1" minOccurs="1" name="dbNewPassword" type="xs:string">
24
- <xs:annotation>
25
- <xs:documentation>nové heslo</xs:documentation>
26
- </xs:annotation>
27
- </xs:element>
28
- <xs:element maxOccurs="1" minOccurs="1" name="dbOTPType" type="v1:tAuthType">
29
- <xs:annotation>
30
- <xs:documentation>typ přihlášení</xs:documentation>
31
- </xs:annotation>
32
- </xs:element>
33
- </xs:sequence>
34
- </xs:complexType>
35
- <xs:simpleType name="tAuthType">
36
- <xs:restriction base="xs:string">
37
- <xs:enumeration value="TOTP"/>
38
- <xs:enumeration value="HOTP"/>
39
- </xs:restriction>
40
- </xs:simpleType>
41
- <xs:element name="ChangePasswordOTPResponse" type="v1:tReqStatusOutput"/>
42
- <xs:complexType name="tReqStatusOutput">
43
- <xs:sequence>
44
- <xs:element name="dbStatus" type="v1:tDbReqStatus"/>
45
- </xs:sequence>
46
- </xs:complexType>
47
- <xs:complexType name="tDbReqStatus">
48
- <xs:annotation>
49
- <xs:documentation>návratový typ WS</xs:documentation>
50
- </xs:annotation>
51
- <xs:group ref="v1:gDbReqStatus"/>
52
- </xs:complexType>
53
- <xs:group name="gDbReqStatus">
54
- <xs:sequence>
55
- <xs:element name="dbStatusCode" type="xs:string"/>
56
- <xs:element name="dbStatusMessage" type="xs:string"/>
57
- <xs:element maxOccurs="1" minOccurs="0" name="dbStatusRefNumber" nillable="true" type="xs:string">
58
- <xs:annotation>
59
- <xs:documentation>nepovinné referenční číslo žádosti</xs:documentation>
60
- </xs:annotation>
61
- </xs:element>
62
- </xs:sequence>
63
- </xs:group>
64
- <xs:element name="SendSMSCode" type="v1:tSendSMSCode"/>
65
- <xs:complexType name="tSendSMSCode">
66
- </xs:complexType>
67
- <xs:element name="SendSMSCodeResponse" type="v1:tReqStatusOutput"/>
68
-
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- ************************************************************************
3
+ XSD schema typů použitých v ChangePasswordOTP.wsdl
4
+
5
+ verze: 2.31
6
+ klasifikace: Veřejný dokument
7
+
8
+ změny:
9
+ 15.9.2011 verze 1.0
10
+ 21.11.2017 verze 2.27 - sjednocení verzí
11
+ 5.9.2018 verze 2.31 - sjednocení verzí
12
+ **************************************************************************** -->
13
+
14
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:v1="http://isds.czechpoint.cz/v20/asws" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://isds.czechpoint.cz/v20/asws">
15
+ <xs:element name="ChangePasswordOTP" type="v1:tChngPasswInputOTP"/>
16
+ <xs:complexType name="tChngPasswInputOTP">
17
+ <xs:sequence>
18
+ <xs:element maxOccurs="1" minOccurs="1" name="dbOldPassword" type="xs:string">
19
+ <xs:annotation>
20
+ <xs:documentation>původní heslo</xs:documentation>
21
+ </xs:annotation>
22
+ </xs:element>
23
+ <xs:element maxOccurs="1" minOccurs="1" name="dbNewPassword" type="xs:string">
24
+ <xs:annotation>
25
+ <xs:documentation>nové heslo</xs:documentation>
26
+ </xs:annotation>
27
+ </xs:element>
28
+ <xs:element maxOccurs="1" minOccurs="1" name="dbOTPType" type="v1:tAuthType">
29
+ <xs:annotation>
30
+ <xs:documentation>typ přihlášení</xs:documentation>
31
+ </xs:annotation>
32
+ </xs:element>
33
+ </xs:sequence>
34
+ </xs:complexType>
35
+ <xs:simpleType name="tAuthType">
36
+ <xs:restriction base="xs:string">
37
+ <xs:enumeration value="TOTP"/>
38
+ <xs:enumeration value="HOTP"/>
39
+ </xs:restriction>
40
+ </xs:simpleType>
41
+ <xs:element name="ChangePasswordOTPResponse" type="v1:tReqStatusOutput"/>
42
+ <xs:complexType name="tReqStatusOutput">
43
+ <xs:sequence>
44
+ <xs:element name="dbStatus" type="v1:tDbReqStatus"/>
45
+ </xs:sequence>
46
+ </xs:complexType>
47
+ <xs:complexType name="tDbReqStatus">
48
+ <xs:annotation>
49
+ <xs:documentation>návratový typ WS</xs:documentation>
50
+ </xs:annotation>
51
+ <xs:group ref="v1:gDbReqStatus"/>
52
+ </xs:complexType>
53
+ <xs:group name="gDbReqStatus">
54
+ <xs:sequence>
55
+ <xs:element name="dbStatusCode" type="xs:string"/>
56
+ <xs:element name="dbStatusMessage" type="xs:string"/>
57
+ <xs:element maxOccurs="1" minOccurs="0" name="dbStatusRefNumber" nillable="true" type="xs:string">
58
+ <xs:annotation>
59
+ <xs:documentation>nepovinné referenční číslo žádosti</xs:documentation>
60
+ </xs:annotation>
61
+ </xs:element>
62
+ </xs:sequence>
63
+ </xs:group>
64
+ <xs:element name="SendSMSCode" type="v1:tSendSMSCode"/>
65
+ <xs:complexType name="tSendSMSCode">
66
+ </xs:complexType>
67
+ <xs:element name="SendSMSCodeResponse" type="v1:tReqStatusOutput"/>
68
+
69
69
  </xs:schema>