mailgun.js 3.5.8 → 3.7.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 (71) hide show
  1. package/.eslintrc +27 -11
  2. package/CHANGELOG.md +35 -0
  3. package/README.md +138 -50
  4. package/commitlint.config.js +1 -2
  5. package/dist/index.d.ts +1 -1
  6. package/dist/lib/client.d.ts +1 -1
  7. package/dist/lib/events.d.ts +9 -25
  8. package/dist/lib/interfaces/APIErrorOptions.d.ts +2 -1
  9. package/dist/lib/interfaces/ApiResponse.d.ts +2 -1
  10. package/dist/lib/interfaces/Events.d.ts +24 -0
  11. package/dist/lib/interfaces/IpPools.d.ts +12 -0
  12. package/dist/lib/interfaces/Options.d.ts +2 -1
  13. package/dist/lib/interfaces/RequestOptions.d.ts +2 -1
  14. package/dist/lib/interfaces/StatsOptions.d.ts +2 -1
  15. package/dist/lib/interfaces/mailListMembers.d.ts +6 -6
  16. package/dist/lib/ip-pools.d.ts +11 -14
  17. package/dist/lib/ips.d.ts +6 -6
  18. package/dist/lib/messages.d.ts +1 -1
  19. package/dist/lib/suppressions.d.ts +1 -1
  20. package/dist/mailgun.node.js +3 -0
  21. package/dist/{mailgun.js.LICENSE.txt → mailgun.node.js.LICENSE.txt} +1 -1
  22. package/dist/mailgun.web.js +3 -0
  23. package/dist/mailgun.web.js.LICENSE.txt +7 -0
  24. package/examples/addresses.js +1 -0
  25. package/examples/list-domains.js +1 -0
  26. package/examples/send-email.js +1 -0
  27. package/index.ts +1 -1
  28. package/lib/client.ts +3 -2
  29. package/lib/events.ts +21 -19
  30. package/lib/interfaces/APIErrorOptions.ts +3 -1
  31. package/lib/interfaces/ApiResponse.ts +3 -1
  32. package/lib/interfaces/Events.ts +25 -0
  33. package/lib/interfaces/IFormData.ts +4 -3
  34. package/lib/interfaces/IpPools.ts +16 -1
  35. package/lib/interfaces/Ips.ts +1 -0
  36. package/lib/interfaces/Options.ts +5 -2
  37. package/lib/interfaces/RequestOptions.ts +4 -2
  38. package/lib/interfaces/StatsOptions.ts +4 -2
  39. package/lib/interfaces/Supressions.ts +1 -1
  40. package/lib/interfaces/lists.ts +1 -0
  41. package/lib/interfaces/mailListMembers.ts +18 -12
  42. package/lib/interfaces/routes.ts +1 -0
  43. package/lib/ip-pools.ts +8 -7
  44. package/lib/ips.ts +3 -3
  45. package/lib/lists.ts +1 -1
  46. package/lib/messages.ts +1 -1
  47. package/lib/parse.ts +4 -3
  48. package/lib/stats.ts +3 -2
  49. package/lib/suppressions.ts +16 -11
  50. package/lib/validate.ts +0 -1
  51. package/package.json +10 -10
  52. package/test/client.test.ts +7 -2
  53. package/test/events.test.ts +1 -2
  54. package/test/ips.test.ts +2 -1
  55. package/test/lists.test.ts +5 -7
  56. package/test/mailListMembers.test.ts +47 -43
  57. package/test/messageAttachment.test.ts +3 -4
  58. package/test/messages.test.ts +1 -1
  59. package/test/parse.test.ts +2 -2
  60. package/test/routes.test.ts +1 -0
  61. package/test/stats.test.ts +1 -1
  62. package/test/suppressions.test.ts +12 -10
  63. package/test/validate.test.ts +1 -1
  64. package/test/webhooks.test.ts +1 -2
  65. package/tsconfig.webpack.json +1 -1
  66. package/webpack/webpack.common.config.js +47 -0
  67. package/webpack/webpack.dev.config.js +18 -0
  68. package/webpack/webpack.release.config.js +37 -0
  69. package/dist/mailgun.js +0 -3
  70. package/webpack.config.js +0 -49
  71. package/webpack.release.config.js +0 -29
package/webpack.config.js DELETED
@@ -1,49 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- const webpack = require('webpack');
3
- const path = require('path');
4
-
5
- const pkg = require('./package.json');
6
-
7
- module.exports = () => {
8
- const outputDir = 'dist';
9
-
10
- return {
11
- mode: 'development',
12
- target: 'node',
13
- context: __dirname,
14
- entry: {
15
- mailgun: path.resolve(__dirname, './index.ts'),
16
- 'mailgun.min': path.resolve(__dirname, './index.ts')
17
- },
18
- output: {
19
- path: path.resolve('./', outputDir),
20
- filename: 'mailgun.js',
21
- library: 'mailgun',
22
- libraryTarget: 'umd',
23
- globalObject: 'this',
24
- },
25
- module: {
26
- rules: [
27
- {
28
- test: /\.(ts|js)?/,
29
- use: [
30
- {
31
- loader: 'babel-loader',
32
- },
33
- {
34
- loader: 'ts-loader?configFile=tsconfig.webpack.json',
35
- }
36
- ],
37
- exclude: /(node_modules|test)/
38
- }
39
- ]
40
- },
41
- plugins: [
42
- new webpack.BannerPlugin(`${pkg.name} v${pkg.version}`)
43
- ],
44
- resolve: {
45
- extensions: ['.ts', '.js', '.json']
46
- },
47
- devtool: 'inline-source-map'
48
- };
49
- };
@@ -1,29 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- const path = require('path');
3
- const { merge } = require('webpack-merge');
4
-
5
- const TerserPlugin = require('terser-webpack-plugin');
6
- const baseConfig = require('./webpack.config.js');
7
-
8
- module.exports = (env) => {
9
- const outputDir = 'dist';
10
-
11
- return merge(baseConfig(env), {
12
- mode: 'production',
13
- output: {
14
- path: path.resolve('./', outputDir),
15
- },
16
- devtool: undefined,
17
- optimization: {
18
- minimize: true,
19
- minimizer: [
20
- new TerserPlugin({
21
- parallel: true,
22
- terserOptions: {
23
- keep_classnames: true,
24
- }
25
- }),
26
- ],
27
- },
28
- });
29
- };