@multiplatform.one/keycloak 7.28.1 → 7.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -537,8 +537,8 @@ var KeycloakContext = (0, import_react4.createContext)(void 0);
537
537
  // src/keycloak/base.ts
538
538
  var BaseKeycloak = class {
539
539
  constructor(config, input, idToken, refreshToken, login, logout) {
540
- this.config = config;
541
540
  this.authenticated = false;
541
+ this.config = config;
542
542
  this.clientId = this.config.clientId;
543
543
  this.realm = this.config.realm;
544
544
  if (typeof input === "string") {
@@ -423,8 +423,8 @@ var KeycloakContext = (0, import_react3.createContext)(void 0);
423
423
  // src/keycloak/base.ts
424
424
  var BaseKeycloak = class {
425
425
  constructor(config, input, idToken, refreshToken, login, logout) {
426
- this.config = config;
427
426
  this.authenticated = false;
427
+ this.config = config;
428
428
  this.clientId = this.config.clientId;
429
429
  this.realm = this.config.realm;
430
430
  if (typeof input === "string") {
package/dist/esm/index.js CHANGED
@@ -487,8 +487,8 @@ var KeycloakContext = createContext2(void 0);
487
487
  // src/keycloak/base.ts
488
488
  var BaseKeycloak = class {
489
489
  constructor(config, input, idToken, refreshToken, login, logout) {
490
- this.config = config;
491
490
  this.authenticated = false;
491
+ this.config = config;
492
492
  this.clientId = this.config.clientId;
493
493
  this.realm = this.config.realm;
494
494
  if (typeof input === "string") {
@@ -378,8 +378,8 @@ var KeycloakContext = createContext2(void 0);
378
378
  // src/keycloak/base.ts
379
379
  var BaseKeycloak = class {
380
380
  constructor(config, input, idToken, refreshToken, login, logout) {
381
- this.config = config;
382
381
  this.authenticated = false;
382
+ this.config = config;
383
383
  this.clientId = this.config.clientId;
384
384
  this.realm = this.config.realm;
385
385
  if (typeof input === "string") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/keycloak",
3
- "version": "7.28.1",
3
+ "version": "7.29.0",
4
4
  "description": "keycloak client for multiplatform.one ecosystem",
5
5
  "keywords": [
6
6
  "auth",
@@ -57,16 +57,16 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@better-auth/expo": "^1.6.9",
60
- "@multiplatform.one/keycloak-js": "7.28.1",
61
- "@multiplatform.one/store": "7.28.1",
60
+ "@multiplatform.one/keycloak-js": "7.29.0",
61
+ "@multiplatform.one/store": "7.29.0",
62
62
  "better-auth": "^1.6.9",
63
63
  "jwt-decode": "^4.0.0"
64
64
  },
65
65
  "devDependencies": {
66
- "@multiplatform.one/config": "7.28.1",
67
- "@multiplatform.one/logger": "7.28.1",
68
- "@multiplatform.one/platform": "7.28.1",
69
- "@multiplatform.one/test-utils": "7.28.1",
66
+ "@multiplatform.one/config": "7.29.0",
67
+ "@multiplatform.one/logger": "7.29.0",
68
+ "@multiplatform.one/platform": "7.29.0",
69
+ "@multiplatform.one/test-utils": "7.29.0",
70
70
  "@tamagui/build": "2.7.6",
71
71
  "@testing-library/jest-dom": "^6.9.1",
72
72
  "@testing-library/react": "^16.3.2",
@@ -80,8 +80,8 @@
80
80
  "vitest": "^4.1.5"
81
81
  },
82
82
  "peerDependencies": {
83
- "@multiplatform.one/logger": "^7.28.1",
84
- "@multiplatform.one/platform": "^7.28.1",
83
+ "@multiplatform.one/logger": "^7.29.0",
84
+ "@multiplatform.one/platform": "^7.29.0",
85
85
  "react": "^19.1.0",
86
86
  "react-native": ">=0.83.0"
87
87
  },
@@ -33,15 +33,17 @@ export class BaseKeycloak {
33
33
  protected _login?: (_options: KeycloakLoginOptions) => Promise<undefined>;
34
34
  protected _logout?: (_options: KeycloakLogoutOptions) => Promise<undefined>;
35
35
  protected _mock?: KeycloakMock;
36
+ public readonly config: KeycloakConfig;
36
37
 
37
38
  constructor(
38
- public readonly config: KeycloakConfig,
39
+ config: KeycloakConfig,
39
40
  input?: string | KeycloakClient | KeycloakMock | Session,
40
41
  idToken?: string,
41
42
  refreshToken?: string,
42
43
  login?: (_options: KeycloakLoginOptions) => Promise<undefined>,
43
44
  logout?: (_options: KeycloakLogoutOptions) => Promise<undefined>,
44
45
  ) {
46
+ this.config = config;
45
47
  this.clientId = this.config.clientId;
46
48
  this.realm = this.config.realm;
47
49
  if (typeof input === "string") {
@@ -5,14 +5,14 @@
5
5
 
6
6
  /** An OAuth 2.0 / OIDC protocol failure, carrying the spec's `error` code. */
7
7
  export class OAuthError extends Error {
8
- constructor(
9
- /** The `error` field from the authorization or token response. */
10
- public readonly code: string,
11
- message?: string,
12
- /** The `error_description` field, when the server sent one. */
13
- public readonly description?: string,
14
- ) {
8
+ /** The `error` field from the authorization or token response. */
9
+ public readonly code: string;
10
+ /** The `error_description` field, when the server sent one. */
11
+ public readonly description?: string;
12
+ constructor(code: string, message?: string, description?: string) {
15
13
  super(message ?? description ?? code);
16
14
  this.name = "OAuthError";
15
+ this.code = code;
16
+ this.description = description;
17
17
  }
18
18
  }
@@ -5,7 +5,6 @@ import type { AccessTokenParsed, TokenParsed } from "../token";
5
5
  import type { KeycloakMock } from "../types";
6
6
  import type { KeycloakConfig } from "./config";
7
7
  export declare class BaseKeycloak {
8
- readonly config: KeycloakConfig;
9
8
  authenticated: boolean;
10
9
  clientId: string;
11
10
  email?: string;
@@ -25,6 +24,7 @@ export declare class BaseKeycloak {
25
24
  protected _login?: (_options: KeycloakLoginOptions) => Promise<undefined>;
26
25
  protected _logout?: (_options: KeycloakLogoutOptions) => Promise<undefined>;
27
26
  protected _mock?: KeycloakMock;
27
+ readonly config: KeycloakConfig;
28
28
  constructor(config: KeycloakConfig, input?: string | KeycloakClient | KeycloakMock | Session, idToken?: string, refreshToken?: string, login?: (_options: KeycloakLoginOptions) => Promise<undefined>, logout?: (_options: KeycloakLogoutOptions) => Promise<undefined>);
29
29
  protected _handleInputObject(input: KeycloakClient | KeycloakMock | Session): void;
30
30
  protected _parseTokens(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/keycloak/base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc,MAAM,gCAAgC,CA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CAAC,EAC9D,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,OAAO,CAAC,SAAS,CAAC;IAkBlE,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,GAAG,OAAO;IAQ3E,SAAS,CAAC,YAAY;IAYtB,SAAS,CAAC,MAAM;IAgBhB,SAAS,CAAC,KAAK;IA0CT,WAAW;IAeX,KAAK,CAAC,OAAO,GAAE,oBAAyB;IAUxC,MAAM,CAAC,OAAO,GAAE,qBAA0B;CAQjD;AAED,wBAAgB,WAAW,4CAI1B;AAED,MAAM,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC5D,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEnF,MAAM,WAAW,cAAc;IAC7B,CAAC,QAAQ,EAAE,MAAM,GAAG;QAClB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;CACH;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB"}
@@ -7,11 +7,7 @@ export declare class OAuthError extends Error {
7
7
  /** The `error` field from the authorization or token response. */
8
8
  readonly code: string;
9
9
  /** The `error_description` field, when the server sent one. */
10
- readonly description?: string | undefined;
11
- constructor(
12
- /** The `error` field from the authorization or token response. */
13
- code: string, message?: string,
14
- /** The `error_description` field, when the server sent one. */
15
- description?: string | undefined);
10
+ readonly description?: string;
11
+ constructor(code: string, message?: string, description?: string);
16
12
  }
17
13
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/oauth/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,8EAA8E;AAC9E,qBAAa,UAAW,SAAQ,KAAK;IAEjC,kEAAkE;aAClD,IAAI,EAAE,MAAM;IAE5B,+DAA+D;aAC/C,WAAW,CAAC,EAAE,MAAM;;IAJpC,kEAAkE;IAClD,IAAI,EAAE,MAAM,EAC5B,OAAO,CAAC,EAAE,MAAM;IAChB,+DAA+D;IAC/C,WAAW,CAAC,EAAE,MAAM,YAAA;CAKvC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/oauth/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,8EAA8E;AAC9E,qBAAa,UAAW,SAAQ,KAAK;IACnC,kEAAkE;IAClE,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,+DAA+D;IAC/D,SAAgB,WAAW,CAAC,EAAE,MAAM,CAAC;gBACzB,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;CAMjE"}