Skip to content

Commit

Permalink
## 4.1.0 (#73)
Browse files Browse the repository at this point in the history
### @craftercms/classes
- Update search API endpoint from `/api/1/site/search/search.json` to `api/1/site/elasticsearch/search`.

### @craftercms/content
- `urlTransform`, `getTree`, `getItem`, `getChildren` fix config argument to accept partial CrafterConfig
- Update createQuery usage examples without SearchEngine parameter.

### @craftercms/models
- Update Endpoints interface `ELASTICSEARCH` property to `SEARCH`.

### @craftercms/search
- Remove ElasticQuery query implementation for ElasticSearch.
- Use `Query` class instead of removed `ElasticQuery` class in `createQuery` function.
- Update createQuery usage examples without SearchEngine parameter.
  • Loading branch information
rart authored Jun 19, 2023
1 parent 5745287 commit 11689bf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# SDK Changelog

## 4.1.0

### @craftercms/classes
- Update search API endpoint from `/api/1/site/search/search.json` to `api/1/site/elasticsearch/search`.

### @craftercms/content
- `urlTransform`, `getTree`, `getItem`, `getChildren` fix config argument to accept partial CrafterConfig
- Update createQuery usage examples without SearchEngine parameter.

### @craftercms/models
- Update Endpoints interface `ELASTICSEARCH` property to `SEARCH`.

### @craftercms/search
- Remove ElasticQuery query implementation for ElasticSearch.
- Use `Query` class instead of removed `ElasticQuery` class in `createQuery` function.
- Update createQuery usage examples without SearchEngine parameter.

## 4.0.3

### All packages
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@craftercms/sdk",
"version": "4.0.3",
"version": "4.1.0",
"private": true,
"workspaces": [
"packages/*"
Expand Down
14 changes: 7 additions & 7 deletions packages/content/src/ContentStoreService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import { map } from 'rxjs/operators';
* @param {string} path - The item’s path
*/
export function getItem(path: string): Observable<Item>;
export function getItem(path: string, config: CrafterConfig): Observable<Item>;
export function getItem(path: string, config?: CrafterConfig): Observable<Item> {
export function getItem(path: string, config: Partial<CrafterConfig>): Observable<Item>;
export function getItem(path: string, config?: Partial<CrafterConfig>): Observable<Item> {
config = crafterConf.mix(config);
const requestURL = composeUrl(config, config.endpoints.GET_ITEM_URL);
return SDKService.httpGet(requestURL, { url: path, crafterSite: config.site }, config.headers);
Expand Down Expand Up @@ -68,8 +68,8 @@ export function getDescriptor(path: string, config?: Partial<GetDescriptorConfig
* @param {string} path - the folder’s path
*/
export function getChildren(path: string): Observable<Item[]>;
export function getChildren(path: string, config: CrafterConfig): Observable<Item[]>;
export function getChildren(path: string, config?: CrafterConfig): Observable<Item[]> {
export function getChildren(path: string, config: Partial<CrafterConfig>): Observable<Item[]>;
export function getChildren(path: string, config?: Partial<CrafterConfig>): Observable<Item[]> {
config = crafterConf.mix(config);
const requestURL = composeUrl(config, config.endpoints.GET_CHILDREN);
return SDKService.httpGet(requestURL, { url: path, crafterSite: config.site }, config.headers);
Expand All @@ -82,9 +82,9 @@ export function getChildren(path: string, config?: CrafterConfig): Observable<It
*/
export function getTree(path: string): Observable<Item>;
export function getTree(path: string, depth: number): Observable<Item>;
export function getTree(path: string, depth: number, config: CrafterConfig): Observable<Item>;
export function getTree(path: string, config: CrafterConfig): Observable<Item>;
export function getTree(path: string, depth: number | CrafterConfig = 1, config?: CrafterConfig): Observable<Item> {
export function getTree(path: string, depth: number, config: Partial<CrafterConfig>): Observable<Item>;
export function getTree(path: string, config: Partial<CrafterConfig>): Observable<Item>;
export function getTree(path: string, depth: number | Partial<CrafterConfig> = 1, config?: Partial<CrafterConfig>): Observable<Item> {
if (typeof depth === 'object') {
config = depth;
depth = 1;
Expand Down
4 changes: 2 additions & 2 deletions packages/content/src/UrlTransformationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export type UrlTransformers =
* @param {string} url - URL that will be transformed
*/
export function urlTransform(transformerName: UrlTransformers, url: string): Observable<string>;
export function urlTransform(transformerName: UrlTransformers, url: string, config: CrafterConfig): Observable<string>;
export function urlTransform(transformerName: UrlTransformers, url: string, config?: CrafterConfig): Observable<string> {
export function urlTransform(transformerName: UrlTransformers, url: string, config: Partial<CrafterConfig>): Observable<string>;
export function urlTransform(transformerName: UrlTransformers, url: string, config?: Partial<CrafterConfig>): Observable<string> {
config = crafterConf.mix(config);
const requestURL = composeUrl(config, config.endpoints.TRANSFORM_URL);
return SDKService.httpGet<string>(requestURL, {
Expand Down

0 comments on commit 11689bf

Please sign in to comment.