simplelogin-client 0.0.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/LICENSE +7 -0
- package/README.md +78 -0
- package/package.json +70 -0
- package/tscBuild/index.d.ts +1 -0
- package/tscBuild/index.js +45 -0
- package/tscBuild/index.js.map +1 -0
- package/tscBuild/sdk/api.d.ts +2242 -0
- package/tscBuild/sdk/api.js +2564 -0
- package/tscBuild/sdk/api.js.map +1 -0
- package/tscBuild/sdk/configuration.d.ts +55 -0
- package/tscBuild/sdk/configuration.js +59 -0
- package/tscBuild/sdk/configuration.js.map +1 -0
- package/tscBuild/sdk/index.d.ts +13 -0
- package/tscBuild/sdk/index.js +42 -0
- package/tscBuild/sdk/index.js.map +1 -0
- package/tscBuild/tsconfig.build.tsbuildinfo +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2023 Kenneth Wußmann
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1><code>simplelogin-client</code></h1>
|
|
3
|
+
<p>
|
|
4
|
+
<strong>Zero-dependency TypeScript client for the <a href="https://simplelogin.io">SimpleLogin.io</a> API. Compatible with NodeJS and browsers.</strong>
|
|
5
|
+
</p>
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://kennethwussmann.github.io/simplelogin-client/typedoc/modules/SimpleLogin.html">Documentation</a> • <a href="https://kennethwussmann.github.io/simplelogin-client/redoc/index.html">API Spec</a>
|
|
8
|
+
</p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
> Interested in the state of the project? [Check the faq!](./docs/faq.md#whats-the-current-project-state)
|
|
14
|
+
|
|
15
|
+
- [x] Account Management
|
|
16
|
+
- [x] Login (+MFA), Register, Activate, etc.
|
|
17
|
+
- [x] User info
|
|
18
|
+
- [x] API key management
|
|
19
|
+
- [x] Alias Management
|
|
20
|
+
- [x] Get, Create, Update, Delete
|
|
21
|
+
- [x] Contacts and activities
|
|
22
|
+
- [x] Mailbox Management
|
|
23
|
+
- [x] Get, Create, Update, Delete
|
|
24
|
+
- [ ] Custom Domain Management
|
|
25
|
+
- [x] Get
|
|
26
|
+
- [ ] Update, Delete
|
|
27
|
+
- [ ] Contact Management
|
|
28
|
+
- [x] Get, Create
|
|
29
|
+
- [ ] Delete
|
|
30
|
+
- [ ] Block & unblock
|
|
31
|
+
- [ ] Notifications
|
|
32
|
+
- [ ] Settings
|
|
33
|
+
- [ ] Import & Export
|
|
34
|
+
- [ ] Misc
|
|
35
|
+
- [ ] Phone
|
|
36
|
+
|
|
37
|
+
## Getting started
|
|
38
|
+
|
|
39
|
+
`simplelogin-client` works in most NodeJS versions and browsers, but may require a tweak when not used with NodeJS 18 or in outdated browsers. Check the [compatibility guide](./docs/faq.md#what-nodejs-version-and-browsers-are-supported).
|
|
40
|
+
|
|
41
|
+
To start using this API client in your JS/TS projects:
|
|
42
|
+
|
|
43
|
+
```shell
|
|
44
|
+
# Install dependency
|
|
45
|
+
npm install --save simplelogin-client
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { SimpleLogin } from 'simplelogin-client';
|
|
50
|
+
|
|
51
|
+
const alias = new SimpleLogin.AliasApi({
|
|
52
|
+
apiKey: process.env.API_KEY,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const createdAlias = await alias.createRandomAlias({
|
|
56
|
+
note: 'This alias was created with simplelogin-client!',
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
console.log(createdAlias);
|
|
60
|
+
/* Output:
|
|
61
|
+
{
|
|
62
|
+
id: 50001,
|
|
63
|
+
creation_date: '2023-02-10 20:19:37+00:00',
|
|
64
|
+
alias: 'nederlanden_heatherington@example.com',
|
|
65
|
+
mailbox: { email: 'somewhere@gmail.com', id: 50001 },
|
|
66
|
+
enabled: true,
|
|
67
|
+
pinned: false,
|
|
68
|
+
note: "This alias was created with simplelogin-client!",
|
|
69
|
+
...
|
|
70
|
+
}
|
|
71
|
+
*/
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Check the [documentation](https://kennethwussmann.github.io/simplelogin-client/typedoc/modules/SimpleLogin.html) for all available methods and the [FAQ](./docs/faq.md) in case of questions.
|
|
75
|
+
|
|
76
|
+
## Development
|
|
77
|
+
|
|
78
|
+
Want to contribute fixes to the API client or spec? Check the [development guide](./docs/development.md)!
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "simplelogin-client",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "tscBuild/index.js",
|
|
6
|
+
"types": "tscBuild/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "npm-watch",
|
|
9
|
+
"test": "jest --passWithNoTests",
|
|
10
|
+
"ci": "tsx scripts/index.ts ci",
|
|
11
|
+
"build": "tsx scripts/index.ts build",
|
|
12
|
+
"rebuild": "tsx scripts/index.ts rebuild",
|
|
13
|
+
"clean": "tsx scripts/index.ts clean",
|
|
14
|
+
"check-codegen": "tsx scripts/index.ts checkCodegen",
|
|
15
|
+
"lint": "tsx scripts/index.ts lint",
|
|
16
|
+
"format": "tsx scripts/index.ts format",
|
|
17
|
+
"dependency-update": "npm-check-updates -u --filterVersion \"/^[~^<>]| - |\\.x$/\" --deep && npm install",
|
|
18
|
+
"prepare": "husky install"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"./tscBuild"
|
|
24
|
+
],
|
|
25
|
+
"watch": {
|
|
26
|
+
"build": {
|
|
27
|
+
"patterns": "oas",
|
|
28
|
+
"extensions": "yml,yaml"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"lint-staged": {
|
|
32
|
+
"src/*.ts": "eslint --cache --fix",
|
|
33
|
+
"*.{ts,json,yml,yaml,html,md}": "prettier --write"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": "18",
|
|
37
|
+
"npm": "9"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [],
|
|
40
|
+
"author": "",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@moia-oss/eslint-prettier-typescript-config": "^0.11.46",
|
|
44
|
+
"@types/jest": "^29.2.3",
|
|
45
|
+
"@types/node": "18.*",
|
|
46
|
+
"@types/node-fetch": "^2.6.2",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
|
48
|
+
"@typescript-eslint/parser": "^5.51.0",
|
|
49
|
+
"boats": "^3.4.0",
|
|
50
|
+
"chalk": "^5.2.0",
|
|
51
|
+
"dotenv": "^16.0.3",
|
|
52
|
+
"eslint": "^8.33.0",
|
|
53
|
+
"eslint-plugin-jest": "^27.2.1",
|
|
54
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
55
|
+
"globby": "^13.1.3",
|
|
56
|
+
"husky": "^8.0.3",
|
|
57
|
+
"jest": "^29.3.1",
|
|
58
|
+
"lint-staged": "^13",
|
|
59
|
+
"npm-check-updates": "^16.6.5",
|
|
60
|
+
"npm-watch": "^0.11.0",
|
|
61
|
+
"prettier": "^2.8.4",
|
|
62
|
+
"redoc-cli": "^0.13.20",
|
|
63
|
+
"ts-jest": "^29.0.3",
|
|
64
|
+
"ts-node": "^10.9.1",
|
|
65
|
+
"tsx": "^3.12.3",
|
|
66
|
+
"typedoc": "^0.23.24",
|
|
67
|
+
"typescript": "^4.9.5",
|
|
68
|
+
"zx": "^7.1.1"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as SimpleLogin from './sdk';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return m[k];
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}
|
|
18
|
+
: function (o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
});
|
|
22
|
+
var __setModuleDefault =
|
|
23
|
+
(this && this.__setModuleDefault) ||
|
|
24
|
+
(Object.create
|
|
25
|
+
? function (o, v) {
|
|
26
|
+
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
27
|
+
}
|
|
28
|
+
: function (o, v) {
|
|
29
|
+
o['default'] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar =
|
|
32
|
+
(this && this.__importStar) ||
|
|
33
|
+
function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null)
|
|
37
|
+
for (var k in mod)
|
|
38
|
+
if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
43
|
+
exports.SimpleLogin = void 0;
|
|
44
|
+
exports.SimpleLogin = __importStar(require('./sdk'));
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAqC"}
|