mailisk 2.1.1 → 2.2.1
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/README.md +63 -11
- package/dist/index.d.ts +122 -9
- package/dist/index.js +33 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/private/dist/private/index.js +28 -0
- package/private/dist/private/index.js.map +1 -0
- package/private/dist/src/mailisk.interfaces.js +3 -0
- package/private/dist/src/mailisk.interfaces.js.map +1 -0
- package/private/dist/src/mailisk.js +168 -0
- package/private/dist/src/mailisk.js.map +1 -0
- package/private/index.ts +17 -0
- package/private/node_modules/.package-lock.json +44 -0
- package/private/node_modules/typescript/LICENSE.txt +55 -0
- package/private/node_modules/typescript/README.md +50 -0
- package/private/node_modules/typescript/SECURITY.md +41 -0
- package/private/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/private/node_modules/typescript/bin/tsc +2 -0
- package/private/node_modules/typescript/bin/tsserver +2 -0
- package/private/node_modules/typescript/lib/_tsc.js +133818 -0
- package/private/node_modules/typescript/lib/_tsserver.js +659 -0
- package/private/node_modules/typescript/lib/_typingsInstaller.js +222 -0
- package/private/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/lib.d.ts +22 -0
- package/private/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
- package/private/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
- package/private/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
- package/private/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
- package/private/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
- package/private/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
- package/private/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
- package/private/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
- package/private/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
- package/private/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
- package/private/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
- package/private/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
- package/private/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
- package/private/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
- package/private/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/private/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
- package/private/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
- package/private/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
- package/private/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
- package/private/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/private/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
- package/private/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
- package/private/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
- package/private/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
- package/private/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
- package/private/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/private/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
- package/private/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
- package/private/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/private/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
- package/private/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
- package/private/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
- package/private/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
- package/private/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
- package/private/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
- package/private/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
- package/private/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
- package/private/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
- package/private/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
- package/private/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
- package/private/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
- package/private/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
- package/private/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
- package/private/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
- package/private/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
- package/private/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/private/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
- package/private/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
- package/private/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
- package/private/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
- package/private/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
- package/private/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
- package/private/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
- package/private/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
- package/private/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
- package/private/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
- package/private/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
- package/private/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
- package/private/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
- package/private/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
- package/private/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
- package/private/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
- package/private/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/private/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
- package/private/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
- package/private/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
- package/private/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
- package/private/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
- package/private/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
- package/private/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
- package/private/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
- package/private/node_modules/typescript/lib/lib.es6.d.ts +23 -0
- package/private/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
- package/private/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
- package/private/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
- package/private/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
- package/private/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
- package/private/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
- package/private/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
- package/private/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
- package/private/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
- package/private/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
- package/private/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
- package/private/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
- package/private/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
- package/private/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
- package/private/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
- package/private/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
- package/private/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/tsc.js +8 -0
- package/private/node_modules/typescript/lib/tsserver.js +8 -0
- package/private/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
- package/private/node_modules/typescript/lib/tsserverlibrary.js +21 -0
- package/private/node_modules/typescript/lib/typesMap.json +497 -0
- package/private/node_modules/typescript/lib/typescript.d.ts +11437 -0
- package/private/node_modules/typescript/lib/typescript.js +200276 -0
- package/private/node_modules/typescript/lib/typingsInstaller.js +8 -0
- package/private/node_modules/typescript/lib/watchGuard.js +53 -0
- package/private/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
- package/private/node_modules/typescript/package.json +120 -0
- package/private/package-lock.json +53 -0
- package/private/package.json +17 -0
- package/private/tsconfig.json +103 -0
- package/src/mailisk.interfaces.ts +91 -6
- package/src/mailisk.ts +89 -7
- package/tests/mocks/axios-mocks.ts +85 -26
- package/tests/unit/mailisk.test.ts +138 -2
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "typescript",
|
|
3
|
+
"author": "Microsoft Corp.",
|
|
4
|
+
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
+
"version": "5.9.3",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"TypeScript",
|
|
10
|
+
"Microsoft",
|
|
11
|
+
"compiler",
|
|
12
|
+
"language",
|
|
13
|
+
"javascript"
|
|
14
|
+
],
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/microsoft/TypeScript/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/microsoft/TypeScript.git"
|
|
21
|
+
},
|
|
22
|
+
"main": "./lib/typescript.js",
|
|
23
|
+
"typings": "./lib/typescript.d.ts",
|
|
24
|
+
"bin": {
|
|
25
|
+
"tsc": "./bin/tsc",
|
|
26
|
+
"tsserver": "./bin/tsserver"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=14.17"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"bin",
|
|
33
|
+
"lib",
|
|
34
|
+
"!lib/enu",
|
|
35
|
+
"LICENSE.txt",
|
|
36
|
+
"README.md",
|
|
37
|
+
"SECURITY.md",
|
|
38
|
+
"ThirdPartyNoticeText.txt",
|
|
39
|
+
"!**/.gitattributes"
|
|
40
|
+
],
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@dprint/formatter": "^0.4.1",
|
|
43
|
+
"@dprint/typescript": "0.93.4",
|
|
44
|
+
"@esfx/canceltoken": "^1.0.0",
|
|
45
|
+
"@eslint/js": "^9.20.0",
|
|
46
|
+
"@octokit/rest": "^21.1.1",
|
|
47
|
+
"@types/chai": "^4.3.20",
|
|
48
|
+
"@types/diff": "^7.0.1",
|
|
49
|
+
"@types/minimist": "^1.2.5",
|
|
50
|
+
"@types/mocha": "^10.0.10",
|
|
51
|
+
"@types/ms": "^0.7.34",
|
|
52
|
+
"@types/node": "latest",
|
|
53
|
+
"@types/source-map-support": "^0.5.10",
|
|
54
|
+
"@types/which": "^3.0.4",
|
|
55
|
+
"@typescript-eslint/rule-tester": "^8.24.1",
|
|
56
|
+
"@typescript-eslint/type-utils": "^8.24.1",
|
|
57
|
+
"@typescript-eslint/utils": "^8.24.1",
|
|
58
|
+
"azure-devops-node-api": "^14.1.0",
|
|
59
|
+
"c8": "^10.1.3",
|
|
60
|
+
"chai": "^4.5.0",
|
|
61
|
+
"chokidar": "^4.0.3",
|
|
62
|
+
"diff": "^7.0.0",
|
|
63
|
+
"dprint": "^0.49.0",
|
|
64
|
+
"esbuild": "^0.25.0",
|
|
65
|
+
"eslint": "^9.20.1",
|
|
66
|
+
"eslint-formatter-autolinkable-stylish": "^1.4.0",
|
|
67
|
+
"eslint-plugin-regexp": "^2.7.0",
|
|
68
|
+
"fast-xml-parser": "^4.5.2",
|
|
69
|
+
"glob": "^10.4.5",
|
|
70
|
+
"globals": "^15.15.0",
|
|
71
|
+
"hereby": "^1.10.0",
|
|
72
|
+
"jsonc-parser": "^3.3.1",
|
|
73
|
+
"knip": "^5.44.4",
|
|
74
|
+
"minimist": "^1.2.8",
|
|
75
|
+
"mocha": "^10.8.2",
|
|
76
|
+
"mocha-fivemat-progress-reporter": "^0.1.0",
|
|
77
|
+
"monocart-coverage-reports": "^2.12.1",
|
|
78
|
+
"ms": "^2.1.3",
|
|
79
|
+
"picocolors": "^1.1.1",
|
|
80
|
+
"playwright": "^1.50.1",
|
|
81
|
+
"source-map-support": "^0.5.21",
|
|
82
|
+
"tslib": "^2.8.1",
|
|
83
|
+
"typescript": "^5.7.3",
|
|
84
|
+
"typescript-eslint": "^8.24.1",
|
|
85
|
+
"which": "^3.0.1"
|
|
86
|
+
},
|
|
87
|
+
"overrides": {
|
|
88
|
+
"typescript@*": "$typescript"
|
|
89
|
+
},
|
|
90
|
+
"scripts": {
|
|
91
|
+
"test": "hereby runtests-parallel --light=false",
|
|
92
|
+
"test:eslint-rules": "hereby run-eslint-rules-tests",
|
|
93
|
+
"build": "npm run build:compiler && npm run build:tests",
|
|
94
|
+
"build:compiler": "hereby local",
|
|
95
|
+
"build:tests": "hereby tests",
|
|
96
|
+
"build:tests:notypecheck": "hereby tests --no-typecheck",
|
|
97
|
+
"clean": "hereby clean",
|
|
98
|
+
"gulp": "hereby",
|
|
99
|
+
"lint": "hereby lint",
|
|
100
|
+
"knip": "hereby knip",
|
|
101
|
+
"format": "dprint fmt",
|
|
102
|
+
"setup-hooks": "node scripts/link-hooks.mjs"
|
|
103
|
+
},
|
|
104
|
+
"browser": {
|
|
105
|
+
"fs": false,
|
|
106
|
+
"os": false,
|
|
107
|
+
"path": false,
|
|
108
|
+
"crypto": false,
|
|
109
|
+
"buffer": false,
|
|
110
|
+
"source-map-support": false,
|
|
111
|
+
"inspector": false,
|
|
112
|
+
"perf_hooks": false
|
|
113
|
+
},
|
|
114
|
+
"packageManager": "npm@8.19.4",
|
|
115
|
+
"volta": {
|
|
116
|
+
"node": "20.1.0",
|
|
117
|
+
"npm": "8.19.4"
|
|
118
|
+
},
|
|
119
|
+
"gitHead": "c63de15a992d37f0d6cec03ac7631872838602cb"
|
|
120
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "private",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "private",
|
|
9
|
+
"version": "1.0.0",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"mailisk": "file:..",
|
|
13
|
+
"typescript": "^5.9.3"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"..": {
|
|
17
|
+
"name": "mailisk",
|
|
18
|
+
"version": "2.1.1",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"axios": "^1.1.2",
|
|
22
|
+
"nodemailer": "^6.8.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/jest": "^29.5.14",
|
|
26
|
+
"@types/nodemailer": "^6.4.6",
|
|
27
|
+
"dotenv": "^16.4.7",
|
|
28
|
+
"jest": "^29.7.0",
|
|
29
|
+
"jest-mock-axios": "^4.8.0",
|
|
30
|
+
"ts-jest": "^29.2.6",
|
|
31
|
+
"tsup": "^6.2.3",
|
|
32
|
+
"typescript": "^4.9.5"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"node_modules/mailisk": {
|
|
36
|
+
"resolved": "..",
|
|
37
|
+
"link": true
|
|
38
|
+
},
|
|
39
|
+
"node_modules/typescript": {
|
|
40
|
+
"version": "5.9.3",
|
|
41
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
|
42
|
+
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
|
43
|
+
"license": "Apache-2.0",
|
|
44
|
+
"bin": {
|
|
45
|
+
"tsc": "bin/tsc",
|
|
46
|
+
"tsserver": "bin/tsserver"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=14.17"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "private",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "tsc && node dist/private/index.js"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"type": "commonjs",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"mailisk": "file:..",
|
|
15
|
+
"typescript": "^5.9.3"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
+
|
|
13
|
+
/* Language and Environment */
|
|
14
|
+
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
18
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
20
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
22
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
23
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
26
|
+
|
|
27
|
+
/* Modules */
|
|
28
|
+
"module": "commonjs" /* Specify what module code is generated. */,
|
|
29
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
30
|
+
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
31
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
32
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
33
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
34
|
+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
35
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
36
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
37
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
38
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
39
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
40
|
+
|
|
41
|
+
/* JavaScript Support */
|
|
42
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
43
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
44
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
45
|
+
|
|
46
|
+
/* Emit */
|
|
47
|
+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
48
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
49
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
50
|
+
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
|
|
51
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
52
|
+
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
|
53
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
54
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
55
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
56
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
57
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
58
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
59
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
60
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
61
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
62
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
63
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
64
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
65
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
66
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
67
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
68
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
69
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
70
|
+
|
|
71
|
+
/* Interop Constraints */
|
|
72
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
73
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
74
|
+
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
75
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
76
|
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
77
|
+
|
|
78
|
+
/* Type Checking */
|
|
79
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
80
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
81
|
+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
82
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
83
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
84
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
85
|
+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
86
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
87
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
88
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
89
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
90
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
91
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
92
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
93
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
94
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
95
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
96
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
97
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
98
|
+
|
|
99
|
+
/* Completeness */
|
|
100
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
101
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -49,6 +49,42 @@ export interface Email {
|
|
|
49
49
|
attachments?: EmailAttachment[];
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
export interface SmsMessage {
|
|
53
|
+
/** Unique identifier for the message */
|
|
54
|
+
id: string;
|
|
55
|
+
/** Unique identifier for the SMS phone number */
|
|
56
|
+
sms_phone_number_id: string;
|
|
57
|
+
/** Body of the message */
|
|
58
|
+
body: string;
|
|
59
|
+
/** From number of the message */
|
|
60
|
+
from_number: string;
|
|
61
|
+
/** To number of the message */
|
|
62
|
+
to_number: string;
|
|
63
|
+
/** Provider message ID */
|
|
64
|
+
provider_message_id?: string;
|
|
65
|
+
/** Date and time the message was created */
|
|
66
|
+
created_at: string;
|
|
67
|
+
/** Direction of the message */
|
|
68
|
+
direction: "inbound" | "outbound";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface SmsNumber {
|
|
72
|
+
/** Unique identifier for the SMS number */
|
|
73
|
+
id: string;
|
|
74
|
+
/** Unique identifier for the organisation */
|
|
75
|
+
organisation_id: string;
|
|
76
|
+
/** Status of the SMS number */
|
|
77
|
+
status: "requested" | "active" | "disabled";
|
|
78
|
+
/** Country of the SMS number */
|
|
79
|
+
country: string;
|
|
80
|
+
/** SMS Phone number */
|
|
81
|
+
phone_number?: string;
|
|
82
|
+
/** Date and time the SMS number was created */
|
|
83
|
+
created_at: string;
|
|
84
|
+
/** Date and time the SMS number was updated */
|
|
85
|
+
updated_at: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
52
88
|
export interface SearchInboxParams {
|
|
53
89
|
/**
|
|
54
90
|
* The maximum number of emails that can be returned in this request, used alongside `offset` for pagination.
|
|
@@ -128,12 +164,8 @@ export interface GetAttachmentResponse {
|
|
|
128
164
|
}
|
|
129
165
|
|
|
130
166
|
export interface ListNamespacesResponse {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
id: string;
|
|
134
|
-
namespace: string;
|
|
135
|
-
}
|
|
136
|
-
];
|
|
167
|
+
total_count: number;
|
|
168
|
+
data: { id: string; namespace: string }[];
|
|
137
169
|
}
|
|
138
170
|
|
|
139
171
|
export interface SendVirtualEmailParams {
|
|
@@ -156,3 +188,56 @@ export interface SendVirtualEmailParams {
|
|
|
156
188
|
/** Attachments to the email */
|
|
157
189
|
attachments?: Attachment[];
|
|
158
190
|
}
|
|
191
|
+
|
|
192
|
+
export interface SearchSmsMessagesParams {
|
|
193
|
+
/**
|
|
194
|
+
* The maximum number of SMS messages returned (1-100), used alongside `offset` for pagination.
|
|
195
|
+
*/
|
|
196
|
+
limit?: number;
|
|
197
|
+
/**
|
|
198
|
+
* The number of SMS messages to skip/ignore, used alongside `limit` for pagination.
|
|
199
|
+
*/
|
|
200
|
+
offset?: number;
|
|
201
|
+
/**
|
|
202
|
+
* Filter messages by body contents (case insensitive).
|
|
203
|
+
*/
|
|
204
|
+
body?: string;
|
|
205
|
+
/**
|
|
206
|
+
* Filter messages by sender phone number prefix.
|
|
207
|
+
*/
|
|
208
|
+
from_number?: string;
|
|
209
|
+
/**
|
|
210
|
+
* Filter messages created on or after this date.
|
|
211
|
+
* Provide an ISO 8601 timestamp string.
|
|
212
|
+
*/
|
|
213
|
+
from_date?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Filter messages created on or before this date.
|
|
216
|
+
* Provide an ISO 8601 timestamp string.
|
|
217
|
+
*/
|
|
218
|
+
to_date?: string;
|
|
219
|
+
/**
|
|
220
|
+
* When true, keep the request open until at least one SMS is returned.
|
|
221
|
+
*/
|
|
222
|
+
wait?: boolean;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface SearchSmsMessagesResponse {
|
|
226
|
+
total_count: number;
|
|
227
|
+
options: SearchSmsMessagesParams;
|
|
228
|
+
data: SmsMessage[];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface ListSmsNumbersResponse {
|
|
232
|
+
total_count: number;
|
|
233
|
+
data: SmsNumber[];
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface SendVirtualSmsParams {
|
|
237
|
+
/** The phone number to send the SMS from */
|
|
238
|
+
from_number: string;
|
|
239
|
+
/** The phone number to send the SMS to */
|
|
240
|
+
to_number: string;
|
|
241
|
+
/** The body of the SMS message */
|
|
242
|
+
body: string;
|
|
243
|
+
}
|
package/src/mailisk.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import axios, { AxiosBasicCredentials, AxiosRequestConfig } from "axios";
|
|
1
|
+
import axios, { AxiosBasicCredentials, AxiosInstance, AxiosRequestConfig } from "axios";
|
|
2
2
|
import {
|
|
3
3
|
GetAttachmentResponse,
|
|
4
4
|
ListNamespacesResponse,
|
|
5
|
+
ListSmsNumbersResponse,
|
|
5
6
|
SearchInboxParams,
|
|
6
7
|
SearchInboxResponse,
|
|
8
|
+
SearchSmsMessagesParams,
|
|
9
|
+
SearchSmsMessagesResponse,
|
|
7
10
|
SendVirtualEmailParams,
|
|
11
|
+
SendVirtualSmsParams,
|
|
8
12
|
SmtpSettings,
|
|
9
13
|
} from "./mailisk.interfaces";
|
|
10
14
|
import nodemailer from "nodemailer";
|
|
@@ -20,7 +24,75 @@ export class MailiskClient {
|
|
|
20
24
|
});
|
|
21
25
|
}
|
|
22
26
|
|
|
23
|
-
private readonly axiosInstance;
|
|
27
|
+
private readonly axiosInstance: AxiosInstance;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Search SMS messages sent to a phone number.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* Search for SMS messages sent to a phone number
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const { data: smsMessages } = await client.searchSmsMessages("1234567890");
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
async searchSmsMessages(
|
|
39
|
+
phoneNumber: string,
|
|
40
|
+
params?: SearchSmsMessagesParams,
|
|
41
|
+
config?: AxiosRequestConfig
|
|
42
|
+
): Promise<SearchSmsMessagesResponse> {
|
|
43
|
+
let _params: SearchSmsMessagesParams = { ...params };
|
|
44
|
+
|
|
45
|
+
// default from timestamp, 15 minutes before starting this request
|
|
46
|
+
if (params?.from_date === undefined || params?.from_date === null) {
|
|
47
|
+
_params.from_date = new Date(Date.now() - 15 * 60 * 1000).toISOString();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// by default wait for sms
|
|
51
|
+
if (params?.wait !== false) {
|
|
52
|
+
_params.wait = true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let _config = { ...config };
|
|
56
|
+
|
|
57
|
+
if (config?.maxRedirects === undefined) {
|
|
58
|
+
_config.maxRedirects = 99999;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// by default, wait 5 minutes for emails before timing out
|
|
62
|
+
if (_params.wait && config?.timeout === undefined) {
|
|
63
|
+
_config.timeout = 1000 * 60 * 5;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const requestParams = {
|
|
67
|
+
..._params,
|
|
68
|
+
from_date: _params.from_date ?? undefined,
|
|
69
|
+
to_date: _params.to_date ?? undefined,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
await this.axiosInstance.get(`api/sms/${phoneNumber}/messages`, {
|
|
74
|
+
..._config,
|
|
75
|
+
params: requestParams,
|
|
76
|
+
})
|
|
77
|
+
).data;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* List all SMS phone numbers associated with the current account.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* List all SMS phone numbers
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const { data: smsNumbers } = await client.listSmsNumbers();
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
async listSmsNumbers(): Promise<ListSmsNumbersResponse> {
|
|
90
|
+
return (await this.axiosInstance.get("api/sms/numbers")).data;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async sendVirtualSms(params: SendVirtualSmsParams): Promise<void> {
|
|
94
|
+
return (await this.axiosInstance.post("api/sms/virtual", params)).data;
|
|
95
|
+
}
|
|
24
96
|
|
|
25
97
|
/**
|
|
26
98
|
* List all namespaces that belong to the current account (API key).
|
|
@@ -77,12 +149,12 @@ export class MailiskClient {
|
|
|
77
149
|
* Search inbox of a namespace.
|
|
78
150
|
*
|
|
79
151
|
* By default, this calls the api using the `wait` flag. This means the call won't timeout until at least one email is received or 5 minutes pass.
|
|
80
|
-
* It also uses a default `from_timestamp` of **current timestamp -
|
|
152
|
+
* It also uses a default `from_timestamp` of **current timestamp - 15 minutes**. This means that older emails will be ignored.
|
|
81
153
|
*
|
|
82
154
|
* Both of these settings can be overriden by passing them in the `params` object.
|
|
83
155
|
*
|
|
84
156
|
* @example
|
|
85
|
-
* Get the latest emails
|
|
157
|
+
* Get the latest emails
|
|
86
158
|
* ```typescript
|
|
87
159
|
* const { data: emails } = await client.searchInbox(namespace);
|
|
88
160
|
* ```
|
|
@@ -91,7 +163,17 @@ export class MailiskClient {
|
|
|
91
163
|
* Get the latest emails for a specific email address
|
|
92
164
|
* ```typescript
|
|
93
165
|
* const { data: emails } = await client.searchInbox(namespace, {
|
|
94
|
-
*
|
|
166
|
+
* to_addr_prefix: 'john@mynamespace.mailisk.net'
|
|
167
|
+
* });
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* Get the last 20 emails in the namespace
|
|
172
|
+
* ```typescript
|
|
173
|
+
* const { data: emails } = await mailisk.searchInbox(namespace, {
|
|
174
|
+
* wait: false,
|
|
175
|
+
* from_timestamp: 0,
|
|
176
|
+
* limit: 20
|
|
95
177
|
* });
|
|
96
178
|
* ```
|
|
97
179
|
*/
|
|
@@ -114,12 +196,12 @@ export class MailiskClient {
|
|
|
114
196
|
|
|
115
197
|
let _config = { ...config };
|
|
116
198
|
|
|
117
|
-
if (
|
|
199
|
+
if (config?.maxRedirects === undefined) {
|
|
118
200
|
_config.maxRedirects = 99999;
|
|
119
201
|
}
|
|
120
202
|
|
|
121
203
|
// by default, wait 5 minutes for emails before timing out
|
|
122
|
-
if (_params.wait &&
|
|
204
|
+
if (_params.wait && config?.timeout === undefined) {
|
|
123
205
|
_config.timeout = 1000 * 60 * 5;
|
|
124
206
|
}
|
|
125
207
|
|