@stonyx/oauth 0.1.1-beta.85 → 0.1.1-beta.87
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/main.js +4 -0
- package/package.json +1 -1
- package/src/main.ts +5 -0
- package/src/types/stonyx.d.ts +8 -1
package/dist/main.js
CHANGED
|
@@ -19,6 +19,10 @@ export default class OAuth {
|
|
|
19
19
|
OAuth.instance = this;
|
|
20
20
|
}
|
|
21
21
|
async init() {
|
|
22
|
+
// Self-register so log.oauth works even when @stonyx/oauth is in the
|
|
23
|
+
// consumer's `dependencies` (stonyx loader only merges devDependencies).
|
|
24
|
+
const { logColor = 'magenta', logMethod = 'oauth' } = config.oauth;
|
|
25
|
+
log.defineType(logMethod, logColor);
|
|
22
26
|
const oauthConfig = config.oauth;
|
|
23
27
|
const { providers, sessionDuration, frontendCallbackUrl } = oauthConfig;
|
|
24
28
|
this.frontendCallbackUrl = frontendCallbackUrl;
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -34,6 +34,11 @@ export default class OAuth {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
async init(): Promise<void> {
|
|
37
|
+
// Self-register so log.oauth works even when @stonyx/oauth is in the
|
|
38
|
+
// consumer's `dependencies` (stonyx loader only merges devDependencies).
|
|
39
|
+
const { logColor = 'magenta', logMethod = 'oauth' } = config.oauth;
|
|
40
|
+
log.defineType(logMethod, logColor);
|
|
41
|
+
|
|
37
42
|
const oauthConfig = config.oauth;
|
|
38
43
|
const { providers, sessionDuration, frontendCallbackUrl } = oauthConfig;
|
|
39
44
|
this.frontendCallbackUrl = frontendCallbackUrl;
|
package/src/types/stonyx.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ declare module 'stonyx/config' {
|
|
|
3
3
|
providers: Record<string, { module?: string; [key: string]: unknown }>;
|
|
4
4
|
sessionDuration: number;
|
|
5
5
|
frontendCallbackUrl?: string;
|
|
6
|
+
logColor?: string;
|
|
7
|
+
logMethod?: string;
|
|
6
8
|
}
|
|
7
9
|
interface Config {
|
|
8
10
|
oauth: OAuthConfig;
|
|
@@ -14,7 +16,12 @@ declare module 'stonyx/config' {
|
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
declare module 'stonyx/log' {
|
|
17
|
-
|
|
19
|
+
interface Log {
|
|
20
|
+
oauth(message: string): void;
|
|
21
|
+
defineType(type: string, setting: string, options?: Record<string, unknown> | null): void;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
const log: Log;
|
|
18
25
|
export default log;
|
|
19
26
|
}
|
|
20
27
|
|