attlaz-client 1.9.17 → 1.9.18

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.
@@ -2,7 +2,7 @@ export declare class CodeSourceAccount {
2
2
  id: string;
3
3
  key: string;
4
4
  name: string;
5
- user: string;
5
+ userId: string;
6
6
  type: string;
7
7
  access_token: string;
8
8
  refresh_token: string;
@@ -7,7 +7,7 @@ class CodeSourceAccount {
7
7
  sourcesAccount.id = rawSourcesAccount.id;
8
8
  sourcesAccount.key = rawSourcesAccount.key;
9
9
  sourcesAccount.name = rawSourcesAccount.name;
10
- sourcesAccount.user = rawSourcesAccount.userId;
10
+ sourcesAccount.userId = rawSourcesAccount.user;
11
11
  sourcesAccount.type = rawSourcesAccount.type;
12
12
  sourcesAccount.access_token = rawSourcesAccount.access_token;
13
13
  sourcesAccount.refresh_token = rawSourcesAccount.refresh_token;
@@ -10,4 +10,5 @@ export declare abstract class Endpoint {
10
10
  requestCollection<T>(action: string, parameters: Parameters | undefined, parser: (input: any) => T, method?: string, signWithOauthToken?: boolean): Promise<CollectionResult<T>>;
11
11
  requestObject<T>(action: string, parameters: Parameters | undefined, parser: (input: any) => T, method?: string, signWithOauthToken?: boolean): Promise<ObjectResult<T>>;
12
12
  parseCollection<T>(rawData: object[], parser: (input: any) => T): T[];
13
+ private parseObject;
13
14
  }
@@ -96,7 +96,7 @@ class Endpoint {
96
96
  console.error('Response for object "' + action + '" seem to still use old "data" property', { requestResponse });
97
97
  requestResponse = requestResponse.data;
98
98
  }
99
- result.setData(parser(requestResponse));
99
+ result.setData(this.parseObject(requestResponse, parser));
100
100
  }
101
101
  catch (error) {
102
102
  if (error.code === HttpClient_1.HttpClient.HTTP_NOTFOUND) {
@@ -120,13 +120,15 @@ class Endpoint {
120
120
  throw new Error('Invalid data');
121
121
  }
122
122
  for (const rawDataEntry of rawData) {
123
- // TODO: is it interesting to keep this, or only in develop mode?
124
- const wrappedData = ObjectWrapper_1.ObjectWrapper.wrap(rawDataEntry);
125
- const parsedData = parser(wrappedData);
126
- // const parsedData:T = parser(rawDataEntry);
127
- data.push(parsedData);
123
+ data.push(this.parseObject(rawDataEntry, parser));
128
124
  }
129
125
  return data;
130
126
  }
127
+ parseObject(rawObject, parser) {
128
+ // TODO: is it interesting to keep this wrapper, or only in develop mode?
129
+ const wrappedData = ObjectWrapper_1.ObjectWrapper.wrap(rawObject);
130
+ const parsedData = parser(wrappedData);
131
+ return parsedData;
132
+ }
131
133
  }
132
134
  exports.Endpoint = Endpoint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.9.17",
3
+ "version": "1.9.18",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",