@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.
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18
+ * WiFi Account Backend
19
+ * Manage WiFi accounts via LDAP directory
20
+ *
21
+ * The version of the OpenAPI document: 0.1.0
22
+ * Contact: tech@p7m.de
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The ListWrapperLdapAccountDataInner model module.
31
+ * @module model/ListWrapperLdapAccountDataInner
32
+ * @version 0.1.0
33
+ */
34
+ var ListWrapperLdapAccountDataInner = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>ListWrapperLdapAccountDataInner</code>.
37
+ * @alias module:model/ListWrapperLdapAccountDataInner
38
+ * @param ldapAccountId {String}
39
+ * @param tenantId {String}
40
+ * @param loginUser {String}
41
+ * @param loginPassword {String}
42
+ * @param validityStart {Date}
43
+ * @param validityEnd {Date}
44
+ * @param lastChange {Date}
45
+ */
46
+ function ListWrapperLdapAccountDataInner(ldapAccountId, tenantId, loginUser, loginPassword, validityStart, validityEnd, lastChange) {
47
+ _classCallCheck(this, ListWrapperLdapAccountDataInner);
48
+ ListWrapperLdapAccountDataInner.initialize(this, ldapAccountId, tenantId, loginUser, loginPassword, validityStart, validityEnd, lastChange);
49
+ }
50
+
51
+ /**
52
+ * Initializes the fields of this object.
53
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
54
+ * Only for internal use.
55
+ */
56
+ return _createClass(ListWrapperLdapAccountDataInner, null, [{
57
+ key: "initialize",
58
+ value: function initialize(obj, ldapAccountId, tenantId, loginUser, loginPassword, validityStart, validityEnd, lastChange) {
59
+ obj['ldapAccountId'] = ldapAccountId;
60
+ obj['tenantId'] = tenantId;
61
+ obj['loginUser'] = loginUser;
62
+ obj['loginPassword'] = loginPassword;
63
+ obj['validityStart'] = validityStart;
64
+ obj['validityEnd'] = validityEnd;
65
+ obj['lastChange'] = lastChange;
66
+ }
67
+
68
+ /**
69
+ * Constructs a <code>ListWrapperLdapAccountDataInner</code> from a plain JavaScript object, optionally creating a new instance.
70
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
71
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
72
+ * @param {module:model/ListWrapperLdapAccountDataInner} obj Optional instance to populate.
73
+ * @return {module:model/ListWrapperLdapAccountDataInner} The populated <code>ListWrapperLdapAccountDataInner</code> instance.
74
+ */
75
+ }, {
76
+ key: "constructFromObject",
77
+ value: function constructFromObject(data, obj) {
78
+ if (data) {
79
+ obj = obj || new ListWrapperLdapAccountDataInner();
80
+ if (data.hasOwnProperty('ldapAccountId')) {
81
+ obj['ldapAccountId'] = _ApiClient["default"].convertToType(data['ldapAccountId'], 'String');
82
+ }
83
+ if (data.hasOwnProperty('tenantId')) {
84
+ obj['tenantId'] = _ApiClient["default"].convertToType(data['tenantId'], 'String');
85
+ }
86
+ if (data.hasOwnProperty('loginUser')) {
87
+ obj['loginUser'] = _ApiClient["default"].convertToType(data['loginUser'], 'String');
88
+ }
89
+ if (data.hasOwnProperty('loginPassword')) {
90
+ obj['loginPassword'] = _ApiClient["default"].convertToType(data['loginPassword'], 'String');
91
+ }
92
+ if (data.hasOwnProperty('validityStart')) {
93
+ obj['validityStart'] = _ApiClient["default"].convertToType(data['validityStart'], 'Date');
94
+ }
95
+ if (data.hasOwnProperty('validityEnd')) {
96
+ obj['validityEnd'] = _ApiClient["default"].convertToType(data['validityEnd'], 'Date');
97
+ }
98
+ if (data.hasOwnProperty('lastChange')) {
99
+ obj['lastChange'] = _ApiClient["default"].convertToType(data['lastChange'], 'Date');
100
+ }
101
+ }
102
+ return obj;
103
+ }
104
+
105
+ /**
106
+ * Validates the JSON data with respect to <code>ListWrapperLdapAccountDataInner</code>.
107
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
108
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ListWrapperLdapAccountDataInner</code>.
109
+ */
110
+ }, {
111
+ key: "validateJSON",
112
+ value: function validateJSON(data) {
113
+ // check to make sure all required properties are present in the JSON string
114
+ var _iterator = _createForOfIteratorHelper(ListWrapperLdapAccountDataInner.RequiredProperties),
115
+ _step;
116
+ try {
117
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
118
+ var property = _step.value;
119
+ if (!data.hasOwnProperty(property)) {
120
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
121
+ }
122
+ }
123
+ // ensure the json data is a string
124
+ } catch (err) {
125
+ _iterator.e(err);
126
+ } finally {
127
+ _iterator.f();
128
+ }
129
+ if (data['ldapAccountId'] && !(typeof data['ldapAccountId'] === 'string' || data['ldapAccountId'] instanceof String)) {
130
+ throw new Error("Expected the field `ldapAccountId` to be a primitive type in the JSON string but got " + data['ldapAccountId']);
131
+ }
132
+ // ensure the json data is a string
133
+ if (data['tenantId'] && !(typeof data['tenantId'] === 'string' || data['tenantId'] instanceof String)) {
134
+ throw new Error("Expected the field `tenantId` to be a primitive type in the JSON string but got " + data['tenantId']);
135
+ }
136
+ // ensure the json data is a string
137
+ if (data['loginUser'] && !(typeof data['loginUser'] === 'string' || data['loginUser'] instanceof String)) {
138
+ throw new Error("Expected the field `loginUser` to be a primitive type in the JSON string but got " + data['loginUser']);
139
+ }
140
+ // ensure the json data is a string
141
+ if (data['loginPassword'] && !(typeof data['loginPassword'] === 'string' || data['loginPassword'] instanceof String)) {
142
+ throw new Error("Expected the field `loginPassword` to be a primitive type in the JSON string but got " + data['loginPassword']);
143
+ }
144
+ return true;
145
+ }
146
+ }]);
147
+ }();
148
+ ListWrapperLdapAccountDataInner.RequiredProperties = ["ldapAccountId", "tenantId", "loginUser", "loginPassword", "validityStart", "validityEnd", "lastChange"];
149
+
150
+ /**
151
+ * @member {String} ldapAccountId
152
+ */
153
+ ListWrapperLdapAccountDataInner.prototype['ldapAccountId'] = undefined;
154
+
155
+ /**
156
+ * @member {String} tenantId
157
+ */
158
+ ListWrapperLdapAccountDataInner.prototype['tenantId'] = undefined;
159
+
160
+ /**
161
+ * @member {String} loginUser
162
+ */
163
+ ListWrapperLdapAccountDataInner.prototype['loginUser'] = undefined;
164
+
165
+ /**
166
+ * @member {String} loginPassword
167
+ */
168
+ ListWrapperLdapAccountDataInner.prototype['loginPassword'] = undefined;
169
+
170
+ /**
171
+ * @member {Date} validityStart
172
+ */
173
+ ListWrapperLdapAccountDataInner.prototype['validityStart'] = undefined;
174
+
175
+ /**
176
+ * @member {Date} validityEnd
177
+ */
178
+ ListWrapperLdapAccountDataInner.prototype['validityEnd'] = undefined;
179
+
180
+ /**
181
+ * @member {Date} lastChange
182
+ */
183
+ ListWrapperLdapAccountDataInner.prototype['lastChange'] = undefined;
184
+ var _default = exports["default"] = ListWrapperLdapAccountDataInner;
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18
+ * WiFi Account Backend
19
+ * Manage WiFi accounts via LDAP directory
20
+ *
21
+ * The version of the OpenAPI document: 0.1.0
22
+ * Contact: tech@p7m.de
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The NewLdapAccount model module.
31
+ * @module model/NewLdapAccount
32
+ * @version 0.1.0
33
+ */
34
+ var NewLdapAccount = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>NewLdapAccount</code>.
37
+ * @alias module:model/NewLdapAccount
38
+ * @param loginUser {String}
39
+ * @param loginPassword {String}
40
+ * @param validityStart {Date}
41
+ * @param validityEnd {Date}
42
+ */
43
+ function NewLdapAccount(loginUser, loginPassword, validityStart, validityEnd) {
44
+ _classCallCheck(this, NewLdapAccount);
45
+ NewLdapAccount.initialize(this, loginUser, loginPassword, validityStart, validityEnd);
46
+ }
47
+
48
+ /**
49
+ * Initializes the fields of this object.
50
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
51
+ * Only for internal use.
52
+ */
53
+ return _createClass(NewLdapAccount, null, [{
54
+ key: "initialize",
55
+ value: function initialize(obj, loginUser, loginPassword, validityStart, validityEnd) {
56
+ obj['loginUser'] = loginUser;
57
+ obj['loginPassword'] = loginPassword;
58
+ obj['validityStart'] = validityStart;
59
+ obj['validityEnd'] = validityEnd;
60
+ }
61
+
62
+ /**
63
+ * Constructs a <code>NewLdapAccount</code> from a plain JavaScript object, optionally creating a new instance.
64
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
65
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
66
+ * @param {module:model/NewLdapAccount} obj Optional instance to populate.
67
+ * @return {module:model/NewLdapAccount} The populated <code>NewLdapAccount</code> instance.
68
+ */
69
+ }, {
70
+ key: "constructFromObject",
71
+ value: function constructFromObject(data, obj) {
72
+ if (data) {
73
+ obj = obj || new NewLdapAccount();
74
+ if (data.hasOwnProperty('loginUser')) {
75
+ obj['loginUser'] = _ApiClient["default"].convertToType(data['loginUser'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('loginPassword')) {
78
+ obj['loginPassword'] = _ApiClient["default"].convertToType(data['loginPassword'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('validityStart')) {
81
+ obj['validityStart'] = _ApiClient["default"].convertToType(data['validityStart'], 'Date');
82
+ }
83
+ if (data.hasOwnProperty('validityEnd')) {
84
+ obj['validityEnd'] = _ApiClient["default"].convertToType(data['validityEnd'], 'Date');
85
+ }
86
+ }
87
+ return obj;
88
+ }
89
+
90
+ /**
91
+ * Validates the JSON data with respect to <code>NewLdapAccount</code>.
92
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
93
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>NewLdapAccount</code>.
94
+ */
95
+ }, {
96
+ key: "validateJSON",
97
+ value: function validateJSON(data) {
98
+ // check to make sure all required properties are present in the JSON string
99
+ var _iterator = _createForOfIteratorHelper(NewLdapAccount.RequiredProperties),
100
+ _step;
101
+ try {
102
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
103
+ var property = _step.value;
104
+ if (!data.hasOwnProperty(property)) {
105
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
106
+ }
107
+ }
108
+ // ensure the json data is a string
109
+ } catch (err) {
110
+ _iterator.e(err);
111
+ } finally {
112
+ _iterator.f();
113
+ }
114
+ if (data['loginUser'] && !(typeof data['loginUser'] === 'string' || data['loginUser'] instanceof String)) {
115
+ throw new Error("Expected the field `loginUser` to be a primitive type in the JSON string but got " + data['loginUser']);
116
+ }
117
+ // ensure the json data is a string
118
+ if (data['loginPassword'] && !(typeof data['loginPassword'] === 'string' || data['loginPassword'] instanceof String)) {
119
+ throw new Error("Expected the field `loginPassword` to be a primitive type in the JSON string but got " + data['loginPassword']);
120
+ }
121
+ return true;
122
+ }
123
+ }]);
124
+ }();
125
+ NewLdapAccount.RequiredProperties = ["loginUser", "loginPassword", "validityStart", "validityEnd"];
126
+
127
+ /**
128
+ * @member {String} loginUser
129
+ */
130
+ NewLdapAccount.prototype['loginUser'] = undefined;
131
+
132
+ /**
133
+ * @member {String} loginPassword
134
+ */
135
+ NewLdapAccount.prototype['loginPassword'] = undefined;
136
+
137
+ /**
138
+ * @member {Date} validityStart
139
+ */
140
+ NewLdapAccount.prototype['validityStart'] = undefined;
141
+
142
+ /**
143
+ * @member {Date} validityEnd
144
+ */
145
+ NewLdapAccount.prototype['validityEnd'] = undefined;
146
+ var _default = exports["default"] = NewLdapAccount;
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@p7m/ldap-backend",
3
+ "version": "0.1.0",
4
+ "description": "Manage WiFi accounts via LDAP directory",
5
+ "license": "Apache-2.0",
6
+ "main": "dist/index.js",
7
+ "scripts": {
8
+ "build": "babel src -d dist",
9
+ "prepare": "npm run build",
10
+ "test": "mocha --require @babel/register --recursive"
11
+ },
12
+ "browser": {
13
+ "fs": false
14
+ },
15
+ "dependencies": {
16
+ "@babel/cli": "^7.0.0",
17
+ "superagent": "^5.3.0"
18
+ },
19
+ "devDependencies": {
20
+ "@babel/core": "^7.0.0",
21
+ "@babel/plugin-proposal-class-properties": "^7.0.0",
22
+ "@babel/plugin-proposal-decorators": "^7.0.0",
23
+ "@babel/plugin-proposal-do-expressions": "^7.0.0",
24
+ "@babel/plugin-proposal-export-default-from": "^7.0.0",
25
+ "@babel/plugin-proposal-export-namespace-from": "^7.0.0",
26
+ "@babel/plugin-proposal-function-bind": "^7.0.0",
27
+ "@babel/plugin-proposal-function-sent": "^7.0.0",
28
+ "@babel/plugin-proposal-json-strings": "^7.0.0",
29
+ "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
30
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
31
+ "@babel/plugin-proposal-numeric-separator": "^7.0.0",
32
+ "@babel/plugin-proposal-optional-chaining": "^7.0.0",
33
+ "@babel/plugin-proposal-pipeline-operator": "^7.0.0",
34
+ "@babel/plugin-proposal-throw-expressions": "^7.0.0",
35
+ "@babel/plugin-syntax-dynamic-import": "^7.0.0",
36
+ "@babel/plugin-syntax-import-meta": "^7.0.0",
37
+ "@babel/preset-env": "^7.0.0",
38
+ "@babel/register": "^7.0.0",
39
+ "expect.js": "^0.3.1",
40
+ "mocha": "^8.0.1",
41
+ "sinon": "^7.2.0"
42
+ },
43
+ "files": [
44
+ "dist"
45
+ ]
46
+ }