attlaz-client 1.9.17 → 1.9.19
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.
|
@@ -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.
|
|
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;
|
package/dist/Model/User.d.ts
CHANGED
|
@@ -2,9 +2,8 @@ import { State } from './State';
|
|
|
2
2
|
import { StateAware } from './StateAware';
|
|
3
3
|
export declare class User implements StateAware {
|
|
4
4
|
id: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
lastname: string;
|
|
5
|
+
name: string;
|
|
6
|
+
emailIsVerified: boolean;
|
|
8
7
|
email: string;
|
|
9
8
|
phone: string;
|
|
10
9
|
password: string;
|
package/dist/Model/User.js
CHANGED
|
@@ -11,10 +11,9 @@ class User {
|
|
|
11
11
|
static parse(rawUser) {
|
|
12
12
|
let user = new User();
|
|
13
13
|
user.id = rawUser.id;
|
|
14
|
-
user.
|
|
15
|
-
user.firstname = rawUser.firstname;
|
|
16
|
-
user.lastname = rawUser.lastname;
|
|
14
|
+
user.name = rawUser.name;
|
|
17
15
|
user.email = rawUser.email;
|
|
16
|
+
user.emailIsVerified = rawUser.email_is_verified;
|
|
18
17
|
user.phone = rawUser.phone;
|
|
19
18
|
user.language = rawUser.language;
|
|
20
19
|
user.time_zone = rawUser.time_zone;
|
|
@@ -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
|
}
|
package/dist/Service/Endpoint.js
CHANGED
|
@@ -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(
|
|
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
|
-
|
|
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;
|