-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
1,500 additions
and
1,500 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"name": "Resources", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"dependencies": { | ||
"diff-match-patch": "^1.0.5" | ||
}, | ||
"license": "MIT" | ||
"name": "Resources", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"dependencies": { | ||
"diff-match-patch": "^1.0.5" | ||
}, | ||
"license": "MIT" | ||
} |
246 changes: 123 additions & 123 deletions
246
src/Resources/app/administration/src/api/elasticsearch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,138 +1,138 @@ | ||
const { ApiService } = Shopware.Classes; | ||
|
||
class Elasticsearch extends ApiService { | ||
constructor( | ||
httpClient, | ||
loginService, | ||
apiEndpoint = '_action/frosh-tools/elasticsearch', | ||
) { | ||
super(httpClient, loginService, apiEndpoint); | ||
} | ||
constructor( | ||
httpClient, | ||
loginService, | ||
apiEndpoint = '_action/frosh-tools/elasticsearch', | ||
) { | ||
super(httpClient, loginService, apiEndpoint); | ||
} | ||
|
||
status() { | ||
const apiRoute = `${this.getApiBasePath()}/status`; | ||
return this.httpClient | ||
.get(apiRoute, { | ||
headers: this.getBasicHeaders(), | ||
}) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
status() { | ||
const apiRoute = `${this.getApiBasePath()}/status`; | ||
return this.httpClient | ||
.get(apiRoute, { | ||
headers: this.getBasicHeaders(), | ||
}) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
|
||
indices() { | ||
const apiRoute = `${this.getApiBasePath()}/indices`; | ||
return this.httpClient | ||
.get(apiRoute, { | ||
headers: this.getBasicHeaders(), | ||
}) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
indices() { | ||
const apiRoute = `${this.getApiBasePath()}/indices`; | ||
return this.httpClient | ||
.get(apiRoute, { | ||
headers: this.getBasicHeaders(), | ||
}) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
|
||
deleteIndex(indexName) { | ||
const apiRoute = `${this.getApiBasePath()}/index/` + indexName; | ||
return this.httpClient | ||
.delete(apiRoute, { | ||
headers: this.getBasicHeaders(), | ||
}) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
deleteIndex(indexName) { | ||
const apiRoute = `${this.getApiBasePath()}/index/` + indexName; | ||
return this.httpClient | ||
.delete(apiRoute, { | ||
headers: this.getBasicHeaders(), | ||
}) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
|
||
console(method, path, payload) { | ||
const apiRoute = `${this.getApiBasePath()}/console` + path; | ||
return this.httpClient | ||
.request({ | ||
url: apiRoute, | ||
method: method, | ||
headers: { | ||
...this.getBasicHeaders(), | ||
'content-type': 'application/json', | ||
}, | ||
data: payload, | ||
}) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
console(method, path, payload) { | ||
const apiRoute = `${this.getApiBasePath()}/console` + path; | ||
return this.httpClient | ||
.request({ | ||
url: apiRoute, | ||
method: method, | ||
headers: { | ||
...this.getBasicHeaders(), | ||
'content-type': 'application/json', | ||
}, | ||
data: payload, | ||
}) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
|
||
flushAll() { | ||
const apiRoute = `${this.getApiBasePath()}/flush_all`; | ||
return this.httpClient | ||
.post( | ||
apiRoute, | ||
{}, | ||
{ | ||
headers: this.getBasicHeaders(), | ||
}, | ||
) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
flushAll() { | ||
const apiRoute = `${this.getApiBasePath()}/flush_all`; | ||
return this.httpClient | ||
.post( | ||
apiRoute, | ||
{}, | ||
{ | ||
headers: this.getBasicHeaders(), | ||
}, | ||
) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
|
||
reindex() { | ||
const apiRoute = `${this.getApiBasePath()}/reindex`; | ||
return this.httpClient | ||
.post( | ||
apiRoute, | ||
{}, | ||
{ | ||
headers: this.getBasicHeaders(), | ||
}, | ||
) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
reindex() { | ||
const apiRoute = `${this.getApiBasePath()}/reindex`; | ||
return this.httpClient | ||
.post( | ||
apiRoute, | ||
{}, | ||
{ | ||
headers: this.getBasicHeaders(), | ||
}, | ||
) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
|
||
switchAlias() { | ||
const apiRoute = `${this.getApiBasePath()}/switch_alias`; | ||
return this.httpClient | ||
.post( | ||
apiRoute, | ||
{}, | ||
{ | ||
headers: this.getBasicHeaders(), | ||
}, | ||
) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
switchAlias() { | ||
const apiRoute = `${this.getApiBasePath()}/switch_alias`; | ||
return this.httpClient | ||
.post( | ||
apiRoute, | ||
{}, | ||
{ | ||
headers: this.getBasicHeaders(), | ||
}, | ||
) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
|
||
cleanup() { | ||
const apiRoute = `${this.getApiBasePath()}/cleanup`; | ||
return this.httpClient | ||
.post( | ||
apiRoute, | ||
{}, | ||
{ | ||
headers: this.getBasicHeaders(), | ||
}, | ||
) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
cleanup() { | ||
const apiRoute = `${this.getApiBasePath()}/cleanup`; | ||
return this.httpClient | ||
.post( | ||
apiRoute, | ||
{}, | ||
{ | ||
headers: this.getBasicHeaders(), | ||
}, | ||
) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
|
||
reset() { | ||
const apiRoute = `${this.getApiBasePath()}/reset`; | ||
return this.httpClient | ||
.post( | ||
apiRoute, | ||
{}, | ||
{ | ||
headers: this.getBasicHeaders(), | ||
}, | ||
) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
reset() { | ||
const apiRoute = `${this.getApiBasePath()}/reset`; | ||
return this.httpClient | ||
.post( | ||
apiRoute, | ||
{}, | ||
{ | ||
headers: this.getBasicHeaders(), | ||
}, | ||
) | ||
.then((response) => { | ||
return ApiService.handleResponse(response); | ||
}); | ||
} | ||
} | ||
|
||
export default Elasticsearch; |
Oops, something went wrong.