Skip to content

Commit c8f0fbd

Browse files
chore: format source files (#335)
1 parent f2b4858 commit c8f0fbd

File tree

27 files changed

+1621
-1679
lines changed

27 files changed

+1621
-1679
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "Resources",
3-
"version": "1.0.0",
4-
"main": "index.js",
5-
"dependencies": {
6-
"diff-match-patch": "^1.0.5"
7-
},
8-
"license": "MIT"
2+
"name": "Resources",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"dependencies": {
6+
"diff-match-patch": "^1.0.5"
7+
},
8+
"license": "MIT"
99
}
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,138 @@
1-
const { ApiService } = Shopware.Classes;
1+
const { ApiService } = Shopware.Classes
22

33
class Elasticsearch extends ApiService {
4-
constructor(
5-
httpClient,
6-
loginService,
7-
apiEndpoint = '_action/frosh-tools/elasticsearch'
8-
) {
9-
super(httpClient, loginService, apiEndpoint);
10-
}
4+
constructor(
5+
httpClient,
6+
loginService,
7+
apiEndpoint = '_action/frosh-tools/elasticsearch'
8+
) {
9+
super(httpClient, loginService, apiEndpoint)
10+
}
1111

12-
status() {
13-
const apiRoute = `${this.getApiBasePath()}/status`;
14-
return this.httpClient
15-
.get(apiRoute, {
16-
headers: this.getBasicHeaders(),
17-
})
18-
.then((response) => {
19-
return ApiService.handleResponse(response);
20-
});
21-
}
12+
status() {
13+
const apiRoute = `${this.getApiBasePath()}/status`
14+
return this.httpClient
15+
.get(apiRoute, {
16+
headers: this.getBasicHeaders(),
17+
})
18+
.then((response) => {
19+
return ApiService.handleResponse(response)
20+
})
21+
}
2222

23-
indices() {
24-
const apiRoute = `${this.getApiBasePath()}/indices`;
25-
return this.httpClient
26-
.get(apiRoute, {
27-
headers: this.getBasicHeaders(),
28-
})
29-
.then((response) => {
30-
return ApiService.handleResponse(response);
31-
});
32-
}
23+
indices() {
24+
const apiRoute = `${this.getApiBasePath()}/indices`
25+
return this.httpClient
26+
.get(apiRoute, {
27+
headers: this.getBasicHeaders(),
28+
})
29+
.then((response) => {
30+
return ApiService.handleResponse(response)
31+
})
32+
}
3333

34-
deleteIndex(indexName) {
35-
const apiRoute = `${this.getApiBasePath()}/index/` + indexName;
36-
return this.httpClient
37-
.delete(apiRoute, {
38-
headers: this.getBasicHeaders(),
39-
})
40-
.then((response) => {
41-
return ApiService.handleResponse(response);
42-
});
43-
}
34+
deleteIndex(indexName) {
35+
const apiRoute = `${this.getApiBasePath()}/index/` + indexName
36+
return this.httpClient
37+
.delete(apiRoute, {
38+
headers: this.getBasicHeaders(),
39+
})
40+
.then((response) => {
41+
return ApiService.handleResponse(response)
42+
})
43+
}
4444

45-
console(method, path, payload) {
46-
const apiRoute = `${this.getApiBasePath()}/console` + path;
47-
return this.httpClient
48-
.request({
49-
url: apiRoute,
50-
method: method,
51-
headers: {
52-
...this.getBasicHeaders(),
53-
'content-type': 'application/json',
54-
},
55-
data: payload,
56-
})
57-
.then((response) => {
58-
return ApiService.handleResponse(response);
59-
});
60-
}
45+
console(method, path, payload) {
46+
const apiRoute = `${this.getApiBasePath()}/console` + path
47+
return this.httpClient
48+
.request({
49+
url: apiRoute,
50+
method: method,
51+
headers: {
52+
...this.getBasicHeaders(),
53+
'content-type': 'application/json',
54+
},
55+
data: payload,
56+
})
57+
.then((response) => {
58+
return ApiService.handleResponse(response)
59+
})
60+
}
6161

62-
flushAll() {
63-
const apiRoute = `${this.getApiBasePath()}/flush_all`;
64-
return this.httpClient
65-
.post(
66-
apiRoute,
67-
{},
68-
{
69-
headers: this.getBasicHeaders(),
70-
}
71-
)
72-
.then((response) => {
73-
return ApiService.handleResponse(response);
74-
});
75-
}
62+
flushAll() {
63+
const apiRoute = `${this.getApiBasePath()}/flush_all`
64+
return this.httpClient
65+
.post(
66+
apiRoute,
67+
{},
68+
{
69+
headers: this.getBasicHeaders(),
70+
}
71+
)
72+
.then((response) => {
73+
return ApiService.handleResponse(response)
74+
})
75+
}
7676

77-
reindex() {
78-
const apiRoute = `${this.getApiBasePath()}/reindex`;
79-
return this.httpClient
80-
.post(
81-
apiRoute,
82-
{},
83-
{
84-
headers: this.getBasicHeaders(),
85-
}
86-
)
87-
.then((response) => {
88-
return ApiService.handleResponse(response);
89-
});
90-
}
77+
reindex() {
78+
const apiRoute = `${this.getApiBasePath()}/reindex`
79+
return this.httpClient
80+
.post(
81+
apiRoute,
82+
{},
83+
{
84+
headers: this.getBasicHeaders(),
85+
}
86+
)
87+
.then((response) => {
88+
return ApiService.handleResponse(response)
89+
})
90+
}
9191

92-
switchAlias() {
93-
const apiRoute = `${this.getApiBasePath()}/switch_alias`;
94-
return this.httpClient
95-
.post(
96-
apiRoute,
97-
{},
98-
{
99-
headers: this.getBasicHeaders(),
100-
}
101-
)
102-
.then((response) => {
103-
return ApiService.handleResponse(response);
104-
});
105-
}
92+
switchAlias() {
93+
const apiRoute = `${this.getApiBasePath()}/switch_alias`
94+
return this.httpClient
95+
.post(
96+
apiRoute,
97+
{},
98+
{
99+
headers: this.getBasicHeaders(),
100+
}
101+
)
102+
.then((response) => {
103+
return ApiService.handleResponse(response)
104+
})
105+
}
106106

107-
cleanup() {
108-
const apiRoute = `${this.getApiBasePath()}/cleanup`;
109-
return this.httpClient
110-
.post(
111-
apiRoute,
112-
{},
113-
{
114-
headers: this.getBasicHeaders(),
115-
}
116-
)
117-
.then((response) => {
118-
return ApiService.handleResponse(response);
119-
});
120-
}
107+
cleanup() {
108+
const apiRoute = `${this.getApiBasePath()}/cleanup`
109+
return this.httpClient
110+
.post(
111+
apiRoute,
112+
{},
113+
{
114+
headers: this.getBasicHeaders(),
115+
}
116+
)
117+
.then((response) => {
118+
return ApiService.handleResponse(response)
119+
})
120+
}
121121

122-
reset() {
123-
const apiRoute = `${this.getApiBasePath()}/reset`;
124-
return this.httpClient
125-
.post(
126-
apiRoute,
127-
{},
128-
{
129-
headers: this.getBasicHeaders(),
130-
}
131-
)
132-
.then((response) => {
133-
return ApiService.handleResponse(response);
134-
});
135-
}
122+
reset() {
123+
const apiRoute = `${this.getApiBasePath()}/reset`
124+
return this.httpClient
125+
.post(
126+
apiRoute,
127+
{},
128+
{
129+
headers: this.getBasicHeaders(),
130+
}
131+
)
132+
.then((response) => {
133+
return ApiService.handleResponse(response)
134+
})
135+
}
136136
}
137137

138-
export default Elasticsearch;
138+
export default Elasticsearch

0 commit comments

Comments
 (0)