@dvsa/appdev-api-common 0.6.0 → 0.6.1-canary.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.
@@ -9,6 +9,7 @@ export declare class ClientCredentials {
9
9
  private readonly clientId;
10
10
  private readonly clientSecret;
11
11
  private readonly scope;
12
+ private readonly resource;
12
13
  private readonly debugMode;
13
14
  private static accessToken;
14
15
  private static readonly grantType;
@@ -20,7 +21,7 @@ export declare class ClientCredentials {
20
21
  * @param scope - The scope of the access token
21
22
  * @param debugMode - Whether to log debug messages
22
23
  */
23
- constructor(tokenUrl: string, clientId: string, clientSecret: string, scope: string, debugMode?: boolean);
24
+ constructor(tokenUrl: string, clientId: string, clientSecret: string, scope: string | undefined, resource: string | undefined, debugMode?: boolean);
24
25
  /**
25
26
  * Helper method to perform the client credentials flow and return the access token
26
27
  * This method will check for the existence of the token and if it is expired, it will fetch a new one
@@ -8,6 +8,7 @@ class ClientCredentials {
8
8
  clientId;
9
9
  clientSecret;
10
10
  scope;
11
+ resource;
11
12
  debugMode;
12
13
  static accessToken;
13
14
  static grantType = "client_credentials";
@@ -19,11 +20,12 @@ class ClientCredentials {
19
20
  * @param scope - The scope of the access token
20
21
  * @param debugMode - Whether to log debug messages
21
22
  */
22
- constructor(tokenUrl, clientId, clientSecret, scope, debugMode = false) {
23
+ constructor(tokenUrl, clientId, clientSecret, scope, resource, debugMode = false) {
23
24
  this.tokenUrl = tokenUrl;
24
25
  this.clientId = clientId;
25
26
  this.clientSecret = clientSecret;
26
27
  this.scope = scope;
28
+ this.resource = resource;
27
29
  this.debugMode = debugMode;
28
30
  }
29
31
  /**
@@ -57,6 +59,7 @@ class ClientCredentials {
57
59
  client_id: this.clientId,
58
60
  client_secret: this.clientSecret,
59
61
  scope: this.scope,
62
+ resource: this.resource,
60
63
  }),
61
64
  });
62
65
  if (!response.ok) {
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@dvsa/appdev-api-common",
3
- "version": "0.6.0",
4
- "keywords": ["dvsa", "nodejs", "typescript"],
3
+ "version": "0.6.1-canary.0",
4
+ "keywords": [
5
+ "dvsa",
6
+ "nodejs",
7
+ "typescript"
8
+ ],
5
9
  "author": "DVSA",
6
10
  "description": "Utils library for common API functionality",
7
11
  "publishConfig": {
@@ -34,7 +38,7 @@
34
38
  "@types/aws-lambda": "^8.10.145",
35
39
  "@types/express": "^5.0.0",
36
40
  "@types/jest": "^29.5.14",
37
- "@types/node": "^20.14.8",
41
+ "@types/node": "^22.15.16",
38
42
  "husky": "^9.1.7",
39
43
  "jest": "^29.7.0",
40
44
  "lint-staged": "^15.2.10",