attlaz-client 1.16.4 → 1.16.6

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.
@@ -11,7 +11,7 @@ export var AdapterConnectionStatus;
11
11
  if (input === 'pass') {
12
12
  return AdapterConnectionStatus.Healthy;
13
13
  }
14
- if (input === 'skip') {
14
+ if (input === null || input === 'skip') {
15
15
  return AdapterConnectionStatus.Unknown;
16
16
  }
17
17
  if (input === 'fail') {
@@ -4,7 +4,7 @@ import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
4
4
  import { UserAccessToken } from '../Model/AccessToken/UserAccessToken.js';
5
5
  export declare class AccessTokenEndpoint extends Endpoint {
6
6
  getByUser(pagination: CursorPagination): Promise<CollectionResult<UserAccessToken>>;
7
- create(name: string, scopes: string[]): Promise<UserAccessToken>;
7
+ create(name: string, scopes: string[], expiresAt: Date): Promise<UserAccessToken>;
8
8
  update(tokenId: string, name: string, scopes: string[]): Promise<UserAccessToken>;
9
9
  revoke(tokenId: string): Promise<boolean>;
10
10
  }
@@ -16,10 +16,15 @@ export class AccessTokenEndpoint extends Endpoint {
16
16
  throw e;
17
17
  }
18
18
  }
19
- async create(name, scopes) {
19
+ async create(name, scopes, expiresAt) {
20
20
  try {
21
21
  const url = '/access-tokens';
22
- const result = await this.requestObject(url, { name, scopes }, UserAccessToken.parse, 'POST');
22
+ const data = {
23
+ name,
24
+ scopes,
25
+ expires_at: expiresAt,
26
+ };
27
+ const result = await this.requestObject(url, data, UserAccessToken.parse, 'POST');
23
28
  const createdToken = result.getData();
24
29
  if (createdToken === null) {
25
30
  throw new Error('Unable to create token: wrong response from API');
@@ -36,7 +41,9 @@ export class AccessTokenEndpoint extends Endpoint {
36
41
  async update(tokenId, name, scopes) {
37
42
  try {
38
43
  const url = '/access-tokens/' + tokenId;
39
- const result = await this.requestObject(url, { name, scopes }, UserAccessToken.parse, 'POST');
44
+ const result = await this.requestObject(url, {
45
+ name, scopes,
46
+ }, UserAccessToken.parse, 'POST');
40
47
  const updatedToken = result.getData();
41
48
  if (updatedToken === null) {
42
49
  throw new Error('Unable to create token: wrong response from API');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.16.4",
3
+ "version": "1.16.6",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",