Skip to content

Commit dc21e7a

Browse files
committed
adds bulk comment save, adds comment permNotSpam, new comment pagination features
1 parent 3c81245 commit dc21e7a

File tree

20 files changed

+552
-51
lines changed

20 files changed

+552
-51
lines changed

client/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Add this dependency to your project's POM:
4040
<dependency>
4141
<groupId>com.fastcomments</groupId>
4242
<artifactId>client</artifactId>
43-
<version>0.0.19</version>
43+
<version>0.0.20</version>
4444
<scope>compile</scope>
4545
</dependency>
4646
```
@@ -56,7 +56,7 @@ Add this dependency to your project's build file:
5656
}
5757
5858
dependencies {
59-
implementation "com.fastcomments:client:0.0.19"
59+
implementation "com.fastcomments:client:0.0.20"
6060
}
6161
```
6262

@@ -70,7 +70,7 @@ mvn clean package
7070

7171
Then manually install the following JARs:
7272

73-
* `target/client-0.0.19.jar`
73+
* `target/client-0.0.20.jar`
7474
* `target/lib/*.jar`
7575

7676
## Getting Started
@@ -149,6 +149,7 @@ Class | Method | HTTP request | Description
149149
*DefaultApi* | [**patchDomainConfig**](docs/DefaultApi.md#patchDomainConfig) | **PATCH** /api/v1/domain-configs/{domainToUpdate} |
150150
*DefaultApi* | [**putDomainConfig**](docs/DefaultApi.md#putDomainConfig) | **PUT** /api/v1/domain-configs/{domainToUpdate} |
151151
*DefaultApi* | [**saveComment**](docs/DefaultApi.md#saveComment) | **POST** /api/v1/comments |
152+
*DefaultApi* | [**saveCommentsBulk**](docs/DefaultApi.md#saveCommentsBulk) | **POST** /api/v1/comments/bulk |
152153
*DefaultApi* | [**unBlockUserFromComment**](docs/DefaultApi.md#unBlockUserFromComment) | **POST** /api/v1/comments/{id}/un-block |
153154
*DefaultApi* | [**unFlagComment**](docs/DefaultApi.md#unFlagComment) | **POST** /api/v1/comments/{id}/un-flag |
154155
*DefaultApi* | [**updateComment**](docs/DefaultApi.md#updateComment) | **PATCH** /api/v1/comments/{id} |

client/api/openapi.yaml

Lines changed: 84 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,14 +1247,6 @@ paths:
12471247
schema:
12481248
type: boolean
12491249
style: form
1250-
- explode: true
1251-
in: query
1252-
name: lastGenDate
1253-
required: false
1254-
schema:
1255-
format: int64
1256-
type: integer
1257-
style: form
12581250
- explode: true
12591251
in: query
12601252
name: fetchPageForCommentId
@@ -1370,6 +1362,20 @@ paths:
13701362
schema:
13711363
type: string
13721364
style: form
1365+
- explode: true
1366+
in: query
1367+
name: afterCommentId
1368+
required: false
1369+
schema:
1370+
type: string
1371+
style: form
1372+
- explode: true
1373+
in: query
1374+
name: beforeCommentId
1375+
required: false
1376+
schema:
1377+
type: string
1378+
style: form
13731379
responses:
13741380
"200":
13751381
content:
@@ -3073,6 +3079,67 @@ paths:
30733079
x-content-type: application/json
30743080
x-accepts:
30753081
- application/json
3082+
/api/v1/comments/bulk:
3083+
post:
3084+
operationId: SaveCommentsBulk
3085+
parameters:
3086+
- explode: true
3087+
in: query
3088+
name: tenantId
3089+
required: true
3090+
schema:
3091+
type: string
3092+
style: form
3093+
- explode: true
3094+
in: query
3095+
name: isLive
3096+
required: false
3097+
schema:
3098+
type: boolean
3099+
style: form
3100+
- explode: true
3101+
in: query
3102+
name: doSpamCheck
3103+
required: false
3104+
schema:
3105+
type: boolean
3106+
style: form
3107+
- explode: true
3108+
in: query
3109+
name: sendEmails
3110+
required: false
3111+
schema:
3112+
type: boolean
3113+
style: form
3114+
- explode: true
3115+
in: query
3116+
name: populateNotifications
3117+
required: false
3118+
schema:
3119+
type: boolean
3120+
style: form
3121+
requestBody:
3122+
content:
3123+
application/json:
3124+
schema:
3125+
items:
3126+
$ref: '#/components/schemas/CreateCommentParams'
3127+
type: array
3128+
required: true
3129+
responses:
3130+
"200":
3131+
content:
3132+
application/json:
3133+
schema:
3134+
items:
3135+
$ref: '#/components/schemas/SaveComment_200_response'
3136+
type: array
3137+
description: Ok
3138+
security:
3139+
- api_key: []
3140+
x-content-type: application/json
3141+
x-accepts:
3142+
- application/json
30763143
/api/v1/comments/{id}/flag:
30773144
post:
30783145
operationId: FlagComment
@@ -3602,6 +3669,7 @@ components:
36023669
enableSpoilers: true
36033670
disableUnverifiedLabel: true
36043671
noStyles: true
3672+
enableResizeHandle: true
36053673
absoluteDates: true
36063674
limitCommentsByGroups: true
36073675
enableWYSIWYG: true
@@ -3752,6 +3820,8 @@ components:
37523820
type: boolean
37533821
requireSSO:
37543822
type: boolean
3823+
enableResizeHandle:
3824+
type: boolean
37553825
restrictedLinkDomains:
37563826
items:
37573827
type: string
@@ -3863,6 +3933,7 @@ components:
38633933
enableSpoilers: true
38643934
disableUnverifiedLabel: true
38653935
noStyles: true
3936+
enableResizeHandle: true
38663937
absoluteDates: true
38673938
limitCommentsByGroups: true
38683939
enableWYSIWYG: true
@@ -5821,6 +5892,7 @@ components:
58215892
enableSpoilers: true
58225893
disableUnverifiedLabel: true
58235894
noStyles: true
5895+
enableResizeHandle: true
58245896
absoluteDates: true
58255897
limitCommentsByGroups: true
58265898
enableWYSIWYG: true
@@ -7081,6 +7153,7 @@ components:
70817153
commentHTML: commentHTML
70827154
isDeleted: true
70837155
imported: true
7156+
permNotSpam: true
70847157
pageNumberOF: 2
70857158
localDateHours: 0
70867159
viewCount: 7.386281948385884
@@ -7215,6 +7288,8 @@ components:
72157288
type: string
72167289
isSpam:
72177290
type: boolean
7291+
permNotSpam:
7292+
type: boolean
72187293
aiDeterminedSpam:
72197294
type: boolean
72207295
hasImages:
@@ -8408,6 +8483,7 @@ components:
84088483
commentHTML: commentHTML
84098484
isDeleted: true
84108485
imported: true
8486+
permNotSpam: true
84118487
pageNumberOF: 2
84128488
localDateHours: 0
84138489
viewCount: 7.386281948385884

client/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'java'
44
apply plugin: 'com.diffplug.spotless'
55

66
group = 'com.fastcomments'
7-
version = '0.0.19'
7+
version = '0.0.20'
88

99
buildscript {
1010
repositories {

client/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "com.fastcomments",
44
name := "client",
5-
version := "0.0.19",
5+
version := "0.0.20",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

client/docs/CustomConfigParameters.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
|**pageSize** | **Double** | | [optional] |
6161
|**readonly** | **Boolean** | | [optional] |
6262
|**requireSSO** | **Boolean** | | [optional] |
63+
|**enableResizeHandle** | **Boolean** | | [optional] |
6364
|**restrictedLinkDomains** | **List&lt;String&gt;** | | [optional] |
6465
|**showCommentSaveSuccess** | **Boolean** | | [optional] |
6566
|**showLiveRightAway** | **Boolean** | | [optional] |

client/docs/DefaultApi.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ All URIs are relative to *http://localhost*
3131
| [**patchDomainConfig**](DefaultApi.md#patchDomainConfig) | **PATCH** /api/v1/domain-configs/{domainToUpdate} | |
3232
| [**putDomainConfig**](DefaultApi.md#putDomainConfig) | **PUT** /api/v1/domain-configs/{domainToUpdate} | |
3333
| [**saveComment**](DefaultApi.md#saveComment) | **POST** /api/v1/comments | |
34+
| [**saveCommentsBulk**](DefaultApi.md#saveCommentsBulk) | **POST** /api/v1/comments/bulk | |
3435
| [**unBlockUserFromComment**](DefaultApi.md#unBlockUserFromComment) | **POST** /api/v1/comments/{id}/un-block | |
3536
| [**unFlagComment**](DefaultApi.md#unFlagComment) | **POST** /api/v1/comments/{id}/un-flag | |
3637
| [**updateComment**](DefaultApi.md#updateComment) | **PATCH** /api/v1/comments/{id} | |
@@ -2038,6 +2039,88 @@ public class Example {
20382039
|-------------|-------------|------------------|
20392040
| **200** | Ok | - |
20402041

2042+
<a id="saveCommentsBulk"></a>
2043+
# **saveCommentsBulk**
2044+
> List&lt;SaveComment200Response&gt; saveCommentsBulk(tenantId, createCommentParams).isLive(isLive).doSpamCheck(doSpamCheck).sendEmails(sendEmails).populateNotifications(populateNotifications).execute();
2045+
2046+
2047+
2048+
### Example
2049+
```java
2050+
// Import classes:
2051+
import com.fastcomments.invoker.ApiClient;
2052+
import com.fastcomments.invoker.ApiException;
2053+
import com.fastcomments.invoker.Configuration;
2054+
import com.fastcomments.invoker.auth.*;
2055+
import com.fastcomments.invoker.models.*;
2056+
import com.fastcomments.api.DefaultApi;
2057+
2058+
public class Example {
2059+
public static void main(String[] args) {
2060+
ApiClient defaultClient = Configuration.getDefaultApiClient();
2061+
defaultClient.setBasePath("http://localhost");
2062+
2063+
// Configure API key authorization: api_key
2064+
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
2065+
api_key.setApiKey("YOUR API KEY");
2066+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
2067+
//api_key.setApiKeyPrefix("Token");
2068+
2069+
DefaultApi apiInstance = new DefaultApi(defaultClient);
2070+
String tenantId = "tenantId_example"; // String |
2071+
List<CreateCommentParams> createCommentParams = Arrays.asList(); // List<CreateCommentParams> |
2072+
Boolean isLive = true; // Boolean |
2073+
Boolean doSpamCheck = true; // Boolean |
2074+
Boolean sendEmails = true; // Boolean |
2075+
Boolean populateNotifications = true; // Boolean |
2076+
try {
2077+
List<SaveComment200Response> result = apiInstance.saveCommentsBulk(tenantId, createCommentParams)
2078+
.isLive(isLive)
2079+
.doSpamCheck(doSpamCheck)
2080+
.sendEmails(sendEmails)
2081+
.populateNotifications(populateNotifications)
2082+
.execute();
2083+
System.out.println(result);
2084+
} catch (ApiException e) {
2085+
System.err.println("Exception when calling DefaultApi#saveCommentsBulk");
2086+
System.err.println("Status code: " + e.getCode());
2087+
System.err.println("Reason: " + e.getResponseBody());
2088+
System.err.println("Response headers: " + e.getResponseHeaders());
2089+
e.printStackTrace();
2090+
}
2091+
}
2092+
}
2093+
```
2094+
2095+
### Parameters
2096+
2097+
| Name | Type | Description | Notes |
2098+
|------------- | ------------- | ------------- | -------------|
2099+
| **tenantId** | **String**| | |
2100+
| **createCommentParams** | [**List&lt;CreateCommentParams&gt;**](CreateCommentParams.md)| | |
2101+
| **isLive** | **Boolean**| | [optional] |
2102+
| **doSpamCheck** | **Boolean**| | [optional] |
2103+
| **sendEmails** | **Boolean**| | [optional] |
2104+
| **populateNotifications** | **Boolean**| | [optional] |
2105+
2106+
### Return type
2107+
2108+
[**List&lt;SaveComment200Response&gt;**](SaveComment200Response.md)
2109+
2110+
### Authorization
2111+
2112+
[api_key](../README.md#api_key)
2113+
2114+
### HTTP request headers
2115+
2116+
- **Content-Type**: application/json
2117+
- **Accept**: application/json
2118+
2119+
### HTTP response details
2120+
| Status code | Description | Response headers |
2121+
|-------------|-------------|------------------|
2122+
| **200** | Ok | - |
2123+
20412124
<a id="unBlockUserFromComment"></a>
20422125
# **unBlockUserFromComment**
20432126
> UnBlockCommentPublic200Response unBlockUserFromComment(tenantId, id, unBlockFromCommentParams).userId(userId).anonUserId(anonUserId).execute();

client/docs/FComment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
|**externalParentId** | **String** | | [optional] |
4040
|**avatarSrc** | **String** | | [optional] |
4141
|**isSpam** | **Boolean** | | [optional] |
42+
|**permNotSpam** | **Boolean** | | [optional] |
4243
|**aiDeterminedSpam** | **Boolean** | | [optional] |
4344
|**hasImages** | **Boolean** | | [optional] |
4445
|**pageNumber** | **Integer** | | [optional] |

client/docs/PublicApi.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ No authorization required
740740

741741
<a id="getCommentsPublic"></a>
742742
# **getCommentsPublic**
743-
> GetCommentsPublic200Response getCommentsPublic(tenantId, urlId).page(page).direction(direction).sso(sso).skip(skip).skipChildren(skipChildren).limit(limit).limitChildren(limitChildren).countChildren(countChildren).lastGenDate(lastGenDate).fetchPageForCommentId(fetchPageForCommentId).includeConfig(includeConfig).countAll(countAll).includei10n(includei10n).locale(locale).modules(modules).isCrawler(isCrawler).includeNotificationCount(includeNotificationCount).asTree(asTree).maxTreeDepth(maxTreeDepth).useFullTranslationIds(useFullTranslationIds).parentId(parentId).searchText(searchText).hashTags(hashTags).userId(userId).customConfigStr(customConfigStr).execute();
743+
> GetCommentsPublic200Response getCommentsPublic(tenantId, urlId).page(page).direction(direction).sso(sso).skip(skip).skipChildren(skipChildren).limit(limit).limitChildren(limitChildren).countChildren(countChildren).fetchPageForCommentId(fetchPageForCommentId).includeConfig(includeConfig).countAll(countAll).includei10n(includei10n).locale(locale).modules(modules).isCrawler(isCrawler).includeNotificationCount(includeNotificationCount).asTree(asTree).maxTreeDepth(maxTreeDepth).useFullTranslationIds(useFullTranslationIds).parentId(parentId).searchText(searchText).hashTags(hashTags).userId(userId).customConfigStr(customConfigStr).afterCommentId(afterCommentId).beforeCommentId(beforeCommentId).execute();
744744
745745

746746

@@ -771,7 +771,6 @@ public class Example {
771771
Integer limit = 56; // Integer |
772772
Integer limitChildren = 56; // Integer |
773773
Boolean countChildren = true; // Boolean |
774-
Long lastGenDate = 56L; // Long |
775774
String fetchPageForCommentId = "fetchPageForCommentId_example"; // String |
776775
Boolean includeConfig = true; // Boolean |
777776
Boolean countAll = true; // Boolean |
@@ -788,6 +787,8 @@ public class Example {
788787
List<String> hashTags = Arrays.asList(); // List<String> |
789788
String userId = "userId_example"; // String |
790789
String customConfigStr = "customConfigStr_example"; // String |
790+
String afterCommentId = "afterCommentId_example"; // String |
791+
String beforeCommentId = "beforeCommentId_example"; // String |
791792
try {
792793
GetCommentsPublic200Response result = apiInstance.getCommentsPublic(tenantId, urlId)
793794
.page(page)
@@ -798,7 +799,6 @@ public class Example {
798799
.limit(limit)
799800
.limitChildren(limitChildren)
800801
.countChildren(countChildren)
801-
.lastGenDate(lastGenDate)
802802
.fetchPageForCommentId(fetchPageForCommentId)
803803
.includeConfig(includeConfig)
804804
.countAll(countAll)
@@ -815,6 +815,8 @@ public class Example {
815815
.hashTags(hashTags)
816816
.userId(userId)
817817
.customConfigStr(customConfigStr)
818+
.afterCommentId(afterCommentId)
819+
.beforeCommentId(beforeCommentId)
818820
.execute();
819821
System.out.println(result);
820822
} catch (ApiException e) {
@@ -842,7 +844,6 @@ public class Example {
842844
| **limit** | **Integer**| | [optional] |
843845
| **limitChildren** | **Integer**| | [optional] |
844846
| **countChildren** | **Boolean**| | [optional] |
845-
| **lastGenDate** | **Long**| | [optional] |
846847
| **fetchPageForCommentId** | **String**| | [optional] |
847848
| **includeConfig** | **Boolean**| | [optional] |
848849
| **countAll** | **Boolean**| | [optional] |
@@ -859,6 +860,8 @@ public class Example {
859860
| **hashTags** | [**List&lt;String&gt;**](String.md)| | [optional] |
860861
| **userId** | **String**| | [optional] |
861862
| **customConfigStr** | **String**| | [optional] |
863+
| **afterCommentId** | **String**| | [optional] |
864+
| **beforeCommentId** | **String**| | [optional] |
862865

863866
### Return type
864867

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>client</artifactId>
66
<packaging>jar</packaging>
77
<name>client</name>
8-
<version>0.0.19</version>
8+
<version>0.0.20</version>
99
<url>https://fastcomments.com</url>
1010
<description>FastComments API Client - A SDK for interacting with the FastComments API</description>
1111
<scm>

0 commit comments

Comments
 (0)