@opengovsg/formsg-sdk 0.9.0 → 0.10.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,120 @@
1
+ ### Changelog
2
+
3
+ All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4
+
5
+ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
+
7
+ #### [v0.10.0](https://github.com/opengovsg/formsg-javascript-sdk/compare/v0.9.0...v0.10.0)
8
+
9
+ > 16 December 2022
10
+
11
+ - fix: allow empty field titles in decrypted responses [`#86`](https://github.com/opengovsg/formsg-javascript-sdk/pull/86)
12
+ - chore: run npm audit fix and update relevant deps [`#80`](https://github.com/opengovsg/formsg-javascript-sdk/pull/80)
13
+ - chore(deps): Upgrade vulnerable axios version [`#78`](https://github.com/opengovsg/formsg-javascript-sdk/pull/78)
14
+ - chore: merge v0.9.0 into develop [`#76`](https://github.com/opengovsg/formsg-javascript-sdk/pull/76)
15
+ - fix: run npm audit fix so typescript packages are the correct versions [`2bdbf89`](https://github.com/opengovsg/formsg-javascript-sdk/commit/2bdbf897614833cc50605554ddaa82ea567b8a09)
16
+ - chore: bump version to v0.10.0 [`e094041`](https://github.com/opengovsg/formsg-javascript-sdk/commit/e0940414e529012afc03c54165f82e9f5ce16b12)
17
+
18
+ #### [v0.9.0](https://github.com/opengovsg/formsg-javascript-sdk/compare/v0.8.2...v0.9.0)
19
+
20
+ > 16 December 2022
21
+
22
+ - build: add separate keypairs for dev environment [`#73`](https://github.com/opengovsg/formsg-javascript-sdk/pull/73)
23
+ - docs: specify version for attachment functionality [`#72`](https://github.com/opengovsg/formsg-javascript-sdk/pull/72)
24
+ - build(ci): migrate to GitHub Actions [`#70`](https://github.com/opengovsg/formsg-javascript-sdk/pull/70)
25
+ - refactor(crypto): minor refactor of decryptWithAttachments [`#69`](https://github.com/opengovsg/formsg-javascript-sdk/pull/69)
26
+ - feat: Adding eslint functionality for the repository [`#66`](https://github.com/opengovsg/formsg-javascript-sdk/pull/66)
27
+ - build(deps): bump lodash from 4.17.19 to 4.17.21 [`#64`](https://github.com/opengovsg/formsg-javascript-sdk/pull/64)
28
+ - add downloadAndDecryptAttachments for downloading and decrypting attachments [`#62`](https://github.com/opengovsg/formsg-javascript-sdk/pull/62)
29
+ - build(deps): bump y18n from 4.0.0 to 4.0.1 [`#59`](https://github.com/opengovsg/formsg-javascript-sdk/pull/59)
30
+ - Update README.md [`#61`](https://github.com/opengovsg/formsg-javascript-sdk/pull/61)
31
+ - build: merge Release 0.8.4 back to develop branch [`#58`](https://github.com/opengovsg/formsg-javascript-sdk/pull/58)
32
+ - build: release v0.8.4-beta.0 [`#56`](https://github.com/opengovsg/formsg-javascript-sdk/pull/56)
33
+ - Revert "build(npm): update repo entry (#43)" [`#55`](https://github.com/opengovsg/formsg-javascript-sdk/pull/55)
34
+ - fix: update .npmignore to ignore misc unneeded files [`#54`](https://github.com/opengovsg/formsg-javascript-sdk/pull/54)
35
+ - ref: use mode init parameter again [`#52`](https://github.com/opengovsg/formsg-javascript-sdk/pull/52)
36
+ - chore: Update JSDoc and print warning message if deprecated mode parameter is used [`#51`](https://github.com/opengovsg/formsg-javascript-sdk/pull/51)
37
+ - fix(FormField): account for table responses [`#44`](https://github.com/opengovsg/formsg-javascript-sdk/pull/44)
38
+ - build(npm): update repo entry [`#43`](https://github.com/opengovsg/formsg-javascript-sdk/pull/43)
39
+ - feat: add more webhook tests to check for undefined params [`#41`](https://github.com/opengovsg/formsg-javascript-sdk/pull/41)
40
+ - Bump lodash from 4.17.15 to 4.17.19 [`#42`](https://github.com/opengovsg/formsg-javascript-sdk/pull/42)
41
+ - fix: JSON body parser required for demo code to work [`#40`](https://github.com/opengovsg/formsg-javascript-sdk/pull/40)
42
+ - refactor: update verification HOF to Verification class [`#38`](https://github.com/opengovsg/formsg-javascript-sdk/pull/38)
43
+ - refactor: update crypto HOF to Crypto class [`#36`](https://github.com/opengovsg/formsg-javascript-sdk/pull/36)
44
+ - refactor: update webhooks HOF to Webhooks class [`#34`](https://github.com/opengovsg/formsg-javascript-sdk/pull/34)
45
+ - docs: fix code snippet typos [`#37`](https://github.com/opengovsg/formsg-javascript-sdk/pull/37)
46
+ - feat: add publicKey param to package initialization parameters [`#33`](https://github.com/opengovsg/formsg-javascript-sdk/pull/33)
47
+ - chore: add `test-ci` script for Travis to run instead of `test` [`#32`](https://github.com/opengovsg/formsg-javascript-sdk/pull/32)
48
+ - Release 0.8.3 - Allow tolerance for clock drift when authenticating webhooks [`#47`](https://github.com/opengovsg/formsg-javascript-sdk/pull/47)
49
+ - fix(epoch): allow for possible clock drift [`a3ce917`](https://github.com/opengovsg/formsg-javascript-sdk/commit/a3ce917c6c38a387edcfad06ae5176b1f92b0a46)
50
+ - fix(epoch): allow for possible clock drift [`5ba253d`](https://github.com/opengovsg/formsg-javascript-sdk/commit/5ba253d61d04d3082f4d752ecfc9efd3639acc0f)
51
+ - chore: bump version to 0.9.0 [`32111b1`](https://github.com/opengovsg/formsg-javascript-sdk/commit/32111b1a2c85955a33d478dbc06966dda7261e33)
52
+
53
+ #### [v0.8.2](https://github.com/opengovsg/formsg-javascript-sdk/compare/v0.4.1...v0.8.2)
54
+
55
+ > 4 June 2020
56
+
57
+ - Release v0.8.2 - Patch for encrypting non-UTF8 characters [`#35`](https://github.com/opengovsg/formsg-javascript-sdk/pull/35)
58
+ - Release v0.8.1 - Export types [`#29`](https://github.com/opengovsg/formsg-javascript-sdk/pull/29)
59
+ - Fix: Export declared types in the package [`#28`](https://github.com/opengovsg/formsg-javascript-sdk/pull/28)
60
+ - Replace tweetnacl-util with StableLib [`#27`](https://github.com/opengovsg/formsg-javascript-sdk/pull/27)
61
+ - v0.8.0 - Update decrypt signature [`#25`](https://github.com/opengovsg/formsg-javascript-sdk/pull/25)
62
+ - Test and build coverage badges with TravsiCI and Coveralls.io [`#23`](https://github.com/opengovsg/formsg-javascript-sdk/pull/23)
63
+ - chore: update README for increased clarity on decrypt [`#22`](https://github.com/opengovsg/formsg-javascript-sdk/pull/22)
64
+ - v0.7.0 - Verification module for SDK [`#19`](https://github.com/opengovsg/formsg-javascript-sdk/pull/19)
65
+ - fix: use req.get() in README sample code [`#21`](https://github.com/opengovsg/formsg-javascript-sdk/pull/21)
66
+ - Enforce minimum level of test coverage [`#20`](https://github.com/opengovsg/formsg-javascript-sdk/pull/20)
67
+ - Update encrypt/decryptFile function signature from blob to UInt8Array [`#18`](https://github.com/opengovsg/formsg-javascript-sdk/pull/18)
68
+ - Utility functions for attachments [`#17`](https://github.com/opengovsg/formsg-javascript-sdk/pull/17)
69
+ - Replace Joi with custom validation [`#16`](https://github.com/opengovsg/formsg-javascript-sdk/pull/16)
70
+ - Link GitHub to package.json [`#15`](https://github.com/opengovsg/formsg-javascript-sdk/pull/15)
71
+ - Fix broken links in readme [`#14`](https://github.com/opengovsg/formsg-javascript-sdk/pull/14)
72
+ - Extend crypto module for verified fields and migrate to TypeScript [`#12`](https://github.com/opengovsg/formsg-javascript-sdk/pull/12)
73
+ - Patch readme sample code [`#11`](https://github.com/opengovsg/formsg-javascript-sdk/pull/11)
74
+
75
+ #### [v0.4.1](https://github.com/opengovsg/formsg-javascript-sdk/compare/v0.4.0...v0.4.1)
76
+
77
+ > 30 March 2020
78
+
79
+ - Release v0.4.1 - Remove dangling reference to source in require [`#10`](https://github.com/opengovsg/formsg-javascript-sdk/pull/10)
80
+
81
+ #### [v0.4.0](https://github.com/opengovsg/formsg-javascript-sdk/compare/v0.3.2...v0.4.0)
82
+
83
+ > 30 March 2020
84
+
85
+ - Pre-publish transpile pipeline with Babel [`#9`](https://github.com/opengovsg/formsg-javascript-sdk/pull/9)
86
+
87
+ #### [v0.3.2](https://github.com/opengovsg/formsg-javascript-sdk/compare/v0.3.1...v0.3.2)
88
+
89
+ > 30 March 2020
90
+
91
+ - Avoid default arguments in destructuring [`#8`](https://github.com/opengovsg/formsg-javascript-sdk/pull/8)
92
+
93
+ #### [v0.3.1](https://github.com/opengovsg/formsg-javascript-sdk/compare/v0.3.0...v0.3.1)
94
+
95
+ > 30 March 2020
96
+
97
+ - Destructure options in the function body [`#7`](https://github.com/opengovsg/formsg-javascript-sdk/pull/7)
98
+
99
+ #### [v0.3.0](https://github.com/opengovsg/formsg-javascript-sdk/compare/v0.2.0...v0.3.0)
100
+
101
+ > 24 March 2020
102
+
103
+ - Release 0.3.0 [`#5`](https://github.com/opengovsg/formsg-javascript-sdk/pull/5)
104
+ - Add cryptographic functions to SDK [`#4`](https://github.com/opengovsg/formsg-javascript-sdk/pull/4)
105
+ - Update readme to clarify that this repository is the SDK and not the FormSG system. [`#3`](https://github.com/opengovsg/formsg-javascript-sdk/pull/3)
106
+
107
+ #### [v0.2.0](https://github.com/opengovsg/formsg-javascript-sdk/compare/v0.1.1...v0.2.0)
108
+
109
+ > 2 March 2020
110
+
111
+ - Version 0.2.0 - Add signing functions, end-to-end testing [`#2`](https://github.com/opengovsg/formsg-javascript-sdk/pull/2)
112
+
113
+ #### v0.1.1
114
+
115
+ > 2 March 2020
116
+
117
+ - Version 0.1.1 - Readme, configuration bugfix [`#1`](https://github.com/opengovsg/formsg-javascript-sdk/pull/1)
118
+ - Add signature authentication [`a23a6ff`](https://github.com/opengovsg/formsg-javascript-sdk/commit/a23a6ffee1aaa65f805207b3f7ed17ed05590010)
119
+ - gitignore [`1b288fa`](https://github.com/opengovsg/formsg-javascript-sdk/commit/1b288fa9cff6df70efb09bf477570159516605e1)
120
+ - install dependencies [`d8fc078`](https://github.com/opengovsg/formsg-javascript-sdk/commit/d8fc078b29ffb0043adbb105fe4a39abed5a8cf9)
@@ -14,7 +14,9 @@ function determineIsFormFields(tbd) {
14
14
  internal.isHeader) &&
15
15
  internal._id &&
16
16
  internal.fieldType &&
17
- internal.question;
17
+ // The field is still valid even when the question title is empty string
18
+ // (even though it is not intended behavior).
19
+ typeof internal.question === 'string';
18
20
  });
19
21
  return filter.length === tbd.length;
20
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengovsg/formsg-sdk",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/opengovsg/formsg-javascript-sdk.git"
@@ -13,7 +13,8 @@
13
13
  "test-ci": "jest --coverage",
14
14
  "test-watch": "jest --watch",
15
15
  "build": "tsc",
16
- "prepare": "npm run build"
16
+ "prepare": "npm run build",
17
+ "version": "auto-changelog -p && git add CHANGELOG.md"
17
18
  },
18
19
  "keywords": [
19
20
  "formsg",
@@ -23,7 +24,7 @@
23
24
  "author": "Open Government Products (FormSG)",
24
25
  "license": "MIT",
25
26
  "dependencies": {
26
- "axios": "^0.21.1",
27
+ "axios": "^0.24.0",
27
28
  "tweetnacl": "^1.0.3",
28
29
  "tweetnacl-util": "^0.15.1"
29
30
  },
@@ -31,19 +32,20 @@
31
32
  "@babel/cli": "^7.8.4",
32
33
  "@babel/core": "^7.9.0",
33
34
  "@babel/preset-env": "^7.9.0",
34
- "@types/jest": "^25.2.1",
35
+ "@types/jest": "^27.0.3",
35
36
  "@types/node": "^13.11.1",
36
37
  "@typescript-eslint/eslint-plugin": "^4.25.0",
37
- "coveralls": "^3.1.0",
38
+ "auto-changelog": "^2.4.0",
39
+ "coveralls": "^3.1.1",
38
40
  "eslint-config-prettier": "^8.3.0",
39
41
  "eslint-plugin-import": "^2.23.3",
40
42
  "eslint-plugin-jest": "^24.3.6",
41
43
  "eslint-plugin-prettier": "^3.4.0",
42
44
  "eslint-plugin-simple-import-sort": "^7.0.0",
43
45
  "eslint-plugin-typesafe": "^0.5.2",
44
- "jest": "^25.3.0",
46
+ "jest": "^27.3.1",
45
47
  "jest-mock-axios": "^4.4.0",
46
- "ts-jest": "^25.3.1",
48
+ "ts-jest": "^27.0.7",
47
49
  "typescript": "^3.8.3"
48
50
  }
49
51
  }