attlaz-client 1.9.16 → 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.
- package/dist/Model/Deployment/CodeSourceAccount.d.ts +1 -1
- package/dist/Model/Deployment/CodeSourceAccount.js +1 -1
- package/dist/Service/Endpoint.d.ts +1 -0
- package/dist/Service/Endpoint.js +8 -6
- package/dist/Service/FlowEndpoint.js +1 -1
- package/dist/Service/LogEndpoint.js +1 -1
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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;
|
|
@@ -9,7 +9,7 @@ const FlowSummary_1 = require("../Model/Flow/FlowSummary");
|
|
|
9
9
|
class FlowEndpoint extends Endpoint_1.Endpoint {
|
|
10
10
|
async getByProject(projectId) {
|
|
11
11
|
try {
|
|
12
|
-
let url = '/
|
|
12
|
+
let url = '/projects/' + projectId + '/flows';
|
|
13
13
|
const result = await this.requestCollection(url, null, Flow_1.Flow.parse);
|
|
14
14
|
return result;
|
|
15
15
|
}
|
|
@@ -115,7 +115,7 @@ class LogEndpoint extends Endpoint_1.Endpoint {
|
|
|
115
115
|
const parser = (raw) => {
|
|
116
116
|
return new LogStream_1.LogStream(new LogStreamId_1.LogStreamId(raw['id']['id']), raw['name']);
|
|
117
117
|
};
|
|
118
|
-
const result = await this.requestCollection('
|
|
118
|
+
const result = await this.requestCollection('projects/' + projectId + '/logstreams', null, parser);
|
|
119
119
|
return result;
|
|
120
120
|
}
|
|
121
121
|
}
|