attlaz-client 1.13.37 → 1.13.39

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/Client.js CHANGED
@@ -86,6 +86,8 @@ export class Client {
86
86
  }
87
87
  setClientCredentials(clientId, clientSecret = '') {
88
88
  const options = new OAuthClientOptions(this.apiEndpoint, clientId, clientSecret);
89
+ // TODO: how to know these scopes?
90
+ options.scopes = ['all'];
89
91
  this.httpClient = new OAuthClient(options);
90
92
  }
91
93
  getHttpClient() {
@@ -35,6 +35,7 @@ export class ClientError {
35
35
  clientError.code = HttpClient.HTTP_UNAVAILABLE;
36
36
  break;
37
37
  case 'EAUTH':
38
+ case 401:
38
39
  clientError.code = HttpClient.HTTP_UNAUTHORIZED;
39
40
  break;
40
41
  case 'ESTATUS':
@@ -9,7 +9,9 @@ export declare class Channel extends MetaDataAware implements StateAware {
9
9
  type: ChannelType;
10
10
  data: any;
11
11
  state: State;
12
- private: boolean;
12
+ workspaces: string[];
13
+ isPrivate: boolean;
14
+ singleUse: boolean;
13
15
  constructor(id: string, ownerId: string, label: string, type: ChannelType, data: any);
14
16
  static parse(rawChannel: any): Channel;
15
17
  }
@@ -10,7 +10,9 @@ export class Channel extends MetaDataAware {
10
10
  type;
11
11
  data;
12
12
  state = State.Active;
13
- private = false;
13
+ workspaces = [];
14
+ isPrivate = false;
15
+ singleUse = false;
14
16
  constructor(id, ownerId, label, type, data) {
15
17
  super();
16
18
  this.id = id;
@@ -23,7 +25,9 @@ export class Channel extends MetaDataAware {
23
25
  const type = ChannelType.fromString(rawChannel.type);
24
26
  const channel = new Channel(rawChannel.id, rawChannel.owner, rawChannel.label, type, rawChannel.data);
25
27
  channel.state = State.fromString(rawChannel.state);
26
- channel.private = Utils.isTrue(rawChannel.private);
28
+ channel.isPrivate = Utils.isTrue(rawChannel.is_private);
29
+ channel.singleUse = Utils.isTrue(rawChannel.single_use);
30
+ channel.workspaces = rawChannel.workspaces;
27
31
  if (Object.prototype.hasOwnProperty.call(rawChannel, 'metadata')) {
28
32
  channel.metadata = DataValueCollection.fromObject(rawChannel.metadata);
29
33
  }
@@ -6,11 +6,6 @@ export class ChannelEndpoint extends Endpoint {
6
6
  async getById(channelId) {
7
7
  try {
8
8
  const result = await this.requestObject('/channels/' + channelId + '', null, Channel.parse);
9
- // if (Utils.isNullOrUndefined(result)) {
10
- //
11
- // } else {
12
- // result.setData(Channel.parse(result.getData()));
13
- // }
14
9
  return result.getData();
15
10
  }
16
11
  catch (ex) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.13.37",
3
+ "version": "1.13.39",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -33,6 +33,7 @@
33
33
  "prepare": "npm run clean && tsc --project tsconfig.production.json",
34
34
  "build": "npm run clean && tsc",
35
35
  "clean": "rimraf dist",
36
+ "scan": "docker run -v .:/path zricethezav/gitleaks:latest detect --source=\"/path\" ",
36
37
  "test": "jest"
37
38
  },
38
39
  "publishConfig": {