Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk-client): getCollection method for content #28635

Merged
merged 47 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e3d32ed
architecture for content api
zJaaal May 22, 2024
b7d8ea5
fetch method is working
zJaaal May 22, 2024
c25b405
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 23, 2024
3980f50
fix sonarqube issue
zJaaal May 23, 2024
c5bdef8
testing on example
zJaaal May 23, 2024
f5f37cc
fix ReDoS
zJaaal May 23, 2024
15ff5ce
feedback
zJaaal May 23, 2024
76b022f
fix for query by language and draft content
zJaaal May 23, 2024
105b0fc
testing render
zJaaal May 23, 2024
c6b1088
support querying by variants
zJaaal May 23, 2024
d4c89c2
cleaning
zJaaal May 23, 2024
9ecb5dc
map response to easier model
zJaaal May 23, 2024
da0c132
testing in example
zJaaal May 23, 2024
a31334d
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 23, 2024
bcf6157
clean docs
zJaaal May 23, 2024
d7d8a6d
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 24, 2024
ebcd5ca
feedback
zJaaal May 24, 2024
5bb507b
Merge branch '28634-sdk-content-api-getcollection-method' of https://…
zJaaal May 24, 2024
c1bfeb3
small architecture change
zJaaal May 24, 2024
1d17dea
clean up and documentation
zJaaal May 24, 2024
1b4239f
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 24, 2024
c5c6bab
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 28, 2024
773ac06
add test cases
zJaaal May 28, 2024
8116e29
Add comments
zJaaal May 28, 2024
36c75e1
fix typo
zJaaal May 28, 2024
a6aefef
fix sq
zJaaal May 28, 2024
1035460
testing on nextjs
zJaaal May 28, 2024
5e71181
add error for bad query on query method
zJaaal May 28, 2024
92daf5d
Add docs
zJaaal May 28, 2024
5ec1c69
add docs
zJaaal May 28, 2024
36a159d
add total to the mapped response
zJaaal May 28, 2024
c09d034
add rawQuery method
zJaaal May 28, 2024
21bc9cb
force the developer to add the new methods to the all methods test
zJaaal May 28, 2024
4ad284c
add dev docs
zJaaal May 28, 2024
a2b4e20
enhance readability of tests
zJaaal May 28, 2024
7adffcf
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 29, 2024
7f73b7b
address feedback
zJaaal May 29, 2024
6b8c041
fix typo on path
zJaaal May 29, 2024
f3c4116
feedback
zJaaal May 29, 2024
1f93e9b
revert changes of base config due to bad reference on libraries
zJaaal May 29, 2024
4f67680
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 29, 2024
710609b
address feedback
zJaaal May 29, 2024
b8e3006
clean nextjs
zJaaal May 29, 2024
6163da0
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 29, 2024
521fdc5
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 30, 2024
62197a0
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 30, 2024
321391e
Merge branch 'master' into 28634-sdk-content-api-getcollection-method
zJaaal May 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions core-web/libs/sdk/client/src/lib/client/content/content-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { GetCollection } from './methods/get-collection/get-collection';

/**
* Content classs exposes the content api methods
*
* @export
* @class Content
*/
export class Content {
private requestOptions: Omit<RequestInit, 'body' | 'method'>;
private serverUrl;

constructor(requestOptions: Omit<RequestInit, 'body' | 'method'>, serverUrl: string) {
zJaaal marked this conversation as resolved.
Show resolved Hide resolved
this.requestOptions = requestOptions;
this.serverUrl = serverUrl;
}

/**
* Allows you to build a query to get a collection of an specified content type
*
* @param {string} contentType
* @return {*}
* @memberof Content
*/
getCollection(contentType: string): GetCollection {
return new GetCollection(this.requestOptions, this.serverUrl, contentType);
}
}
Loading
Loading