@rtsee/auth 0.0.60 → 0.0.62
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/dist/auth/src/index.d.ts +3 -0
- package/dist/auth/src/index.d.ts.map +1 -0
- package/dist/auth/src/index.js +19 -0
- package/dist/auth/src/index.js.map +1 -0
- package/dist/auth/src/interfaces/AuthConfiguration.d.ts +35 -0
- package/dist/auth/src/interfaces/AuthConfiguration.d.ts.map +1 -0
- package/dist/auth/src/interfaces/AuthConfiguration.js +59 -0
- package/dist/auth/src/interfaces/AuthConfiguration.js.map +1 -0
- package/dist/auth/src/interfaces/AuthErrors.d.ts +12 -0
- package/dist/auth/src/interfaces/AuthErrors.d.ts.map +1 -0
- package/dist/auth/src/interfaces/AuthErrors.js +20 -0
- package/dist/auth/src/interfaces/AuthErrors.js.map +1 -0
- package/dist/auth/src/interfaces/AuthRequests.d.ts +11 -0
- package/dist/auth/src/interfaces/AuthRequests.d.ts.map +1 -0
- package/dist/auth/src/interfaces/AuthRequests.js +3 -0
- package/dist/auth/src/interfaces/AuthRequests.js.map +1 -0
- package/dist/auth/src/interfaces/AuthResponses.d.ts +10 -0
- package/dist/auth/src/interfaces/AuthResponses.d.ts.map +1 -0
- package/dist/auth/src/interfaces/AuthResponses.js +3 -0
- package/dist/auth/src/interfaces/AuthResponses.js.map +1 -0
- package/dist/auth/src/interfaces/AuthUser.d.ts +5 -0
- package/dist/auth/src/interfaces/AuthUser.d.ts.map +1 -0
- package/dist/auth/src/interfaces/AuthUser.js +3 -0
- package/dist/auth/src/interfaces/AuthUser.js.map +1 -0
- package/dist/auth/src/interfaces/RTSeeAuthOptions.d.ts +7 -0
- package/dist/auth/src/interfaces/RTSeeAuthOptions.d.ts.map +1 -0
- package/dist/auth/src/interfaces/RTSeeAuthOptions.js +3 -0
- package/dist/auth/src/interfaces/RTSeeAuthOptions.js.map +1 -0
- package/dist/auth/src/interfaces/index.d.ts +7 -0
- package/dist/auth/src/interfaces/index.d.ts.map +1 -0
- package/dist/auth/src/interfaces/index.js +23 -0
- package/dist/auth/src/interfaces/index.js.map +1 -0
- package/dist/auth/src/models/RTSeeAuth.d.ts +16 -0
- package/dist/auth/src/models/RTSeeAuth.d.ts.map +1 -0
- package/dist/auth/src/models/RTSeeAuth.js +46 -0
- package/dist/auth/src/models/RTSeeAuth.js.map +1 -0
- package/dist/auth/src/models/RTSeeAuthConfiguration.d.ts +19 -0
- package/dist/auth/src/models/RTSeeAuthConfiguration.d.ts.map +1 -0
- package/dist/auth/src/models/RTSeeAuthConfiguration.js +80 -0
- package/dist/auth/src/models/RTSeeAuthConfiguration.js.map +1 -0
- package/dist/auth/src/models/RTSeeAuthUser.d.ts +13 -0
- package/dist/auth/src/models/RTSeeAuthUser.d.ts.map +1 -0
- package/dist/auth/src/models/RTSeeAuthUser.js +58 -0
- package/dist/auth/src/models/RTSeeAuthUser.js.map +1 -0
- package/dist/auth/src/models/index.d.ts +4 -0
- package/dist/auth/src/models/index.d.ts.map +1 -0
- package/dist/auth/src/models/index.js +20 -0
- package/dist/auth/src/models/index.js.map +1 -0
- package/dist/auth/src/models/strategies/index.d.ts +2 -0
- package/dist/auth/src/models/strategies/index.d.ts.map +1 -0
- package/dist/auth/src/models/strategies/index.js +18 -0
- package/dist/auth/src/models/strategies/index.js.map +1 -0
- package/dist/auth/src/models/strategies/jwt-strategy.d.ts +4 -0
- package/dist/auth/src/models/strategies/jwt-strategy.d.ts.map +1 -0
- package/dist/auth/src/models/strategies/jwt-strategy.js +4 -0
- package/dist/auth/src/models/strategies/jwt-strategy.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./models"), exports);
|
|
18
|
+
__exportStar(require("./interfaces"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const DEFAULT_AUTH_ROUTES_PREFIX: string;
|
|
2
|
+
export declare const DEFAULT_AUTH_ENDPOINT_PREFIX: string;
|
|
3
|
+
export declare enum AuthEndpointsKeys {
|
|
4
|
+
SIGN_IN = "signIn",
|
|
5
|
+
SIGN_UP = "signUp",
|
|
6
|
+
FORGOT_PASSWORD = "forgotPassword",
|
|
7
|
+
RESET_PASSWORD = "resetPassword",
|
|
8
|
+
PRIVACY_POLICY = "privacyPolicy"
|
|
9
|
+
}
|
|
10
|
+
export interface IAuthConfiguration {
|
|
11
|
+
appLogo: string;
|
|
12
|
+
baseUrl: string;
|
|
13
|
+
endpointsPrefix?: string;
|
|
14
|
+
endpointsConfig?: IRTSeeRouteConfig[];
|
|
15
|
+
routesPrefix?: string;
|
|
16
|
+
routesConfig?: IRTSeeRouteConfig[];
|
|
17
|
+
defaultPostLoginRoute?: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare const DEFAULT_ROUTE_NAMES: {
|
|
20
|
+
[key in AuthEndpointsKeys]: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const DEFAULT_ROUTE_FRIENDLY_NAMES: {
|
|
23
|
+
[key in AuthEndpointsKeys]: string;
|
|
24
|
+
};
|
|
25
|
+
export interface IRTSeeRouteConfig {
|
|
26
|
+
pageName: string;
|
|
27
|
+
pageRoute: string;
|
|
28
|
+
friendlyTitle?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface IRTSeeRoute extends IRTSeeRouteConfig {
|
|
31
|
+
path: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const DEFAULT_ROUTES_CONFIG: IRTSeeRouteConfig[];
|
|
34
|
+
export declare const DEFAULT_ENDPOINTS_CONFIG: IRTSeeRouteConfig[];
|
|
35
|
+
//# sourceMappingURL=AuthConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/AuthConfiguration.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,0BAA0B,EAAE,MAAe,CAAC;AACzD,eAAO,MAAM,4BAA4B,EAAE,MAAmC,CAAC;AAE/E,oBAAY,iBAAiB;IAC3B,OAAO,WAAW;IAClB,OAAO,WAAW;IAClB,eAAe,mBAAmB;IAClC,cAAc,kBAAkB;IAChC,cAAc,kBAAkB;CACjC;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAGhB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAItC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACnC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAElC;AAED,eAAO,MAAM,mBAAmB,EAAE;KAAG,GAAG,IAAI,iBAAiB,GAAG,MAAM;CAMrE,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE;KAAG,GAAG,IAAI,iBAAiB,GAAG,MAAM;CAM9E,CAAA;AAGD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACpD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,EA0BpD,CAAC;AAGF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,EAA0B,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a, _b;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DEFAULT_ENDPOINTS_CONFIG = exports.DEFAULT_ROUTES_CONFIG = exports.DEFAULT_ROUTE_FRIENDLY_NAMES = exports.DEFAULT_ROUTE_NAMES = exports.AuthEndpointsKeys = exports.DEFAULT_AUTH_ENDPOINT_PREFIX = exports.DEFAULT_AUTH_ROUTES_PREFIX = void 0;
|
|
5
|
+
// defaults match!
|
|
6
|
+
exports.DEFAULT_AUTH_ROUTES_PREFIX = 'auth';
|
|
7
|
+
exports.DEFAULT_AUTH_ENDPOINT_PREFIX = exports.DEFAULT_AUTH_ROUTES_PREFIX;
|
|
8
|
+
var AuthEndpointsKeys;
|
|
9
|
+
(function (AuthEndpointsKeys) {
|
|
10
|
+
AuthEndpointsKeys["SIGN_IN"] = "signIn";
|
|
11
|
+
AuthEndpointsKeys["SIGN_UP"] = "signUp";
|
|
12
|
+
AuthEndpointsKeys["FORGOT_PASSWORD"] = "forgotPassword";
|
|
13
|
+
AuthEndpointsKeys["RESET_PASSWORD"] = "resetPassword";
|
|
14
|
+
AuthEndpointsKeys["PRIVACY_POLICY"] = "privacyPolicy";
|
|
15
|
+
})(AuthEndpointsKeys || (exports.AuthEndpointsKeys = AuthEndpointsKeys = {}));
|
|
16
|
+
exports.DEFAULT_ROUTE_NAMES = (_a = {},
|
|
17
|
+
_a[AuthEndpointsKeys.SIGN_IN] = 'sign-in',
|
|
18
|
+
_a[AuthEndpointsKeys.SIGN_UP] = 'sign-up',
|
|
19
|
+
_a[AuthEndpointsKeys.FORGOT_PASSWORD] = 'forgot-password',
|
|
20
|
+
_a[AuthEndpointsKeys.RESET_PASSWORD] = 'reset-password/:token',
|
|
21
|
+
_a[AuthEndpointsKeys.PRIVACY_POLICY] = 'privacy-policy',
|
|
22
|
+
_a);
|
|
23
|
+
exports.DEFAULT_ROUTE_FRIENDLY_NAMES = (_b = {},
|
|
24
|
+
_b[AuthEndpointsKeys.SIGN_IN] = 'Sign In',
|
|
25
|
+
_b[AuthEndpointsKeys.SIGN_UP] = 'Sign Up',
|
|
26
|
+
_b[AuthEndpointsKeys.FORGOT_PASSWORD] = 'Forgot Password?',
|
|
27
|
+
_b[AuthEndpointsKeys.RESET_PASSWORD] = 'Reset Password',
|
|
28
|
+
_b[AuthEndpointsKeys.PRIVACY_POLICY] = 'Privacy Policy',
|
|
29
|
+
_b);
|
|
30
|
+
exports.DEFAULT_ROUTES_CONFIG = [
|
|
31
|
+
{
|
|
32
|
+
pageName: AuthEndpointsKeys.SIGN_IN,
|
|
33
|
+
pageRoute: exports.DEFAULT_ROUTE_NAMES[AuthEndpointsKeys.SIGN_IN],
|
|
34
|
+
friendlyTitle: exports.DEFAULT_ROUTE_FRIENDLY_NAMES[AuthEndpointsKeys.SIGN_IN]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
pageName: AuthEndpointsKeys.SIGN_UP,
|
|
38
|
+
pageRoute: exports.DEFAULT_ROUTE_NAMES[AuthEndpointsKeys.SIGN_UP],
|
|
39
|
+
friendlyTitle: exports.DEFAULT_ROUTE_FRIENDLY_NAMES[AuthEndpointsKeys.SIGN_UP]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
pageName: AuthEndpointsKeys.FORGOT_PASSWORD,
|
|
43
|
+
pageRoute: exports.DEFAULT_ROUTE_NAMES[AuthEndpointsKeys.FORGOT_PASSWORD],
|
|
44
|
+
friendlyTitle: exports.DEFAULT_ROUTE_FRIENDLY_NAMES[AuthEndpointsKeys.FORGOT_PASSWORD]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
pageName: AuthEndpointsKeys.RESET_PASSWORD,
|
|
48
|
+
pageRoute: exports.DEFAULT_ROUTE_NAMES[AuthEndpointsKeys.RESET_PASSWORD],
|
|
49
|
+
friendlyTitle: exports.DEFAULT_ROUTE_FRIENDLY_NAMES[AuthEndpointsKeys.RESET_PASSWORD]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
pageName: AuthEndpointsKeys.PRIVACY_POLICY,
|
|
53
|
+
pageRoute: exports.DEFAULT_ROUTE_NAMES[AuthEndpointsKeys.PRIVACY_POLICY],
|
|
54
|
+
friendlyTitle: exports.DEFAULT_ROUTE_FRIENDLY_NAMES[AuthEndpointsKeys.PRIVACY_POLICY]
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
// our default back-end endpoints and default ui routes are going to match!
|
|
58
|
+
exports.DEFAULT_ENDPOINTS_CONFIG = exports.DEFAULT_ROUTES_CONFIG;
|
|
59
|
+
//# sourceMappingURL=AuthConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthConfiguration.js","sourceRoot":"","sources":["../../../../src/interfaces/AuthConfiguration.ts"],"names":[],"mappings":";;;;AAAA,kBAAkB;AACL,QAAA,0BAA0B,GAAW,MAAM,CAAC;AAC5C,QAAA,4BAA4B,GAAW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CAAC,eAAe,CAAC;KAC/E;IACD;QACE,QAAQ,EAAE,iBAAiB,CAAC,cAAc;QAC1C,SAAS,EAAE,2BAAmB,CAAC,iBAAiB,CAAC,cAAc,CAAC;QAChE,aAAa,EAAE,oCAA4B,CAAC,iBAAiB,CAAC,cAAc,CAAC;KAC9E;IACD;QACE,QAAQ,EAAE,iBAAiB,CAAC,cAAc;QAC1C,SAAS,EAAE,2BAAmB,CAAC,iBAAiB,CAAC,cAAc,CAAC;QAChE,aAAa,EAAE,oCAA4B,CAAC,iBAAiB,CAAC,cAAc,CAAC;KAC9E;CACF,CAAC;AAEF,2EAA2E;AAC9D,QAAA,wBAAwB,GAAwB,6BAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum AuthErrorsCodes {
|
|
2
|
+
USER_ALREADY_EXISTS = "user-already-exists",
|
|
3
|
+
NO_USER_OR_WRONG_PASSWORD = "no-user-or-wrong-password"
|
|
4
|
+
}
|
|
5
|
+
export interface IAuthError {
|
|
6
|
+
text: string;
|
|
7
|
+
recommendation: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const authErrorMessages: {
|
|
10
|
+
[key in AuthErrorsCodes]: IAuthError;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=AuthErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthErrors.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/AuthErrors.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe;IACzB,mBAAmB,wBAAwB;IAC3C,yBAAyB,8BAA8B;CACxD;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,iBAAiB,EAAE;KAAE,GAAG,IAAI,eAAe,GAAG,UAAU;CASpE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.authErrorMessages = exports.AuthErrorsCodes = void 0;
|
|
5
|
+
var AuthErrorsCodes;
|
|
6
|
+
(function (AuthErrorsCodes) {
|
|
7
|
+
AuthErrorsCodes["USER_ALREADY_EXISTS"] = "user-already-exists";
|
|
8
|
+
AuthErrorsCodes["NO_USER_OR_WRONG_PASSWORD"] = "no-user-or-wrong-password";
|
|
9
|
+
})(AuthErrorsCodes || (exports.AuthErrorsCodes = AuthErrorsCodes = {}));
|
|
10
|
+
exports.authErrorMessages = (_a = {},
|
|
11
|
+
_a[AuthErrorsCodes.USER_ALREADY_EXISTS] = {
|
|
12
|
+
text: 'User with such email already exists.',
|
|
13
|
+
recommendation: 'You can try out the forgot password form!'
|
|
14
|
+
},
|
|
15
|
+
_a[AuthErrorsCodes.NO_USER_OR_WRONG_PASSWORD] = {
|
|
16
|
+
text: 'User with such email and password combination does not exist.',
|
|
17
|
+
recommendation: 'Try out the forgot password form or sign up!'
|
|
18
|
+
},
|
|
19
|
+
_a);
|
|
20
|
+
//# sourceMappingURL=AuthErrors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthErrors.js","sourceRoot":"","sources":["../../../../src/interfaces/AuthErrors.ts"],"names":[],"mappings":";;;;AAAA,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,8DAA2C,CAAA;IAC3C,0EAAuD,CAAA;AACzD,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AAOY,QAAA,iBAAiB;IAC5B,GAAC,eAAe,CAAC,mBAAmB,IAAG;QACrC,IAAI,EAAE,sCAAsC;QAC5C,cAAc,EAAE,2CAA2C;KAC5D;IACD,GAAC,eAAe,CAAC,yBAAyB,IAAG;QAC3C,IAAI,EAAE,+DAA+D;QACrE,cAAc,EAAE,8CAA8C;KAC/D;QACD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface IRtseeSignInRequestOptions {
|
|
2
|
+
username: string;
|
|
3
|
+
password: string;
|
|
4
|
+
remember?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface IRtseeSignUpRequestOptions {
|
|
7
|
+
email: string;
|
|
8
|
+
password: string;
|
|
9
|
+
terms: boolean;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=AuthRequests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthRequests.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/AuthRequests.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthRequests.js","sourceRoot":"","sources":["../../../../src/interfaces/AuthRequests.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IRTSeeAuthUser } from "@rtsee/auth";
|
|
2
|
+
export interface IRTSeeSignInResponse<T = any> {
|
|
3
|
+
user: IRTSeeAuthUser<T>;
|
|
4
|
+
token: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IRTSeeSignUpResponse {
|
|
7
|
+
token: string;
|
|
8
|
+
success: boolean;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=AuthResponses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthResponses.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/AuthResponses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,GAAG;IAC3C,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthResponses.js","sourceRoot":"","sources":["../../../../src/interfaces/AuthResponses.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthUser.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/AuthUser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,CAAC,CAAC;CACV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthUser.js","sourceRoot":"","sources":["../../../../src/interfaces/AuthUser.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IRTSeeAuthUser, RTSeeAuthConfiguration } from "@rtsee/auth";
|
|
2
|
+
export interface IRTSeeAuthOptions<T = any> {
|
|
3
|
+
authConfiguration: RTSeeAuthConfiguration;
|
|
4
|
+
onSignedIn(user: IRTSeeAuthUser<T>, token: string): void;
|
|
5
|
+
onSignedOut(): void;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=RTSeeAuthOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeAuthOptions.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/RTSeeAuthOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,sBAAsB,EAAC,MAAM,aAAa,CAAC;AAEnE,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,GAAG;IACxC,iBAAiB,EAAE,sBAAsB,CAAC;IAE1C,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACzD,WAAW,IAAI,IAAI,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeAuthOptions.js","sourceRoot":"","sources":["../../../../src/interfaces/RTSeeAuthOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./RTSeeAuthOptions"), exports);
|
|
18
|
+
__exportStar(require("./AuthResponses"), exports);
|
|
19
|
+
__exportStar(require("./AuthRequests"), exports);
|
|
20
|
+
__exportStar(require("./AuthUser"), exports);
|
|
21
|
+
__exportStar(require("./AuthErrors"), exports);
|
|
22
|
+
__exportStar(require("./AuthConfiguration"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,kDAAgC;AAChC,iDAA+B;AAC/B,6CAA2B;AAC3B,+CAA6B;AAC7B,sDAAoC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IRTSeeAuthOptions, IRTSeeAuthUser, IRTSeeSignInResponse, RTSeeAuthConfiguration, RTSeeAuthUser } from '@rtsee/auth';
|
|
2
|
+
export declare const LS_TOKEN_LABEL: string;
|
|
3
|
+
export declare const LS_USER_LABEL: string;
|
|
4
|
+
export declare class RTSeeAuth<T = any> implements IRTSeeAuthOptions<T> {
|
|
5
|
+
user: RTSeeAuthUser<T> | null;
|
|
6
|
+
token: string | null;
|
|
7
|
+
authConfiguration: RTSeeAuthConfiguration;
|
|
8
|
+
onSignedIn: (user: IRTSeeAuthUser<T>, token: string) => void;
|
|
9
|
+
onSignedOut: () => void;
|
|
10
|
+
constructor(options: IRTSeeAuthOptions<T>);
|
|
11
|
+
authenticate(response: IRTSeeSignInResponse<T>): void;
|
|
12
|
+
saveToBrowser(): void;
|
|
13
|
+
readFromBrowser(): void;
|
|
14
|
+
logOut(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=RTSeeAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeAuth.d.ts","sourceRoot":"","sources":["../../../../src/models/RTSeeAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EAAE,sBAAsB,EAC5C,aAAa,EACd,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,cAAc,EAAE,MAAsB,CAAC;AACpD,eAAO,MAAM,aAAa,EAAE,MAAqB,CAAC;AAElD,qBAAa,SAAS,CAAC,CAAC,GAAG,GAAG,CAAE,YAAW,iBAAiB,CAAC,CAAC,CAAC;IAC7D,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAQ;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC5B,iBAAiB,EAAE,sBAAsB,CAAC;IAE1C,UAAU,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,WAAW,EAAE,MAAM,IAAI,CAAC;gBAEZ,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAMzC,YAAY,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAQ9C,aAAa,IAAI,IAAI;IASrB,eAAe,IAAI,IAAI;IAUvB,MAAM;CAOP"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RTSeeAuth = exports.LS_USER_LABEL = exports.LS_TOKEN_LABEL = void 0;
|
|
4
|
+
var auth_1 = require("@rtsee/auth");
|
|
5
|
+
exports.LS_TOKEN_LABEL = 'rtsee-token';
|
|
6
|
+
exports.LS_USER_LABEL = 'rtsee-user';
|
|
7
|
+
var RTSeeAuth = /** @class */ (function () {
|
|
8
|
+
function RTSeeAuth(options) {
|
|
9
|
+
this.user = null;
|
|
10
|
+
this.token = null;
|
|
11
|
+
this.authConfiguration = options.authConfiguration;
|
|
12
|
+
this.onSignedIn = options.onSignedIn;
|
|
13
|
+
this.readFromBrowser();
|
|
14
|
+
}
|
|
15
|
+
RTSeeAuth.prototype.authenticate = function (response) {
|
|
16
|
+
this.user = new auth_1.RTSeeAuthUser(response.user);
|
|
17
|
+
this.token = response.token;
|
|
18
|
+
this.onSignedIn(this.user, this.token);
|
|
19
|
+
this.saveToBrowser();
|
|
20
|
+
};
|
|
21
|
+
RTSeeAuth.prototype.saveToBrowser = function () {
|
|
22
|
+
if (!this.token || !this.user) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
localStorage.setItem(exports.LS_TOKEN_LABEL, this.token);
|
|
26
|
+
localStorage.setItem(exports.LS_USER_LABEL, JSON.stringify(this.user.toJSON()));
|
|
27
|
+
};
|
|
28
|
+
RTSeeAuth.prototype.readFromBrowser = function () {
|
|
29
|
+
var userData = localStorage.getItem(exports.LS_USER_LABEL);
|
|
30
|
+
var token = localStorage.getItem(exports.LS_TOKEN_LABEL);
|
|
31
|
+
if (!userData || !token) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
var user = JSON.parse(userData);
|
|
35
|
+
this.authenticate({ user: user, token: token });
|
|
36
|
+
};
|
|
37
|
+
RTSeeAuth.prototype.logOut = function () {
|
|
38
|
+
this.user = null;
|
|
39
|
+
this.token = null;
|
|
40
|
+
localStorage.removeItem(exports.LS_USER_LABEL);
|
|
41
|
+
localStorage.removeItem(exports.LS_TOKEN_LABEL);
|
|
42
|
+
};
|
|
43
|
+
return RTSeeAuth;
|
|
44
|
+
}());
|
|
45
|
+
exports.RTSeeAuth = RTSeeAuth;
|
|
46
|
+
//# sourceMappingURL=RTSeeAuth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeAuth.js","sourceRoot":"","sources":["../../../../src/models/RTSeeAuth.ts"],"names":[],"mappings":";;;AAAA,oCAKqB;AAER,QAAA,cAAc,GAAW,aAAa,CAAC;AACvC,QAAA,aAAa,GAAW,YAAY,CAAC;AAElD;IAQE,mBAAY,OAA6B;QAPzC,SAAI,GAA4B,IAAI,CAAC;QACrC,UAAK,GAAkB,IAAI,C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AC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,YAAY,CAAC,UAAU,CAAC,qBAAa,CAAC,CAAC;QACvC,YAAY,CAAC,UAAU,CAAC,sBAAc,CAAC,CAAC;IAC1C,CAAC;IACH,gBAAC;AAAD,CAAC,AAhDD,IAgDC;AAhDY,8BAAS"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IAuthConfiguration, IRTSeeRoute, IRTSeeRouteConfig } from "@rtsee/auth";
|
|
2
|
+
export declare class RTSeeAuthConfiguration implements IAuthConfiguration {
|
|
3
|
+
appLogo: string;
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
endpointsPrefix: string;
|
|
6
|
+
endpointsConfig: IRTSeeRouteConfig[];
|
|
7
|
+
endpoints: IRTSeeRoute[];
|
|
8
|
+
routesPrefix: string;
|
|
9
|
+
routesConfig: IRTSeeRouteConfig[];
|
|
10
|
+
routes: IRTSeeRoute[];
|
|
11
|
+
defaultPostLoginRoute: string[];
|
|
12
|
+
constructor(options: IAuthConfiguration);
|
|
13
|
+
getRoutePath(pageName: string): string;
|
|
14
|
+
getRoutePathSplit(pageName: string): string[];
|
|
15
|
+
getEndpointPathByEndpointName(name: string): string;
|
|
16
|
+
private composeRoutes;
|
|
17
|
+
private composeEndpoints;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=RTSeeAuthConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeAuthConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/models/RTSeeAuthConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,qBAAa,sBAAuB,YAAW,kBAAkB;IAE/D,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,iBAAiB,EAAE,CAAC;IACrC,SAAS,EAAE,WAAW,EAAE,CAAC;IAKzB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,qBAAqB,EAAE,MAAM,EAAE,CAAC;gBAGpB,OAAO,EAAE,kBAAkB;IAkBvC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAStC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;IAU7C,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAOnD,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,gBAAgB;CAQzB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.RTSeeAuthConfiguration = void 0;
|
|
24
|
+
var auth_1 = require("@rtsee/auth");
|
|
25
|
+
var RTSeeAuthConfiguration = /** @class */ (function () {
|
|
26
|
+
// UI Routes Config END
|
|
27
|
+
function RTSeeAuthConfiguration(options) {
|
|
28
|
+
this.appLogo = options.appLogo;
|
|
29
|
+
// endpoints
|
|
30
|
+
this.baseUrl = options.baseUrl;
|
|
31
|
+
this.endpointsPrefix = options.endpointsPrefix || auth_1.DEFAULT_AUTH_ENDPOINT_PREFIX;
|
|
32
|
+
this.endpointsConfig = options.endpointsConfig || auth_1.DEFAULT_ENDPOINTS_CONFIG;
|
|
33
|
+
this.endpoints = this.composeEndpoints();
|
|
34
|
+
// routes
|
|
35
|
+
this.routesPrefix = options.routesPrefix || auth_1.DEFAULT_AUTH_ROUTES_PREFIX;
|
|
36
|
+
this.routesConfig = options.routesConfig || auth_1.DEFAULT_ROUTES_CONFIG;
|
|
37
|
+
this.routes = this.composeRoutes();
|
|
38
|
+
this.defaultPostLoginRoute = options.defaultPostLoginRoute || ['/'];
|
|
39
|
+
}
|
|
40
|
+
RTSeeAuthConfiguration.prototype.getRoutePath = function (pageName) {
|
|
41
|
+
var route = this.routes
|
|
42
|
+
.find(function (r) { return r.pageName === pageName; }) || null;
|
|
43
|
+
if (!route) {
|
|
44
|
+
throw new Error("Route \"".concat(pageName, "\" Not Found!"));
|
|
45
|
+
}
|
|
46
|
+
return route.pageRoute;
|
|
47
|
+
};
|
|
48
|
+
RTSeeAuthConfiguration.prototype.getRoutePathSplit = function (pageName) {
|
|
49
|
+
var route = this.routes
|
|
50
|
+
.find(function (r) { return r.pageName === pageName; }) || null;
|
|
51
|
+
if (!route) {
|
|
52
|
+
throw new Error("Route \"".concat(pageName, "\" Not Found!"));
|
|
53
|
+
}
|
|
54
|
+
var path = route.path.split('/');
|
|
55
|
+
return __spreadArray(['/'], path, true);
|
|
56
|
+
};
|
|
57
|
+
RTSeeAuthConfiguration.prototype.getEndpointPathByEndpointName = function (name) {
|
|
58
|
+
var endpoint = this.endpoints
|
|
59
|
+
.find(function (e) { return e.pageName === name; }) || null;
|
|
60
|
+
if (!endpoint) {
|
|
61
|
+
throw new Error("Endpoint \"".concat(name, "\" Not Found!"));
|
|
62
|
+
}
|
|
63
|
+
return endpoint.path;
|
|
64
|
+
};
|
|
65
|
+
RTSeeAuthConfiguration.prototype.composeRoutes = function () {
|
|
66
|
+
var _this = this;
|
|
67
|
+
return this.routesConfig.map(function (rc) {
|
|
68
|
+
return __assign(__assign({}, rc), { path: "".concat(_this.routesPrefix, "/").concat(rc.pageRoute) });
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
RTSeeAuthConfiguration.prototype.composeEndpoints = function () {
|
|
72
|
+
var _this = this;
|
|
73
|
+
return this.endpointsConfig.map(function (ec) {
|
|
74
|
+
return __assign(__assign({}, ec), { path: "".concat(_this.baseUrl, "/").concat(_this.endpointsPrefix, "/").concat(ec.pageRoute) });
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
return RTSeeAuthConfiguration;
|
|
78
|
+
}());
|
|
79
|
+
exports.RTSeeAuthConfiguration = RTSeeAuthConfiguration;
|
|
80
|
+
//# sourceMappingURL=RTSeeAuthConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeAuthConfiguration.js","sourceRoot":"","sources":["../../../../src/models/RTSeeAuthConfiguration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAQqB;AAErB;IAeE,uBAAuB;IAEvB,gCAAY,OAA2B;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAE/B,YAAY;QACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,mCAA4B,CAAC;QAC/E,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,+BAAwB,CAAC;QAC3E,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC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,KAAK,IAAI,EAAnB,CAAmB,CAAC,IAAI,IAAI,CAAC;QAC1C,IAAI,CAAC,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,qBAAa,IAAI,kBAAc,CAAC,CAAC;QAAC,CAAC;QACpE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAEO,8CAAa,GAArB;QAAA,iBAOC;QANC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAC,EAAE;YAC9B,6BACK,EAAE,KACL,IAAI,EAAE,UAAG,KAAI,CAAC,YAAY,cAAI,EAAE,CAAC,SAAS,CAAE,IAC7C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,iDAAgB,GAAxB;QAAA,iBAOC;QANC,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,UAAC,EAAE;YACjC,6BACK,EAAE,KACL,IAAI,EAAE,UAAG,KAAI,CAAC,OAAO,cAAI,KAAI,CAAC,eAAe,cAAI,EAAE,CAAC,SAAS,CAAE,IAChE;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,6BAAC;AAAD,CAAC,AA9ED,IA8EC;AA9EY,wDAAsB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IRTSeeAuthUser } from "@rtsee/auth";
|
|
2
|
+
export declare class RTSeeAuthUser<T> implements IRTSeeAuthUser<T> {
|
|
3
|
+
clientId: string;
|
|
4
|
+
name: string | null;
|
|
5
|
+
imageUrl: string | null;
|
|
6
|
+
url: string | null;
|
|
7
|
+
sessionId: string | null;
|
|
8
|
+
isAnonymous: boolean;
|
|
9
|
+
data?: T;
|
|
10
|
+
constructor(options: IRTSeeAuthUser<T>);
|
|
11
|
+
toJSON(): IRTSeeAuthUser<T>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=RTSeeAuthUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeAuthUser.d.ts","sourceRoot":"","sources":["../../../../src/models/RTSeeAuthUser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAE3C,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,cAAc,CAAC,CAAC,CAAC;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC/B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAChC,WAAW,EAAE,OAAO,CAAS;IAE7B,IAAI,CAAC,EAAE,CAAC,CAAC;gBAEG,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;IAWtC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CA+B5B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RTSeeAuthUser = void 0;
|
|
4
|
+
var RTSeeAuthUser = /** @class */ (function () {
|
|
5
|
+
function RTSeeAuthUser(options) {
|
|
6
|
+
this.name = null;
|
|
7
|
+
this.imageUrl = null;
|
|
8
|
+
this.url = null;
|
|
9
|
+
this.sessionId = null;
|
|
10
|
+
this.isAnonymous = false;
|
|
11
|
+
this.clientId = options.clientId;
|
|
12
|
+
if (options.name) {
|
|
13
|
+
this.name = options.name;
|
|
14
|
+
}
|
|
15
|
+
if (options.imageUrl) {
|
|
16
|
+
this.imageUrl = options.imageUrl;
|
|
17
|
+
}
|
|
18
|
+
if (options.url) {
|
|
19
|
+
this.url = options.url;
|
|
20
|
+
}
|
|
21
|
+
if (options.sessionId) {
|
|
22
|
+
this.sessionId = options.sessionId;
|
|
23
|
+
}
|
|
24
|
+
if (options.isAnonymous) {
|
|
25
|
+
this.isAnonymous = options.isAnonymous;
|
|
26
|
+
}
|
|
27
|
+
if (options.data) {
|
|
28
|
+
this.data = options.data;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
RTSeeAuthUser.prototype.toJSON = function () {
|
|
32
|
+
var userInfo = {
|
|
33
|
+
clientId: this.clientId,
|
|
34
|
+
};
|
|
35
|
+
if (this.name) {
|
|
36
|
+
userInfo.name = this.name;
|
|
37
|
+
}
|
|
38
|
+
if (this.imageUrl) {
|
|
39
|
+
userInfo.imageUrl = this.imageUrl;
|
|
40
|
+
}
|
|
41
|
+
if (this.url) {
|
|
42
|
+
userInfo.url = this.url;
|
|
43
|
+
}
|
|
44
|
+
if (this.sessionId) {
|
|
45
|
+
userInfo.sessionId = this.sessionId;
|
|
46
|
+
}
|
|
47
|
+
if (this.isAnonymous) {
|
|
48
|
+
userInfo.isAnonymous = this.isAnonymous;
|
|
49
|
+
}
|
|
50
|
+
if (this.data) {
|
|
51
|
+
userInfo.data = this.data;
|
|
52
|
+
}
|
|
53
|
+
return userInfo;
|
|
54
|
+
};
|
|
55
|
+
return RTSeeAuthUser;
|
|
56
|
+
}());
|
|
57
|
+
exports.RTSeeAuthUser = RTSeeAuthUser;
|
|
58
|
+
//# sourceMappingURL=RTSeeAuthUser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeAuthUser.js","sourceRoot":"","sources":["../../../../src/models/RTSeeAuthUser.ts"],"names":[],"mappings":";;;AAEA;IAUE,uBAAY,OAA0B;QARtC,SAAI,GAAkB,IAAI,CAAC;QAC3B,aAAQ,GAAkB,IAAI,CAAC;QAC/B,QAAG,GAAkB,IAAI,CAAC;QAC1B,cAAS,GAAkB,IAAI,CAAC;QAChC,gBAAW,GAAY,KAAK,CAAC;QAK3B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YAAC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAAC,CAAC;QAC/C,IA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YACd,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;QAC3B,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IACH,oBAAC;AAAD,CAAC,AApDD,IAoDC;AApDY,sCAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./RTSeeAuth"), exports);
|
|
18
|
+
__exportStar(require("./RTSeeAuthUser"), exports);
|
|
19
|
+
__exportStar(require("./RTSeeAuthConfiguration"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,kDAAgC;AAChC,2DAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/models/strategies/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./jwt-strategy"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/models/strategies/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwt-strategy.d.ts","sourceRoot":"","sources":["../../../../../src/models/strategies/jwt-strategy.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;CAGrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwt-strategy.js","sourceRoot":"","sources":["../../../../../src/models/strategies/jwt-strategy.ts"],"names":[],"mappings":";AAAA,yEAAyE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rtsee/auth",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.62",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/auth/src/index",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "07cce216164a8c6a5639bf0e54e8ad7f71c9d6db"
|
|
45
45
|
}
|