@stonyx/oauth 0.1.1-beta.86 → 0.1.1-beta.88

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 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
@@ -4,7 +4,7 @@
4
4
  "stonyx-async",
5
5
  "stonyx-module"
6
6
  ],
7
- "version": "0.1.1-beta.86",
7
+ "version": "0.1.1-beta.88",
8
8
  "description": "OAuth2 authentication module for the Stonyx framework",
9
9
  "repository": {
10
10
  "type": "git",
@@ -61,7 +61,7 @@
61
61
  "@stonyx/rest-server": ">=0.2.1-beta.11"
62
62
  },
63
63
  "devDependencies": {
64
- "@stonyx/rest-server": "0.2.1-beta.60",
64
+ "@stonyx/rest-server": "0.2.1-beta.61",
65
65
  "@stonyx/utils": "0.2.3-beta.23",
66
66
  "@stonyx/logs": "1.0.1-beta.16",
67
67
  "@types/qunit": "^2.19.13",
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;
@@ -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
- const log: Record<string, ((...args: unknown[]) => void) | undefined>;
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