@edirect/oidc-client 11.0.39 → 11.0.40

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/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@edirect/oidc-client",
3
- "version": "11.0.39",
4
- "main": "./dist/src/index.js",
5
- "types": "./dist/src/index.d.ts",
3
+ "version": "11.0.40",
4
+ "main": "./dist/cjs/index.js",
5
+ "module": "./dist/esm/index.js",
6
+ "types": "./dist/types/index.d.ts",
6
7
  "exports": {
7
- "./package.json": "./package.json",
8
8
  ".": {
9
- "import": "./dist/src/index.js",
10
- "default": "./dist/src/index.js",
11
- "types": "./dist/src/index.d.ts",
12
- "require": "./dist/src/index.js"
13
- }
9
+ "require": "./dist/cjs/index.js",
10
+ "import": "./dist/esm/index.js",
11
+ "types": "./dist/types/index.d.ts"
12
+ },
13
+ "./package.json": "./package.json"
14
14
  },
15
15
  "files": [
16
16
  "dist"
@@ -1,5 +1,5 @@
1
- import { ErrorHandlerType } from './types/error-handler.type';
2
1
  import { Connect } from './types/connect.type';
2
+ import { ErrorHandlerType } from './types/error-handler.type';
3
3
  export declare class OidcConnect {
4
4
  configuration: any;
5
5
  baseUrl: string;
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,qBAAa,WAAW;IACtB,aAAa,EAAE,GAAG,CAAC;IACnB,OAAO,EAAG,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,gBAAgB,CAAC;;IAMzB,OAAO,CAAC,MAAM,EAAE,OAAO;CAqB9B"}
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,qBAAa,WAAW;IACtB,aAAa,EAAE,GAAG,CAAC;IACnB,OAAO,EAAG,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,gBAAgB,CAAC;;IAMzB,OAAO,CAAC,MAAM,EAAE,OAAO;CAsB9B"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OidcConnect = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const client = tslib_1.__importStar(require("openid-client"));
6
5
  const error_handler_1 = tslib_1.__importDefault(require("./utils/error-handler"));
7
6
  class OidcConnect {
8
7
  configuration;
@@ -16,6 +15,7 @@ class OidcConnect {
16
15
  this.baseUrl = params.baseUrl;
17
16
  this.redirectUri = params.redirectUri;
18
17
  const issuer = new URL(`${params.baseUrl}/${params.oidcPath}`);
18
+ const client = await import('openid-client');
19
19
  this.configuration = await client.discovery(issuer, params.clientId, params.clientSecret);
20
20
  // Set additional metadata if needed
21
21
  if (this.configuration) {
@@ -1 +1 @@
1
- {"version":3,"file":"client_credentials.d.ts","sourceRoot":"","sources":["../../../src/grant-type/client_credentials.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKnD,qBAAa,UAAW,SAAQ,WAAW;IACzC,YAAY,EAAE,yBAAyB,CAAC;IACxC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,QAAQ,GAAG,IAAI,CAAC;IAChD,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,QAAQ,CAAC;;IAW3C,OAAO,CAAC,MAAM,EAAE,OAAO;IAQhC,cAAc,CAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAuBrB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;CAKvC;AAED,eAAO,MAAM,IAAI,YAAmB,CAAC"}
1
+ {"version":3,"file":"client_credentials.d.ts","sourceRoot":"","sources":["../../../src/grant-type/client_credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKnD,qBAAa,UAAW,SAAQ,WAAW;IACzC,YAAY,EAAE,yBAAyB,CAAC;IACxC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,QAAQ,GAAG,IAAI,CAAC;IAChD,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,QAAQ,CAAC;;IAW3C,OAAO,CAAC,MAAM,EAAE,OAAO;IAQhC,cAAc,CAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAwBrB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;CAKvC;AAED,eAAO,MAAM,IAAI,YAAmB,CAAC"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.oidc = exports.OidcClient = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const client = tslib_1.__importStar(require("openid-client"));
6
5
  const connect_1 = require("../connect");
7
6
  const token_1 = require("../token");
8
7
  const parse_token_1 = tslib_1.__importDefault(require("../utils/parse-token"));
@@ -37,7 +36,8 @@ class OidcClient extends connect_1.OidcConnect {
37
36
  ...data,
38
37
  };
39
38
  try {
40
- const tokenSetRaw = await client.clientCredentialsGrant(this.configuration, params);
39
+ const { clientCredentialsGrant } = await import('openid-client');
40
+ const tokenSetRaw = await clientCredentialsGrant(this.configuration, params);
41
41
  const tokenSet = (0, parse_token_1.default)(tokenSetRaw);
42
42
  this.token = this.setToken(tokenSet);
43
43
  return this.token;
package/package.json CHANGED
@@ -1,18 +1,17 @@
1
1
  {
2
2
  "name": "@edirect/oidc-client",
3
- "version": "11.0.39",
3
+ "version": "11.0.40",
4
4
  "packageScope": "@edirect",
5
- "main": "./dist/src/index.js",
6
- "types": "./dist/src/index.d.ts",
5
+ "main": "./dist/cjs/index.js",
6
+ "module": "./dist/esm/index.js",
7
+ "types": "./dist/types/index.d.ts",
7
8
  "exports": {
8
- "./package.json": "./package.json",
9
9
  ".": {
10
- "development": "./src/index.ts",
11
- "import": "./dist/src/index.js",
12
- "default": "./dist/src/index.js",
13
- "types": "./dist/src/index.d.ts",
14
- "require": "./dist/src/index.js"
15
- }
10
+ "require": "./dist/cjs/index.js",
11
+ "import": "./dist/esm/index.js",
12
+ "types": "./dist/types/index.d.ts"
13
+ },
14
+ "./package.json": "./package.json"
16
15
  },
17
16
  "files": [
18
17
  "dist"
@@ -37,5 +36,10 @@
37
36
  }
38
37
  }
39
38
  }
39
+ },
40
+ "scripts": {
41
+ "build:cjs": "tsc -p tsconfig.cjs.json",
42
+ "build:esm": "tsc -p tsconfig.esm.json",
43
+ "build": "pnpm run build:cjs && pnpm run build:esm"
40
44
  }
41
45
  }