@p7m/ldap-backend 0.1.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/README.md +152 -0
- package/dist/ApiClient.js +703 -0
- package/dist/api/AccountApi.js +238 -0
- package/dist/index.js +48 -0
- package/dist/model/LdapAccount.js +184 -0
- package/dist/model/ListWrapperLdapAccount.js +130 -0
- package/dist/model/ListWrapperLdapAccountDataInner.js +184 -0
- package/dist/model/NewLdapAccount.js +146 -0
- package/package.json +46 -0
package/README.md
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
# @p7m/ldap-backend
|
2
|
+
|
3
|
+
LdapBackend - JavaScript client for @p7m/ldap-backend
|
4
|
+
Manage WiFi accounts via LDAP directory
|
5
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
6
|
+
|
7
|
+
- API version: 0.1.0
|
8
|
+
- Package version: 0.1.0
|
9
|
+
- Generator version: 7.13.0-SNAPSHOT
|
10
|
+
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
### For [Node.js](https://nodejs.org/)
|
15
|
+
|
16
|
+
#### npm
|
17
|
+
|
18
|
+
To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
19
|
+
|
20
|
+
Then install it via:
|
21
|
+
|
22
|
+
```shell
|
23
|
+
npm install @p7m/ldap-backend --save
|
24
|
+
```
|
25
|
+
|
26
|
+
Finally, you need to build the module:
|
27
|
+
|
28
|
+
```shell
|
29
|
+
npm run build
|
30
|
+
```
|
31
|
+
|
32
|
+
##### Local development
|
33
|
+
|
34
|
+
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:
|
35
|
+
|
36
|
+
```shell
|
37
|
+
npm install
|
38
|
+
```
|
39
|
+
|
40
|
+
Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:
|
41
|
+
|
42
|
+
```shell
|
43
|
+
npm link
|
44
|
+
```
|
45
|
+
|
46
|
+
To use the link you just defined in your project, switch to the directory you want to use your @p7m/ldap-backend from, and run:
|
47
|
+
|
48
|
+
```shell
|
49
|
+
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
|
50
|
+
```
|
51
|
+
|
52
|
+
Finally, you need to build the module:
|
53
|
+
|
54
|
+
```shell
|
55
|
+
npm run build
|
56
|
+
```
|
57
|
+
|
58
|
+
#### git
|
59
|
+
|
60
|
+
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID
|
61
|
+
then install it via:
|
62
|
+
|
63
|
+
```shell
|
64
|
+
npm install GIT_USER_ID/GIT_REPO_ID --save
|
65
|
+
```
|
66
|
+
|
67
|
+
### For browser
|
68
|
+
|
69
|
+
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
|
70
|
+
the above steps with Node.js and installing browserify with `npm install -g browserify`,
|
71
|
+
perform the following (assuming *main.js* is your entry file):
|
72
|
+
|
73
|
+
```shell
|
74
|
+
browserify main.js > bundle.js
|
75
|
+
```
|
76
|
+
|
77
|
+
Then include *bundle.js* in the HTML pages.
|
78
|
+
|
79
|
+
### Webpack Configuration
|
80
|
+
|
81
|
+
Using Webpack you may encounter the following error: "Module not found: Error:
|
82
|
+
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
|
83
|
+
the following section to your webpack config:
|
84
|
+
|
85
|
+
```javascript
|
86
|
+
module: {
|
87
|
+
rules: [
|
88
|
+
{
|
89
|
+
parser: {
|
90
|
+
amd: false
|
91
|
+
}
|
92
|
+
}
|
93
|
+
]
|
94
|
+
}
|
95
|
+
```
|
96
|
+
|
97
|
+
## Getting Started
|
98
|
+
|
99
|
+
Please follow the [installation](#installation) instruction and execute the following JS code:
|
100
|
+
|
101
|
+
```javascript
|
102
|
+
var LdapBackend = require('@p7m/ldap-backend');
|
103
|
+
|
104
|
+
var defaultClient = LdapBackend.ApiClient.instance;
|
105
|
+
// Configure OAuth2 access token for authorization: oauth
|
106
|
+
var oauth = defaultClient.authentications['oauth'];
|
107
|
+
oauth.accessToken = "YOUR ACCESS TOKEN"
|
108
|
+
|
109
|
+
var api = new LdapBackend.AccountApi()
|
110
|
+
var accountId = "accountId_example"; // {String} ID of the LDAP/WiFi accuont
|
111
|
+
api.deleteAccountsAccountId(accountId).then(function() {
|
112
|
+
console.log('API called successfully.');
|
113
|
+
}, function(error) {
|
114
|
+
console.error(error);
|
115
|
+
});
|
116
|
+
|
117
|
+
|
118
|
+
```
|
119
|
+
|
120
|
+
## Documentation for API Endpoints
|
121
|
+
|
122
|
+
All URIs are relative to *https://ldap.api.p7m.de/v1*
|
123
|
+
|
124
|
+
Class | Method | HTTP request | Description
|
125
|
+
------------ | ------------- | ------------- | -------------
|
126
|
+
*LdapBackend.AccountApi* | [**deleteAccountsAccountId**](docs/AccountApi.md#deleteAccountsAccountId) | **DELETE** /accounts/{account_id} | Delete a single LDAP/WiFi account by its ID
|
127
|
+
*LdapBackend.AccountApi* | [**getAccounts**](docs/AccountApi.md#getAccounts) | **GET** /accounts | Get the list of all LDAP/WiFi accounts
|
128
|
+
*LdapBackend.AccountApi* | [**getAccountsAccountId**](docs/AccountApi.md#getAccountsAccountId) | **GET** /accounts/{account_id} | Get a single LDAP/WiFi account by its ID
|
129
|
+
*LdapBackend.AccountApi* | [**postAccounts**](docs/AccountApi.md#postAccounts) | **POST** /accounts | Create a new LDAP/WiFi account
|
130
|
+
*LdapBackend.AccountApi* | [**putAccountsAccountId**](docs/AccountApi.md#putAccountsAccountId) | **PUT** /accounts/{account_id} | Update an existing LDAP/WiFi account
|
131
|
+
|
132
|
+
|
133
|
+
## Documentation for Models
|
134
|
+
|
135
|
+
- [LdapBackend.LdapAccount](docs/LdapAccount.md)
|
136
|
+
- [LdapBackend.ListWrapperLdapAccount](docs/ListWrapperLdapAccount.md)
|
137
|
+
- [LdapBackend.ListWrapperLdapAccountDataInner](docs/ListWrapperLdapAccountDataInner.md)
|
138
|
+
- [LdapBackend.NewLdapAccount](docs/NewLdapAccount.md)
|
139
|
+
|
140
|
+
|
141
|
+
## Documentation for Authorization
|
142
|
+
|
143
|
+
|
144
|
+
Authentication schemes defined for the API:
|
145
|
+
### oauth
|
146
|
+
|
147
|
+
|
148
|
+
- **Type**: OAuth
|
149
|
+
- **Flow**: accessCode
|
150
|
+
- **Authorization URL**: https://login.p7m.de/auth/authorize
|
151
|
+
- **Scopes**: N/A
|
152
|
+
|