@nakedcreativity/membrs-angular-helper 0.0.13 → 0.0.15
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 +1 -1
- package/bundles/nakedcreativity-membrs-angular-helper.umd.js +42 -434
- package/bundles/nakedcreativity-membrs-angular-helper.umd.js.map +1 -1
- package/bundles/nakedcreativity-membrs-angular-helper.umd.min.js +1 -15
- package/bundles/nakedcreativity-membrs-angular-helper.umd.min.js.map +1 -1
- package/esm2015/lib/membrs.component.js +18 -0
- package/esm2015/lib/membrs.module.js +9 -95
- package/esm2015/lib/membrs.service.js +11 -99
- package/esm2015/nakedcreativity-membrs-angular-helper.js +1 -2
- package/esm2015/public-api.js +2 -2
- package/fesm2015/nakedcreativity-membrs-angular-helper.js +33 -202
- package/fesm2015/nakedcreativity-membrs-angular-helper.js.map +1 -1
- package/lib/membrs.component.d.ts +5 -0
- package/lib/membrs.module.d.ts +0 -21
- package/lib/membrs.service.d.ts +1 -15
- package/nakedcreativity-membrs-angular-helper.d.ts +0 -2
- package/nakedcreativity-membrs-angular-helper.metadata.json +1 -1
- package/package.json +8 -8
- package/public-api.d.ts +1 -1
- package/esm2015/lib/config.interface.js +0 -1
- package/esm2015/lib/config.service.js +0 -7
- package/esm2015/lib/router.config.js +0 -15
- package/esm2015/lib/token.js +0 -4
- package/esm5/lib/config.interface.js +0 -1
- package/esm5/lib/config.service.js +0 -7
- package/esm5/lib/membrs.module.js +0 -102
- package/esm5/lib/membrs.service.js +0 -116
- package/esm5/lib/router.config.js +0 -15
- package/esm5/lib/token.js +0 -4
- package/esm5/nakedcreativity-membrs-angular-helper.js +0 -6
- package/esm5/public-api.js +0 -7
- package/fesm5/nakedcreativity-membrs-angular-helper.js +0 -238
- package/fesm5/nakedcreativity-membrs-angular-helper.js.map +0 -1
- package/lib/config.interface.d.ts +0 -7
- package/lib/config.service.d.ts +0 -7
- package/lib/router.config.d.ts +0 -3
- package/lib/token.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,453 +1,61 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@nakedcreativity/membrs-angular-helper', ['exports', '@angular/core'
|
|
4
|
-
(global = global || self, factory((global.nakedcreativity = global.nakedcreativity || {}, global.nakedcreativity['membrs-angular-helper'] = {}), global.ng.core
|
|
5
|
-
}(this, (function (exports,
|
|
6
|
-
|
|
7
|
-
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
10
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
11
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
|
|
13
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
15
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
16
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
17
|
-
|
|
18
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
19
|
-
and limitations under the License.
|
|
20
|
-
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
22
|
-
|
|
23
|
-
var extendStatics = function(d, b) {
|
|
24
|
-
extendStatics = Object.setPrototypeOf ||
|
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
27
|
-
return extendStatics(d, b);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
function __extends(d, b) {
|
|
31
|
-
extendStatics(d, b);
|
|
32
|
-
function __() { this.constructor = d; }
|
|
33
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var __assign = function() {
|
|
37
|
-
__assign = Object.assign || function __assign(t) {
|
|
38
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
39
|
-
s = arguments[i];
|
|
40
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
41
|
-
}
|
|
42
|
-
return t;
|
|
43
|
-
};
|
|
44
|
-
return __assign.apply(this, arguments);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
function __rest(s, e) {
|
|
48
|
-
var t = {};
|
|
49
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
50
|
-
t[p] = s[p];
|
|
51
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
52
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
53
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
54
|
-
t[p[i]] = s[p[i]];
|
|
55
|
-
}
|
|
56
|
-
return t;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function __decorate(decorators, target, key, desc) {
|
|
60
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
61
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
62
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
63
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function __param(paramIndex, decorator) {
|
|
67
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function __metadata(metadataKey, metadataValue) {
|
|
71
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
75
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
76
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
77
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
78
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
79
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
80
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function __generator(thisArg, body) {
|
|
85
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
86
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
87
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
88
|
-
function step(op) {
|
|
89
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
90
|
-
while (_) try {
|
|
91
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
92
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
93
|
-
switch (op[0]) {
|
|
94
|
-
case 0: case 1: t = op; break;
|
|
95
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
96
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
97
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
98
|
-
default:
|
|
99
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
100
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
101
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
102
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
103
|
-
if (t[2]) _.ops.pop();
|
|
104
|
-
_.trys.pop(); continue;
|
|
105
|
-
}
|
|
106
|
-
op = body.call(thisArg, _);
|
|
107
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
108
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function __exportStar(m, exports) {
|
|
113
|
-
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function __values(o) {
|
|
117
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
118
|
-
if (m) return m.call(o);
|
|
119
|
-
if (o && typeof o.length === "number") return {
|
|
120
|
-
next: function () {
|
|
121
|
-
if (o && i >= o.length) o = void 0;
|
|
122
|
-
return { value: o && o[i++], done: !o };
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function __read(o, n) {
|
|
129
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
130
|
-
if (!m) return o;
|
|
131
|
-
var i = m.call(o), r, ar = [], e;
|
|
132
|
-
try {
|
|
133
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
134
|
-
}
|
|
135
|
-
catch (error) { e = { error: error }; }
|
|
136
|
-
finally {
|
|
137
|
-
try {
|
|
138
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
139
|
-
}
|
|
140
|
-
finally { if (e) throw e.error; }
|
|
141
|
-
}
|
|
142
|
-
return ar;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function __spread() {
|
|
146
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
147
|
-
ar = ar.concat(__read(arguments[i]));
|
|
148
|
-
return ar;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function __spreadArrays() {
|
|
152
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
153
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
154
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
155
|
-
r[k] = a[j];
|
|
156
|
-
return r;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
function __await(v) {
|
|
160
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
164
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
165
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
166
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
167
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
168
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
169
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
170
|
-
function fulfill(value) { resume("next", value); }
|
|
171
|
-
function reject(value) { resume("throw", value); }
|
|
172
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function __asyncDelegator(o) {
|
|
176
|
-
var i, p;
|
|
177
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
178
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function __asyncValues(o) {
|
|
182
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
183
|
-
var m = o[Symbol.asyncIterator], i;
|
|
184
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
185
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
186
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function __makeTemplateObject(cooked, raw) {
|
|
190
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
191
|
-
return cooked;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
function __importStar(mod) {
|
|
195
|
-
if (mod && mod.__esModule) return mod;
|
|
196
|
-
var result = {};
|
|
197
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
198
|
-
result.default = mod;
|
|
199
|
-
return result;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function __importDefault(mod) {
|
|
203
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function __classPrivateFieldGet(receiver, privateMap) {
|
|
207
|
-
if (!privateMap.has(receiver)) {
|
|
208
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
209
|
-
}
|
|
210
|
-
return privateMap.get(receiver);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
214
|
-
if (!privateMap.has(receiver)) {
|
|
215
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
216
|
-
}
|
|
217
|
-
privateMap.set(receiver, value);
|
|
218
|
-
return value;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* This is not a real service, but it looks like it from the outside.
|
|
223
|
-
* It's just an InjectionTToken used to import the config object, provided from the outside
|
|
224
|
-
*/
|
|
225
|
-
var MembrsConfigService = new core.InjectionToken("MembrsConfig");
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@nakedcreativity/membrs-angular-helper', ['exports', '@angular/core'], factory) :
|
|
4
|
+
(global = global || self, factory((global.nakedcreativity = global.nakedcreativity || {}, global.nakedcreativity['membrs-angular-helper'] = {}), global.ng.core));
|
|
5
|
+
}(this, (function (exports, i0) { 'use strict';
|
|
226
6
|
|
|
227
7
|
var MembrsService = /** @class */ (function () {
|
|
228
|
-
function MembrsService(
|
|
229
|
-
this.jwtService = jwtService;
|
|
230
|
-
this.http = http;
|
|
231
|
-
this.config = config;
|
|
232
|
-
this._lsKey = 'membrs';
|
|
233
|
-
console.log('membrs constructor');
|
|
234
|
-
// if the token exists in local storage, retrieve it back to the service
|
|
235
|
-
if (localStorage.getItem(this._lsKey)) {
|
|
236
|
-
this.token = localStorage.getItem(this._lsKey);
|
|
237
|
-
}
|
|
8
|
+
function MembrsService() {
|
|
238
9
|
}
|
|
239
|
-
MembrsService.prototype.reissue = function (token) {
|
|
240
|
-
var _this = this;
|
|
241
|
-
return new Promise(function (resolve, reject) {
|
|
242
|
-
if (!token && !_this._token) {
|
|
243
|
-
console.log('reject, not logged in');
|
|
244
|
-
reject('NOT_LOGGED_IN');
|
|
245
|
-
}
|
|
246
|
-
if (token)
|
|
247
|
-
_this.token = token;
|
|
248
|
-
// check stored token has not expired, or needs to be reissued soon
|
|
249
|
-
var reissueIn = _this._decoded.exp - Math.floor(Date.now() / 1000);
|
|
250
|
-
// token has expired
|
|
251
|
-
if (reissueIn < 0) {
|
|
252
|
-
reject('NOT_LOGGED_IN');
|
|
253
|
-
}
|
|
254
|
-
// token expiring soon
|
|
255
|
-
if (reissueIn < 300) {
|
|
256
|
-
console.log('expires less than 300');
|
|
257
|
-
console.log(_this.config);
|
|
258
|
-
_this.http.post(_this.config.apiProtocol + _this.config.api + '/token/' + _this._token, {}).subscribe(function (response) {
|
|
259
|
-
console.log('reissue response');
|
|
260
|
-
console.log(response);
|
|
261
|
-
if (response.token) {
|
|
262
|
-
_this.token = response.token;
|
|
263
|
-
resolve(_this._token);
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
console.log('error');
|
|
267
|
-
console.log(response);
|
|
268
|
-
reject('NOT_LOGGED_IN');
|
|
269
|
-
}
|
|
270
|
-
}, function (error) {
|
|
271
|
-
console.log(error);
|
|
272
|
-
reject('NOT_LOGGED_IN');
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
console.log('token ok');
|
|
277
|
-
resolve(_this._token);
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
};
|
|
281
|
-
Object.defineProperty(MembrsService.prototype, "token", {
|
|
282
|
-
set: function (token) {
|
|
283
|
-
this._token = token;
|
|
284
|
-
localStorage.setItem(this._lsKey, token);
|
|
285
|
-
this._decoded = this.jwtService.decodeToken(this._token);
|
|
286
|
-
},
|
|
287
|
-
enumerable: true,
|
|
288
|
-
configurable: true
|
|
289
|
-
});
|
|
290
|
-
Object.defineProperty(MembrsService.prototype, "profile", {
|
|
291
|
-
get: function () {
|
|
292
|
-
return this._decoded;
|
|
293
|
-
},
|
|
294
|
-
enumerable: true,
|
|
295
|
-
configurable: true
|
|
296
|
-
});
|
|
297
|
-
Object.defineProperty(MembrsService.prototype, "admin", {
|
|
298
|
-
get: function () {
|
|
299
|
-
return this.profile.permission == 1;
|
|
300
|
-
},
|
|
301
|
-
enumerable: true,
|
|
302
|
-
configurable: true
|
|
303
|
-
});
|
|
304
|
-
MembrsService.prototype.logout = function () {
|
|
305
|
-
var _this = this;
|
|
306
|
-
return new Promise(function (resolve, reject) {
|
|
307
|
-
_this.http.get(_this.config.apiProtocol + _this.config.api + '/token/' + _this._token + '/delete', { responseType: 'text' }).subscribe(function (response) {
|
|
308
|
-
_this._token = null;
|
|
309
|
-
localStorage.removeItem(_this._lsKey);
|
|
310
|
-
resolve(_this.config.login);
|
|
311
|
-
//this.router.stateService.go('dashboard')
|
|
312
|
-
}, function (error) {
|
|
313
|
-
reject(_this.config.login);
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
};
|
|
317
|
-
MembrsService.ctorParameters = function () { return [
|
|
318
|
-
{ type: angularJwt.JwtHelperService },
|
|
319
|
-
{ type: http.HttpClient },
|
|
320
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: [MembrsConfigService,] }] }
|
|
321
|
-
]; };
|
|
322
|
-
MembrsService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function MembrsService_Factory() { return new MembrsService(core["ɵɵinject"](jwthelper_service.JwtHelperService), core["ɵɵinject"](http.HttpClient), core["ɵɵinject"](MembrsConfigService)); }, token: MembrsService, providedIn: "root" });
|
|
323
|
-
MembrsService = __decorate([
|
|
324
|
-
core.Injectable({
|
|
325
|
-
providedIn: 'root'
|
|
326
|
-
}),
|
|
327
|
-
__param(2, core.Inject(MembrsConfigService)),
|
|
328
|
-
__metadata("design:paramtypes", [angularJwt.JwtHelperService, http.HttpClient, Object])
|
|
329
|
-
], MembrsService);
|
|
330
10
|
return MembrsService;
|
|
331
11
|
}());
|
|
12
|
+
MembrsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function MembrsService_Factory() { return new MembrsService(); }, token: MembrsService, providedIn: "root" });
|
|
13
|
+
MembrsService.decorators = [
|
|
14
|
+
{ type: i0.Injectable, args: [{
|
|
15
|
+
providedIn: 'root'
|
|
16
|
+
},] }
|
|
17
|
+
];
|
|
18
|
+
MembrsService.ctorParameters = function () { return []; };
|
|
332
19
|
|
|
333
|
-
function
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
function retrieveToken() {
|
|
348
|
-
return localStorage.getItem('membrs');
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
var validateResolve = {
|
|
352
|
-
token: 'reissue',
|
|
353
|
-
deps: [angular.Transition, angular.UIRouter, MembrsService, MembrsConfigService],
|
|
354
|
-
resolveFn: validateResolveFn
|
|
355
|
-
};
|
|
356
|
-
var reissueResolve = {
|
|
357
|
-
token: 'reissue',
|
|
358
|
-
deps: [angular.Transition, angular.UIRouter, MembrsService, MembrsConfigService],
|
|
359
|
-
resolveFn: reissueResolveFn
|
|
360
|
-
};
|
|
361
|
-
var reissueState = {
|
|
362
|
-
name: 'reissue',
|
|
363
|
-
url: '/reissue?token',
|
|
364
|
-
views: {},
|
|
365
|
-
resolve: [
|
|
366
|
-
reissueResolve
|
|
367
|
-
]
|
|
368
|
-
};
|
|
369
|
-
function reissueResolveFn(transition, router, membrsService, membrsConfig) {
|
|
370
|
-
//console.log(membrsService)
|
|
371
|
-
return new Promise(function (resolve, reject) {
|
|
372
|
-
console.log('reissue promise resolve');
|
|
373
|
-
console.log(transition.params().token);
|
|
374
|
-
membrsService.reissue(transition.params().token).then(function (response) {
|
|
375
|
-
console.log('redirect to default state');
|
|
376
|
-
router.stateService.go(membrsConfig.defaultState, {}, { inherit: false });
|
|
377
|
-
reject();
|
|
378
|
-
}).catch(function (error) {
|
|
379
|
-
console.log('error in reissue resolve');
|
|
380
|
-
console.log(error);
|
|
381
|
-
//window.location.href = environment.login
|
|
382
|
-
reject(error);
|
|
383
|
-
});
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
function validateResolveFn(transition, router, membrsService, membrsConfig) {
|
|
387
|
-
//console.log(membrsService)
|
|
388
|
-
return new Promise(function (resolve, reject) {
|
|
389
|
-
console.log('validate promise resolve');
|
|
390
|
-
membrsService.reissue().then(function (response) {
|
|
391
|
-
resolve();
|
|
392
|
-
}).catch(function (error) {
|
|
393
|
-
window.location.href = membrsConfig.login;
|
|
394
|
-
//reject(error)
|
|
395
|
-
});
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
/** The top level state(s) */
|
|
399
|
-
var STATES = [
|
|
400
|
-
reissueState
|
|
20
|
+
var MembrsComponent = /** @class */ (function () {
|
|
21
|
+
function MembrsComponent() {
|
|
22
|
+
}
|
|
23
|
+
MembrsComponent.prototype.ngOnInit = function () {
|
|
24
|
+
};
|
|
25
|
+
return MembrsComponent;
|
|
26
|
+
}());
|
|
27
|
+
MembrsComponent.decorators = [
|
|
28
|
+
{ type: i0.Component, args: [{
|
|
29
|
+
selector: 'lib-membrs',
|
|
30
|
+
template: "\n <p>\n membrs works!\n </p>\n "
|
|
31
|
+
},] }
|
|
401
32
|
];
|
|
33
|
+
MembrsComponent.ctorParameters = function () { return []; };
|
|
34
|
+
|
|
402
35
|
var MembrsModule = /** @class */ (function () {
|
|
403
36
|
function MembrsModule() {
|
|
404
37
|
}
|
|
405
|
-
MembrsModule_1 = MembrsModule;
|
|
406
|
-
MembrsModule.forRoot = function (config) {
|
|
407
|
-
var moduleProviders = angular.UIRouterModule.forChild({
|
|
408
|
-
states: STATES,
|
|
409
|
-
config: routerConfigFn
|
|
410
|
-
}).providers;
|
|
411
|
-
moduleProviders.push(angularJwt.JwtModule.forRoot({
|
|
412
|
-
config: {
|
|
413
|
-
tokenGetter: retrieveToken
|
|
414
|
-
}
|
|
415
|
-
}).providers);
|
|
416
|
-
moduleProviders.push(MembrsService);
|
|
417
|
-
moduleProviders.push({ provide: MembrsConfigService, useValue: config });
|
|
418
|
-
return {
|
|
419
|
-
ngModule: MembrsModule_1,
|
|
420
|
-
providers: [{ provide: MembrsConfigService, useValue: config }]
|
|
421
|
-
};
|
|
422
|
-
};
|
|
423
|
-
var MembrsModule_1;
|
|
424
|
-
MembrsModule = MembrsModule_1 = __decorate([
|
|
425
|
-
core.NgModule({
|
|
426
|
-
imports: [
|
|
427
|
-
common.CommonModule,
|
|
428
|
-
http.HttpClientModule
|
|
429
|
-
//JwtModule
|
|
430
|
-
// UIRouterModule.forChild({
|
|
431
|
-
// states: STATES,
|
|
432
|
-
// config: routerConfigFn,
|
|
433
|
-
// }),
|
|
434
|
-
// JwtModule.forRoot({})
|
|
435
|
-
]
|
|
436
|
-
})
|
|
437
|
-
], MembrsModule);
|
|
438
38
|
return MembrsModule;
|
|
439
39
|
}());
|
|
40
|
+
MembrsModule.decorators = [
|
|
41
|
+
{ type: i0.NgModule, args: [{
|
|
42
|
+
declarations: [MembrsComponent],
|
|
43
|
+
imports: [],
|
|
44
|
+
exports: [MembrsComponent]
|
|
45
|
+
},] }
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
* Public API Surface of membrs
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Generated bundle index. Do not edit.
|
|
54
|
+
*/
|
|
440
55
|
|
|
56
|
+
exports.MembrsComponent = MembrsComponent;
|
|
441
57
|
exports.MembrsModule = MembrsModule;
|
|
442
58
|
exports.MembrsService = MembrsService;
|
|
443
|
-
exports.STATES = STATES;
|
|
444
|
-
exports.reissueResolve = reissueResolve;
|
|
445
|
-
exports.reissueResolveFn = reissueResolveFn;
|
|
446
|
-
exports.reissueState = reissueState;
|
|
447
|
-
exports.retrieveToken = retrieveToken;
|
|
448
|
-
exports.validateResolve = validateResolve;
|
|
449
|
-
exports.validateResolveFn = validateResolveFn;
|
|
450
|
-
exports.ɵa = MembrsConfigService;
|
|
451
59
|
|
|
452
60
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
453
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nakedcreativity-membrs-angular-helper.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","ng://@nakedcreativity/membrs-angular-helper/lib/config.service.ts","ng://@nakedcreativity/membrs-angular-helper/lib/membrs.service.ts","ng://@nakedcreativity/membrs-angular-helper/lib/router.config.ts","ng://@nakedcreativity/membrs-angular-helper/lib/token.ts","ng://@nakedcreativity/membrs-angular-helper/lib/membrs.module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { InjectionToken } from '@angular/core';\nimport { MembrsConfig } from './config.interface';\n\n/**\n * This is not a real service, but it looks like it from the outside.\n * It's just an InjectionTToken used to import the config object, provided from the outside\n */\nexport const MembrsConfigService = new InjectionToken<MembrsConfig>(\"MembrsConfig\");\n","import { Injectable, Inject } from '@angular/core';\nimport { JwtHelperService } from '@auth0/angular-jwt';\nimport { HttpClient } from '@angular/common/http'\nimport { MembrsConfigService } from './config.service'\nimport { MembrsConfig } from './config.interface';\n\n@Injectable({\n providedIn: 'root'\n})\n\nexport class MembrsService {\n\n _token: string;\n _decoded: any;\n _lsKey: string = 'membrs';\n\n constructor(private jwtService: JwtHelperService, private http: HttpClient, @Inject(MembrsConfigService) private config: MembrsConfig) {\n\n console.log('membrs constructor')\n // if the token exists in local storage, retrieve it back to the service\n if(localStorage.getItem(this._lsKey)){\n this.token = localStorage.getItem(this._lsKey)\n }\n \n }\n\n reissue(token?:string){\n\n return new Promise((resolve, reject)=>{\n\n if(!token && !this._token){\n console.log('reject, not logged in')\n reject('NOT_LOGGED_IN')\n }\n\n if(token)\n this.token = token\n\n // check stored token has not expired, or needs to be reissued soon\n var reissueIn = this._decoded.exp - Math.floor(Date.now()/1000)\n \n // token has expired\n if(reissueIn < 0){\n reject('NOT_LOGGED_IN')\n }\n \n // token expiring soon\n if(reissueIn < 300){\n \n console.log('expires less than 300')\n \n \n console.log(this.config)\n\n this.http.post(this.config.apiProtocol + this.config.api+'/token/'+this._token, {}).subscribe((response:any)=>{\n console.log('reissue response')\n console.log(response)\n if(response.token){\n this.token = response.token\n resolve(this._token)\n }else {\n console.log('error')\n console.log(response)\n reject('NOT_LOGGED_IN')\n }\n \n }, error=>{\n console.log(error)\n reject('NOT_LOGGED_IN')\n })\n\n }else {\n console.log('token ok')\n resolve(this._token)\n }\n \n })\n \n }\n\n set token(token){\n this._token = token\n localStorage.setItem(this._lsKey, token)\n this._decoded = this.jwtService.decodeToken(this._token)\n }\n\n get profile(){\n return this._decoded\n }\n\n get admin (){\n return this.profile.permission == 1\n }\n\n logout(){\n return new Promise((resolve, reject)=>{\n this.http.get(this.config.apiProtocol+this.config.api+'/token/'+this._token+'/delete', {responseType: 'text'}).subscribe((response:any)=>{\n this._token = null;\n localStorage.removeItem(this._lsKey)\n resolve(this.config.login)\n //this.router.stateService.go('dashboard')\n }, error=>{\n reject(this.config.login)\n })\n })\n \n }\n\n\n}\n","import { UIRouter } from '@uirouter/core';\nimport { MembrsConfigService } from './config.service'\nimport { MembrsConfig } from './config.interface';\nimport { Injector } from '@angular/core';\n\nexport function routerConfigFn(router: UIRouter, injector: Injector) {\n\n const transitionService = router.transitionService;\n const stateService = router.stateService\n const config:MembrsConfig = injector.get(MembrsConfigService)\n\n \tstateService.defaultErrorHandler(function(error) {\n\t\t \n\t\tconsole.log('Default error handler - Membrs Angular Helper')\n\t\tconsole.log(error)\n\t\t\t\n\t\tif(error.detail == 'NOT_LOGGED_IN')\n\t\t\twindow.location.href = config.login;\n\n\t\tif(error.detail == 'INSUFFICIENT_PERMISSIONS')\n\t\t\tstateService.go(config.defaultState)\n\n\t});\n\t\n}","export function retrieveToken() {\n return localStorage.getItem('membrs');\n}","import { NgModule, ModuleWithProviders, Injector } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MembrsService } from './membrs.service';\nimport { JwtModule } from \"@auth0/angular-jwt\";\nimport { HttpClientModule } from \"@angular/common/http\";\nimport { UIRouterModule } from '@uirouter/angular'\n\nimport { Ng2StateDeclaration } from '@uirouter/angular';\nimport { Transition, UIRouter } from '@uirouter/angular'\n\nimport { routerConfigFn } from './router.config';\nimport { MembrsConfig } from './config.interface';\nimport { MembrsConfigService } from './config.service';\nimport { retrieveToken } from './token';\n\nexport const validateResolve = {\n token: 'reissue',\n deps: [ Transition, UIRouter, MembrsService, MembrsConfigService ],\n resolveFn: validateResolveFn\n}\n\nexport const reissueResolve = {\n token: 'reissue',\n deps: [ Transition, UIRouter, MembrsService, MembrsConfigService ],\n resolveFn: reissueResolveFn\n}\n\nexport const reissueState:Ng2StateDeclaration = {\n\tname: 'reissue', \n\turl: '/reissue?token',\n\tviews: { },\n\tresolve: [\n reissueResolve\n\t]\n}\n\nexport function reissueResolveFn(transition, router, membrsService, membrsConfig:MembrsConfig) {\n \n //console.log(membrsService)\n return new Promise((resolve, reject) => {\n console.log('reissue promise resolve')\n console.log(transition.params().token)\n membrsService.reissue(transition.params().token).then((response)=>{\n console.log('redirect to default state')\n router.stateService.go(membrsConfig.defaultState, {}, {inherit:false})\n reject()\n }).catch(error=>{\n console.log('error in reissue resolve')\n console.log(error)\n //window.location.href = environment.login\n reject(error)\n })\n\n\t})\n}\n\nexport function validateResolveFn(transition, router, membrsService, membrsConfig:MembrsConfig) {\n \n //console.log(membrsService)\n return new Promise((resolve, reject) => {\n console.log('validate promise resolve')\n \n membrsService.reissue().then((response)=>{\n resolve()\n }).catch(error=>{\n window.location.href = membrsConfig.login\n //reject(error)\n })\n\n})\n}\n\n\n/** The top level state(s) */\nexport const STATES = [\n reissueState\n]\n\n\n@NgModule({\n imports: [\n CommonModule,\n HttpClientModule\n //JwtModule\n // UIRouterModule.forChild({\n // states: STATES,\n // config: routerConfigFn,\n // }),\n // JwtModule.forRoot({})\n ]\n})\n\n\n\nexport class MembrsModule { \n static forRoot(config: MembrsConfig): ModuleWithProviders<MembrsModule> {\n\n\n const moduleProviders = UIRouterModule.forChild({\n states: STATES,\n config: routerConfigFn\n }).providers\n\n moduleProviders.push(JwtModule.forRoot({\n config: {\n tokenGetter: retrieveToken\n }\n }).providers)\n \n moduleProviders.push(MembrsService)\n moduleProviders.push({provide: MembrsConfigService,useValue: config});\n return {\n ngModule: MembrsModule, \n providers: [{provide: MembrsConfigService,useValue: config}]\n };\n \n }\n\n}\n"],"names":["InjectionToken","JwtHelperService","HttpClient","Inject","Injectable","Transition","UIRouter","UIRouterModule","JwtModule","NgModule","CommonModule","HttpClientModule"],"mappings":";;;;;;IAAA;IACA;IACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnF,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;AACF;IACO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAChC,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IAC3C,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;AACD;IACO,IAAI,QAAQ,GAAG,WAAW;IACjC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CAAC,CAAC,EAAE;IACrD,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AAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAA;;aAE5C,CAAC,CAAA;SAEL,CAAC,CAAA;IACF,CAAC;IAGD;AACA,QAAa,MAAM,GAAG;QAClB,YAAY;KACf,CAAA;AAkBD;QAAA;SAwBC;yBAxBY,YAAY;QAChB,oBAAO,GAAd,UAAe,MAAoB;YAGjC,IAAM,eAAe,GAAGC,sBAAc,CAAC,QAAQ,CAAC;gBAC5C,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,cAAc;aACvB,CAAC,CAAC,SAAS,CAAA;YAEd,eAAe,CAAC,IAAI,CAACC,oBAAS,CAAC,OAAO,CAAC;gBACrC,MAAM,EAAE;oBACN,WAAW,EAAE,aAAa;iBAC3B;aACF,CAAC,CAAC,SAAS,CAAC,CAAA;YAEb,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;YACpC,eAAe,CAAC,IAAI,CAAC,EAAC,OAAO,EAAE,mBAAmB,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAAC;YACrE,OAAO;gBACL,QAAQ,EAAE,cAAY;gBACtB,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,mBAAmB,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC;aAC7D,CAAC;SAEH;;QAtBU,YAAY;YAfxBC,aAAQ,CAAC;gBACR,OAAO,EAAE;oBACPC,mBAAY;oBACZC,qBAAgB;;;;;;;iBAOjB;aACF,CAAC;WAIW,YAAY,CAwBxB;QAAD,mBAAC;KAxBD;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"nakedcreativity-membrs-angular-helper.umd.js","sources":["../../../projects/membrs/src/lib/membrs.service.ts","../../../projects/membrs/src/lib/membrs.component.ts","../../../projects/membrs/src/lib/membrs.module.ts","../../../projects/membrs/src/public-api.ts","../../../projects/membrs/src/nakedcreativity-membrs-angular-helper.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class MembrsService {\n\n constructor() { }\n}\n","import { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'lib-membrs',\n template: `\n <p>\n membrs works!\n </p>\n `,\n styles: [\n ]\n})\nexport class MembrsComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit(): void {\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { MembrsComponent } from './membrs.component';\n\n\n\n@NgModule({\n declarations: [MembrsComponent],\n imports: [\n ],\n exports: [MembrsComponent]\n})\nexport class MembrsModule { }\n","/*\n * Public API Surface of membrs\n */\n\nexport * from './lib/membrs.service';\nexport * from './lib/membrs.component';\nexport * from './lib/membrs.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Injectable","Component","NgModule"],"mappings":";;;;;;;QAOE;SAAiB;;;;;gBALlBA,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;;QCUC;SAAiB;QAEjB,kCAAQ,GAAR;SACC;;;;gBAfFC,YAAS,SAAC;oBACT,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,8CAIT;iBAGF;;;;;QCAD;;;;;gBANCC,WAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,eAAe,CAAC;oBAC/B,OAAO,EAAE,EACR;oBACD,OAAO,EAAE,CAAC,eAAe,CAAC;iBAC3B;;;ICVD;;;;ICAA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
!function(e,
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
6
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
|
|
8
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
9
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
10
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
11
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
12
|
-
|
|
13
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
|
-
and limitations under the License.
|
|
15
|
-
***************************************************************************** */function c(e,t,o,n){var r,i=arguments.length,l=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(l=(i<3?r(l):i>3?r(t,o,l):r(t,o))||l);return i>3&&l&&Object.defineProperty(t,o,l),l}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}var a=new t.InjectionToken("MembrsConfig"),u=function(){function e(e,t,o){this.jwtService=e,this.http=t,this.config=o,this._lsKey="membrs",console.log("membrs constructor"),localStorage.getItem(this._lsKey)&&(this.token=localStorage.getItem(this._lsKey))}var i,l;return e.prototype.reissue=function(e){var t=this;return new Promise((function(o,n){e||t._token||(console.log("reject, not logged in"),n("NOT_LOGGED_IN")),e&&(t.token=e);var r=t._decoded.exp-Math.floor(Date.now()/1e3);r<0&&n("NOT_LOGGED_IN"),r<300?(console.log("expires less than 300"),console.log(t.config),t.http.post(t.config.apiProtocol+t.config.api+"/token/"+t._token,{}).subscribe((function(e){console.log("reissue response"),console.log(e),e.token?(t.token=e.token,o(t._token)):(console.log("error"),console.log(e),n("NOT_LOGGED_IN"))}),(function(e){console.log(e),n("NOT_LOGGED_IN")}))):(console.log("token ok"),o(t._token))}))},Object.defineProperty(e.prototype,"token",{set:function(e){this._token=e,localStorage.setItem(this._lsKey,e),this._decoded=this.jwtService.decodeToken(this._token)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"profile",{get:function(){return this._decoded},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"admin",{get:function(){return 1==this.profile.permission},enumerable:!0,configurable:!0}),e.prototype.logout=function(){var e=this;return new Promise((function(t,o){e.http.get(e.config.apiProtocol+e.config.api+"/token/"+e._token+"/delete",{responseType:"text"}).subscribe((function(o){e._token=null,localStorage.removeItem(e._lsKey),t(e.config.login)}),(function(t){o(e.config.login)}))}))},e.ctorParameters=function(){return[{type:o.JwtHelperService},{type:n.HttpClient},{type:void 0,decorators:[{type:t.Inject,args:[a]}]}]},e.ɵprov=t["ɵɵdefineInjectable"]({factory:function(){return new e(t["ɵɵinject"](r.JwtHelperService),t["ɵɵinject"](n.HttpClient),t["ɵɵinject"](a))},token:e,providedIn:"root"}),e=c([t.Injectable({providedIn:"root"}),(i=2,l=t.Inject(a),function(e,t){l(e,t,i)}),s("design:paramtypes",[o.JwtHelperService,n.HttpClient,Object])],e)}();function f(e,t){e.transitionService;var o=e.stateService,n=t.get(a);o.defaultErrorHandler((function(e){console.log("Default error handler - Membrs Angular Helper"),console.log(e),"NOT_LOGGED_IN"==e.detail&&(window.location.href=n.login),"INSUFFICIENT_PERMISSIONS"==e.detail&&o.go(n.defaultState)}))}function p(){return localStorage.getItem("membrs")}var g={token:"reissue",deps:[l.Transition,l.UIRouter,u,a],resolveFn:h},d={token:"reissue",deps:[l.Transition,l.UIRouter,u,a],resolveFn:v},m={name:"reissue",url:"/reissue?token",views:{},resolve:[d]};function v(e,t,o,n){return new Promise((function(r,i){console.log("reissue promise resolve"),console.log(e.params().token),o.reissue(e.params().token).then((function(e){console.log("redirect to default state"),t.stateService.go(n.defaultState,{},{inherit:!1}),i()})).catch((function(e){console.log("error in reissue resolve"),console.log(e),i(e)}))}))}function h(e,t,o,n){return new Promise((function(e,t){console.log("validate promise resolve"),o.reissue().then((function(t){e()})).catch((function(e){window.location.href=n.login}))}))}var y=[m],k=function(){function e(){}var r;return r=e,e.forRoot=function(e){var t=l.UIRouterModule.forChild({states:y,config:f}).providers;return t.push(o.JwtModule.forRoot({config:{tokenGetter:p}}).providers),t.push(u),t.push({provide:a,useValue:e}),{ngModule:r,providers:[{provide:a,useValue:e}]}},e=r=c([t.NgModule({imports:[i.CommonModule,n.HttpClientModule]})],e)}();e.MembrsModule=k,e.MembrsService=u,e.STATES=y,e.reissueResolve=d,e.reissueResolveFn=v,e.reissueState=m,e.retrieveToken=p,e.validateResolve=g,e.validateResolveFn=h,e.ɵa=a,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("@nakedcreativity/membrs-angular-helper",["exports","@angular/core"],r):r(((e=e||self).nakedcreativity=e.nakedcreativity||{},e.nakedcreativity["membrs-angular-helper"]={}),e.ng.core)}(this,(function(e,r){"use strict";var t=function(){};t.ɵprov=r.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]};var n=function(){function e(){}return e.prototype.ngOnInit=function(){},e}();n.decorators=[{type:r.Component,args:[{selector:"lib-membrs",template:"\n <p>\n membrs works!\n </p>\n "}]}],n.ctorParameters=function(){return[]};var o=function(){};o.decorators=[{type:r.NgModule,args:[{declarations:[n],imports:[],exports:[n]}]}],e.MembrsComponent=n,e.MembrsModule=o,e.MembrsService=t,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
2
|
//# sourceMappingURL=nakedcreativity-membrs-angular-helper.umd.min.js.map
|