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

V1.10.0 #120

Merged
merged 104 commits into from
Mar 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
143d431
v1.10.0
formkiqMike Dec 22, 2022
c35698d
updated dependencies to latest
formkiqMike Dec 22, 2022
a6fec12
#91 - Add "module_typesense"
formkiqMike Dec 23, 2022
e7cb240
#93 - GET & POST /document/{documentId}/syncs
formkiqMike Dec 23, 2022
8f2f126
added tag to IndexSearch description
reganwolfrom Dec 23, 2022
adb4293
updates
formkiqMike Dec 24, 2022
176beb0
Added Syncs Dynamodb table & permissions
formkiqMike Dec 24, 2022
dc4cf41
update
formkiqMike Dec 24, 2022
a4fc78b
fixes
formkiqMike Dec 27, 2022
b159fc2
update
formkiqMike Dec 27, 2022
7b42a49
update
formkiqMike Dec 28, 2022
557e6e9
update
formkiqMike Dec 28, 2022
db8ff6b
Null check
formkiqMike Dec 31, 2022
68e5be1
Added Metadata to Fulltext APIs
formkiqMike Jan 1, 2023
678a4ae
Removed using FormKiQ Client to update Opensearch
formkiqMike Jan 2, 2023
b07f99c
update
formkiqMike Jan 2, 2023
996dfae
update
formkiqMike Jan 2, 2023
ef85fe3
Added Document Sync message
formkiqMike Jan 2, 2023
93e5332
added message
formkiqMike Jan 2, 2023
0081ede
update
formkiqMike Jan 2, 2023
c4c2e06
changed updating Fulltext content to PATCH request
formkiqMike Jan 3, 2023
50e7922
update
formkiqMike Jan 3, 2023
eaa6914
update
formkiqMike Jan 4, 2023
5d2a3c8
update
formkiqMike Jan 4, 2023
377eeea
update
formkiqMike Jan 5, 2023
958bb9f
Added S3Service Delete Object version
formkiqMike Jan 6, 2023
f13a2ea
Added versionId to getObjectMetadata
formkiqMike Jan 6, 2023
97df828
#100 - Add DELETE /documents/{documentId}/versions/{versionKey}
formkiqMike Jan 6, 2023
058d0ff
#77 - Add DELETE /indices/tags/TAG_KEY support
formkiqMike Jan 6, 2023
c4ff9b5
update
formkiqMike Jan 7, 2023
d5870d0
#107 - Add FormKiQ CLI to GET /document/{documentId}/syncs
formkiqMike Jan 9, 2023
4ead2f2
#108 - Add to /search ability to search for path in metadata
formkiqMike Jan 12, 2023
2ac2d29
update
formkiqMike Jan 13, 2023
3fe959c
update
formkiqMike Jan 13, 2023
d2feeec
update
formkiqMike Jan 13, 2023
61e91a1
updated OpenAPI version to 1.10
formkiqMike Jan 14, 2023
dd2ccc4
fixed lambda api
formkiqMike Jan 15, 2023
f868c07
update
formkiqMike Jan 15, 2023
4d7543e
#99 - Upgrade Graalvm to 22.3
formkiqMike Jan 29, 2023
d021ae8
#109 - AWS Lambda now supports Maximum Concurrency for Amazon SQS as …
formkiqMike Feb 2, 2023
8de26f7
#112 - Change Webhook action to return entire document instead of jus…
formkiqMike Feb 2, 2023
463af23
#111 - Updating Content doesn't update contentLength
formkiqMike Feb 2, 2023
27790de
#109 - reinverted AWS Lambda now supports Maximum Concurrency for Ama…
formkiqMike Feb 3, 2023
14f8225
#51 - POST /documents/{documentId}/action doesn't run action
formkiqMike Feb 3, 2023
30ea6ca
update
formkiqMike Feb 4, 2023
649a5fc
update
formkiqMike Feb 4, 2023
0c2c98d
#114 - Add 'characterMax' to parameter to 'fulltext'
formkiqMike Feb 4, 2023
dee754d
#113 - Add Installation Parameter for specifying Typesense Memory
formkiqMike Feb 5, 2023
2e9c1dc
update
formkiqMike Feb 5, 2023
001c2c4
update
formkiqMike Feb 5, 2023
445b486
#82 - Add a "indexFilterBeginsWith" string param to POST /search by meta
formkiqMike Feb 7, 2023
b29b1fd
update
formkiqMike Feb 9, 2023
9ff04e2
Added allow read users to call /indices/search API
formkiqMike Feb 12, 2023
1fe25cc
fixed document syncs issue
formkiqMike Feb 14, 2023
827947e
update
formkiqMike Feb 14, 2023
d4ba0ae
wrap quotes around filename
formkiqMike Feb 14, 2023
a32bc98
Fixed readonly permission got GET / documents/upload
formkiqMike Feb 14, 2023
0af6166
Fixed lambda to throw errors correctly
formkiqMike Feb 14, 2023
566b12e
#115 - Turn on API Gateway Access Logs
formkiqMike Feb 16, 2023
c564d9e
update
formkiqMike Feb 17, 2023
d90e4a3
Added Cognito API to CloudWatch Dashboard
formkiqMike Feb 17, 2023
03b4066
fixed tests
formkiqMike Feb 18, 2023
ecbe80a
fixed typeprocessor subdocument
formkiqMike Feb 18, 2023
a0d9056
update
formkiqMike Feb 19, 2023
29295c9
update
formkiqMike Feb 21, 2023
72f0092
update
formkiqMike Feb 21, 2023
bab02fd
update
formkiqMike Feb 21, 2023
6de61c2
udpate
formkiqMike Feb 21, 2023
e6443ed
update
formkiqMike Feb 21, 2023
de84649
update
formkiqMike Feb 21, 2023
fbdd8c4
update
formkiqMike Feb 21, 2023
7f8cf6a
update
formkiqMike Feb 21, 2023
f7301e5
added siteId permissions
formkiqMike Feb 23, 2023
70308c0
Added CertificateStackName support
formkiqMike Feb 24, 2023
70e0593
added /sites permissions
formkiqMike Feb 24, 2023
5092f2d
update
formkiqMike Feb 24, 2023
c092d91
update
formkiqMike Feb 25, 2023
1fb8cea
update
formkiqMike Feb 25, 2023
1e92aff
simplified copy
formkiqMike Feb 25, 2023
b6021d1
update
formkiqMike Feb 25, 2023
9439332
update
formkiqMike Feb 25, 2023
238d94d
update
formkiqMike Feb 25, 2023
434b404
update
formkiqMike Feb 25, 2023
2f15c09
update
formkiqMike Feb 25, 2023
04513d3
update
formkiqMike Feb 25, 2023
028ffcf
update
formkiqMike Feb 25, 2023
9649b5a
update
formkiqMike Feb 25, 2023
2176f32
update
formkiqMike Feb 25, 2023
ed07d62
update
formkiqMike Feb 26, 2023
947e46d
update
formkiqMike Feb 26, 2023
8a8abe9
update
formkiqMike Feb 26, 2023
f79380b
update
formkiqMike Feb 26, 2023
899347e
update
formkiqMike Feb 26, 2023
8338a6b
update
formkiqMike Mar 2, 2023
091a0b4
update
formkiqMike Mar 2, 2023
b63a93c
added typesense endpoint output
formkiqMike Mar 3, 2023
6d8e0db
update
formkiqMike Mar 3, 2023
78a2bb1
Fixed typesense fulltext search
formkiqMike Mar 3, 2023
5703358
fixed deleting typesense from siteId
formkiqMike Mar 4, 2023
1b2dc45
fixed deleting typesense record when not deleting document
formkiqMike Mar 4, 2023
4a7bc60
update
formkiqMike Mar 4, 2023
c9ae5b4
fixed deleting document versions when removing document
formkiqMike Mar 4, 2023
65b5f38
update
formkiqMike Mar 4, 2023
5a69ddd
Fixed requiring vpc to be not empty
formkiqMike Mar 11, 2023
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
2 changes: 1 addition & 1 deletion actions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
testImplementation project(':fkq-test-utils')
testImplementation project(':fkq-plugins')
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version:'5.9.1'
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: '1.17.3'
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: '1.17.6'
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class ActionsServiceDynamoDbTest {
@BeforeAll
public static void beforeAll() throws Exception {

DynamoDbConnectionBuilder db = DynamoDbTestServices.getDynamoDbConnection(null);
DynamoDbConnectionBuilder db = DynamoDbTestServices.getDynamoDbConnection();
service = new ActionsServiceDynamoDb(db, DOCUMENTS_TABLE);
documentService =
new DocumentServiceImpl(db, DOCUMENTS_TABLE, new DocumentVersionServiceNoVersioning());
Expand Down
6 changes: 3 additions & 3 deletions aws-cognito/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
description = "AWS Cognito"

dependencies {
api group: 'software.amazon.awssdk', name: 'cognitoidentity', version: '2.17.252'
api group: 'software.amazon.awssdk', name: 'cognitoidentityprovider', version: '2.17.252'
implementation group: 'software.amazon.awssdk', name: 'url-connection-client', version: '2.17.252'
api group: 'software.amazon.awssdk', name: 'cognitoidentity', version: '2.19.2'
api group: 'software.amazon.awssdk', name: 'cognitoidentityprovider', version: '2.19.2'
implementation group: 'software.amazon.awssdk', name: 'url-connection-client', version: '2.19.2'

configurations.all {
exclude group: 'software.amazon.awssdk', module: 'apache-client'
Expand Down
4 changes: 2 additions & 2 deletions aws-dynamodb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
description = "AWS DynamoDB"

dependencies {
api group: 'software.amazon.awssdk', name: 'dynamodb', version: '2.17.252'
api group: 'software.amazon.awssdk', name: 'dynamodb', version: '2.19.2'
implementation project(':fkq-lambda-services')
implementation group: 'software.amazon.awssdk', name: 'url-connection-client', version: '2.17.252'
implementation group: 'software.amazon.awssdk', name: 'url-connection-client', version: '2.19.2'
implementation group: 'com.formkiq', name: 'graalvm-annotations', version: '1.1.0'

testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version:'5.9.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
package com.formkiq.aws.dynamodb;

import java.net.URI;
import java.net.URISyntaxException;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
Expand Down Expand Up @@ -100,12 +99,11 @@ public DynamoDbConnectionBuilder setCredentials(final String credentials) {
/**
* Set Endpoint Override.
*
* @param uri {@link String}
* @param uri {@link URI}
* @return {@link DynamoDbConnectionBuilder}
* @throws URISyntaxException URISyntaxException
*/
public DynamoDbConnectionBuilder setEndpointOverride(final String uri) throws URISyntaxException {
this.builder = this.builder.endpointOverride(new URI(uri));
public DynamoDbConnectionBuilder setEndpointOverride(final URI uri) {
this.builder = this.builder.endpointOverride(uri);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
*/
package com.formkiq.aws.dynamodb;

import java.util.List;
import java.util.Map;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
import software.amazon.awssdk.services.dynamodb.model.QueryResponse;

/**
*
Expand Down Expand Up @@ -71,9 +71,24 @@ public interface DynamoDbService {
* Query DynamoDB Records.
*
* @param pk {@link AttributeValue}
* @return {@link List} {@link Map}
* @param exclusiveStartKey {@link Map}
* @param limit int
* @return {@link QueryResponse}
*/
List<Map<String, AttributeValue>> query(AttributeValue pk);
QueryResponse query(AttributeValue pk, Map<String, AttributeValue> exclusiveStartKey, int limit);

/**
* Query DynamoDB Records.
*
* @param config {@link QueryConfig}
* @param pk {@link AttributeValue}
* @param sk {@link AttributeValue}
* @param exclusiveStartKey {@link Map}
* @param limit int
* @return {@link QueryResponse}
*/
QueryResponse queryBeginsWith(QueryConfig config, AttributeValue pk, AttributeValue sk,
Map<String, AttributeValue> exclusiveStartKey, int limit);

/**
* Update DynamoDB Record.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import static com.formkiq.aws.dynamodb.DbKeys.PK;
import static com.formkiq.aws.dynamodb.DbKeys.SK;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
Expand Down Expand Up @@ -54,31 +53,31 @@ public class DynamoDbServiceImpl implements DynamoDbService {
/**
* constructor.
*
* @param connection {@link DynamoDbConnectionBuilder}
* @param client {@link DynamoDbClient}
* @param dynamoDbTableName {@link String}
*/
public DynamoDbServiceImpl(final DynamoDbConnectionBuilder connection,
final String dynamoDbTableName) {
public DynamoDbServiceImpl(final DynamoDbClient client, final String dynamoDbTableName) {
if (dynamoDbTableName == null) {
throw new IllegalArgumentException("Table name is null");
}

this.dbClient = connection.build();
this.dbClient = client;
this.tableName = dynamoDbTableName;
}

/**
* constructor.
*
* @param client {@link DynamoDbClient}
* @param connection {@link DynamoDbConnectionBuilder}
* @param dynamoDbTableName {@link String}
*/
public DynamoDbServiceImpl(final DynamoDbClient client, final String dynamoDbTableName) {
public DynamoDbServiceImpl(final DynamoDbConnectionBuilder connection,
final String dynamoDbTableName) {
if (dynamoDbTableName == null) {
throw new IllegalArgumentException("Table name is null");
}

this.dbClient = client;
this.dbClient = connection.build();
this.tableName = dynamoDbTableName;
}

Expand Down Expand Up @@ -121,15 +120,34 @@ private void putItem(final String dynamoDbTable, final Map<String, AttributeValu
}

@Override
public List<Map<String, AttributeValue>> query(final AttributeValue pk) {
public QueryResponse query(final AttributeValue pk,
final Map<String, AttributeValue> exclusiveStartKey, final int limit) {
String expression = PK + " = :pk";
Map<String, AttributeValue> values = Map.of(":pk", pk);
QueryRequest q =
QueryRequest.builder().tableName(this.tableName).keyConditionExpression(expression)
.expressionAttributeValues(values).scanIndexForward(Boolean.FALSE).build();
.expressionAttributeValues(values).scanIndexForward(Boolean.FALSE)
.exclusiveStartKey(exclusiveStartKey).limit(Integer.valueOf(limit)).build();

return this.dbClient.query(q);
}

@Override
public QueryResponse queryBeginsWith(final QueryConfig config, final AttributeValue pk,
final AttributeValue sk, final Map<String, AttributeValue> exclusiveStartKey,
final int limit) {

String expression = PK + " = :pk and begins_with(" + SK + ",:sk)";

Map<String, AttributeValue> values = Map.of(":pk", pk, ":sk", sk);

QueryRequest q = QueryRequest.builder().tableName(this.tableName)
.keyConditionExpression(expression).expressionAttributeValues(values)
.scanIndexForward(Boolean.FALSE).projectionExpression(config.projectionExpression())
.exclusiveStartKey(exclusiveStartKey).limit(Integer.valueOf(limit)).build();

QueryResponse result = this.dbClient.query(q);
return result.items();
QueryResponse response = this.dbClient.query(q);
return response;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.formkiq.stacks.dynamodb;
package com.formkiq.aws.dynamodb;

import java.util.List;
import java.util.Map;
import com.formkiq.aws.dynamodb.PaginationMapToken;

/**
* Pagination Result for a DynamoDB Query.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* MIT License
*
* Copyright (c) 2018 - 2020 FormKiQ
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.formkiq.aws.dynamodb;

/**
*
* DynamoDB Query Config.
*
*/
public class QueryConfig {

/** Projection Expression. */
private String projectionExpression;

/**
* constructor.
*/
public QueryConfig() {

}

/**
* Get Projection Expression.
*
* @return {@link String}
*/
public String projectionExpression() {
return this.projectionExpression;
}

/**
* Set Projection Expression.
*
* @param projection {@link String}
* @return {@link QueryConfig}
*/
public QueryConfig projectionExpression(final String projection) {
this.projectionExpression = projection;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,14 @@ private static String[] split(final String s) {
documentId = String.join("", strs);
}
} else {

siteId = strs[0];
documentId = strs[1];
StringBuffer buf = new StringBuffer(strs[1]);
for (int i = 1; i < strs.length; i++) {
documentId += strs[i];
buf.append(strs[i]);
}

documentId = buf.toString();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.formkiq.module.lambda.typesense;
package com.formkiq.aws.dynamodb.model;

import static com.formkiq.aws.dynamodb.DbKeys.PREFIX_DOCUMENT_METADATA;
import java.util.Arrays;
Expand All @@ -30,33 +30,45 @@
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import software.amazon.awssdk.utils.StringUtils;
import com.formkiq.aws.dynamodb.objects.Strings;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;

/**
*
* {@link Function} for converting {@link Map} to {@link Map}.
*
*/
public class DocumentMapToDocument implements Function<Map<String, Object>, Map<String, Object>> {
public class DocumentMapToDocument
implements Function<Map<String, ? extends Object>, Map<String, Object>> {

/** Fields to Process. */
private static final List<String> FIELDS = Arrays.asList("documentId", "path", "userId");

@SuppressWarnings("unchecked")
@Override
public Map<String, Object> apply(final Map<String, Object> data) {
public Map<String, Object> apply(final Map<String, ? extends Object> data) {

Map<String, Object> document = new HashMap<>();

for (String field : FIELDS) {

if (data.containsKey(field)) {
Object ob = data.get(field);

Map<String, Object> values = (Map<String, Object>) data.get(field);
String value = values.get("S").toString();
if (ob != null) {

String value = null;

if (ob instanceof AttributeValue) {

AttributeValue av = (AttributeValue) ob;
value = av.s();

} else {
Map<String, Object> values = (Map<String, Object>) data.get(field);
value = values.get("S").toString();
}

if (!StringUtils.isEmpty(value)) {
// document.add(new StringField(field, value, Field.Store.YES));
if (!Strings.isEmpty(value)) {
document.put(field, value);
}
}
Expand All @@ -68,12 +80,13 @@ public Map<String, Object> apply(final Map<String, Object> data) {

metadata.forEach(m -> {
Map<String, Object> values = (Map<String, Object>) data.get(m);
String value = values.get("S").toString();
// document.add(new StringField(m, value, Field.Store.YES));
document.put(m, value);

if (values.containsKey("S")) {
String value = values.get("S").toString();
document.put(m, value);
}
});

return document;
}

}
Loading