Giter Club home page Giter Club logo

formkiq / formkiq-core Goto Github PK

View Code? Open in Web Editor NEW
91.0 7.0 13.0 12.77 MB

A full-featured Document Layer for your application, providing the functionality of a flexible document management system, including storage, discovery, processing, and retrieval. Deploys directly into your Amazon Web Services Cloud. ๐ŸŒŸ Star to support our work!

Home Page: https://www.formkiq.com

License: Other

Java 99.62% Shell 0.02% JavaScript 0.28% Dockerfile 0.04% Python 0.04%
amazon-web-services aws cloud-storage dms document-api document-apis document-database document-management document-management-system document-processing

formkiq-core's People

Contributors

formkiqmike avatar mfriesen avatar reganwolfrom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

formkiq-core's Issues

Adding tags with POST document/{id}/tags gives 500 when using key/value for same key more than once

On POST /documents/{documentId}/tags, the following results in a 500 - Internal Service Error:
{"tags":[{"key": "author", "value": "William Shakespeare"},{"key": "author", "value": "Kevin Bacon"}]}

Workaround is to submit the key once and the values in an array:
{"tags":[{"key": "author", "values": ["William Shakespeare", "Kevin Bacon"]}]}

It's possible to allow this request with the same key, but my preference would be to return a clear error message stating that the key can only be included once in the body.

Suggestion:
400 - "Tag key can only be included once in body; please use 'values' to assign multiple tag values to that key"

GET /documents/{id}/upload overwrites file without creating a new version

Steps to reproduce:

  1. Upload a PDF file -> POST /documents/upload
  2. Go to versions; expected result is to have only one version (current)
  3. Click "Upload new PDF" and select a new version of the file -> GET /documents/{id}/upload
  4. Document uploads but no new version is created, i.e., GET /documents/{id}/versions responds with empty array for documents

searchFulltext tag logic

Currently, if I pass in a number of tags with the body payload, I get results that match any of those key/value pairs, even if only one of those tags matched. This creates a result set that is more broad that I had expected. It would be nice if all given tags were required to match. This would allow the eqOr property to be a true OR while all the given tags are AND'd together. In OpenSearch/elasticsearch syntax, this might look something like the following.

Assume I'm sending in two tags. The first "userid" has an "eq" property of 100, and a second tag "itemid" is using the "eqOr" property with a value of ["4", "7", "13"].

bool: {
    must: [
        {
            bool: {
                should: [{
                    key: "userid",
                    value: "100"
                }]
            }
        },
        {
            bool: {
                should: [
                    {
                        key: "itemid",
                        value: "4"
                    },
                    {
                        key: "itemid",
                        value: "7"
                    },
                    {
                        key: "itemid",
                        value: "13"
                    }
                ]
            }
        }
    ]
}

This query requires that any returned result includes a userid tag with value 100, and an itemid tag with a value of 4, or 7, or 13.

PATCH documents/{id} with path parameter duplicates file in DynamoDB

curl "https://ojjn7xmet4.execute-api.us-east-2.amazonaws.com/documents/5c1109ce-6d89-4267-9edd-99a4e99597bf?siteId=default" -H "Authorization: {AUTH}" -d "{\"path\":\"user25.json\",\"tags\":[{\"key\":\"goat\",\"value\":\"text\"}]}"

Took an existing document, renamed it, but created a second entry in the DynamoDB results with the same documentId.

Document Meta Data / Versioning

There is a need to allow custom document meta data in addition to Tags. Document meta data would be different to document tags in the following ways:

  • Meta Data is versioned (and stored in a different DynamoDB Table)
  • Meta Data attributes can have a "type" -> TBD on what kind of types there would be but things like TIMESTAMP, TEXT (max 1000 characters), Date, etc
  • would need an endpoint like POST /documents/{documentId}/versionRestore/{versionId} to restore to a previous version
  • In addition would need an endpoint to DELETE version like /documents/{documentId}/versions/{versionId}

Rules around deleting a versions would be controlled by #68

Add a "indexFilterBeginsWith" string param to POST /search by meta

In order to create a UI to select a folder as a destination for moving a document or folder, it would be more efficient to be able to retrieve only folders in POST /search, rather than retrieving documents as well and needing to filter.

e.g.
{"query":{"meta":{"folder":""}},"responseFields":{"tags":["sysFavoritedBy","sysSharedWith","sysDeletedBy","english","marketing","path","Test","untagged"]}}

{"query":{"meta":{"folder":"Version/"}},"responseFields":{"tags":["sysFavoritedBy","sysSharedWith","sysDeletedBy","english","marketing","path","Test","untagged"]}}

Add Modules to /versions

In the /versions, add a "modules" string array to list which modules are enabled in the formkiq installation

Add folder rename endpoint

We are able to rename documents with PATCH /documents/{id} by specifying a new path, but there is currently no way to rename folder index items. Ideally, we would have an endpoint such as this: /indices/folder/rename that accepts the full path parameter and a folder name (no path) and renames the folder.

Conversely, we could allow a new full path that could function as a "mv" command, but this functionality is already available using POST /indices/folder/move

Since "path" is stored on the document level as well. Potentially would have to update all the documents "path" as well.

Fail more gracefully if Fulltext module isn't configured correctly

java.io.IOException: unable to update Fulltext
at com.formkiq.stacks.api.handler.DocumentTagsRequestHandler.updateFulltextIfInstalled(DocumentTagsRequestHandler.java:286)
at com.formkiq.stacks.api.handler.DocumentTagsRequestHandler.post(DocumentTagsRequestHandler.java:218)
at com.formkiq.aws.services.lambda.AbstractRestApiRequestHandler.callHandlerMethod(AbstractRestApiRequestHandler.java:166)
at com.formkiq.aws.services.lambda.AbstractRestApiRequestHandler.processRequest(AbstractRestApiRequestHandler.java:411)
at com.formkiq.aws.services.lambda.AbstractRestApiRequestHandler.processApiGatewayRequest(AbstractRestApiRequestHandler.java:349)
at com.formkiq.aws.services.lambda.AbstractRestApiRequestHandler.handleRequest(AbstractRestApiRequestHandler.java:286)

Document Dead Letter Queue

If a document fails to process, it should be moved to a dead-letter S3 bucket to allow for reprocessing or tracking which documents failed to load.

PUT documents/{id}/versions does not appear to be changing "current" version

When submitting a PUT to change version using version key, the response comes back ok, but retrieving the document without a version does not retrieve the version that had been specified as current using this endpoint.

PUT /documents/8c5f826f-3bec-4079-a244-78489e5fa1e3/versions?siteId=default

{"versionKey":"document%232022-11-20T20%3A00%3A00%2B0000%23v3"}

Response 200:
{"message":"Set Document to version"}

Improvements to Tag Schema endpoints

When attempting to GET a non-existent Tag Schema, a 500 is returned:
{"message":"Internal Server Error"}

Upon submitting a DELETE request for a Tag Schema, the message does not mention that the deletion has occurred:
{"tagSchemaId":"1d65ce16-c82e-43c7-b107-d54ab1267e68"}

Add option for content-disposition:inline to S3 signed URL on GET /documents/{id}/url

Currently, S3 signed URL defaults to content-disposition:attachment;filename=BLAH, and this does not always allow for rendering of files within the browser.

If we had a parameter such as ?inline=true on GET /documents/{id}/url that provided content-disposition:inline;filename=BLAH, this may allow us to render the documents inline (as the content type allows) more easily

PATCH /documents/{id} is not replacing specified metadata

Observed with tags property.

Example:

PATCH /documents/{id}
{
  "tags": [
    {
      "key": "author",
      "value": "Bacon"
    }
  ]
}

An upload URL is returned (to allow document itself to be updated), but the metadata (at least not tags) is not updated.

DocumentUpdate possible race condition

The DocumentUpdate update all document fields when it only needs to update Content-Type, Content-Length, and Checksum. If another process updates document data before the DocumentUpdate runs it could be overwritten.

Not able to install with latest AWS Sam Release

Not able to create create AWS cloudformation stack with latest AWS SAM CLI release.
Somehow gave error for S3 bucket creation.
Tried with Linux and Mac versions.
Once I took earlier version - Feb 2021, it started to work.

Add API endpoint to remove a document from one folder index and add to another

As folders hold a list of documents within, moving a document from one folder to another would require an API call to remove the document from the source folder and add to the destination folder.

Example endpoint:

POST /documents/{id}/move
{"sourceFolder": "Client ABC", "destinationFolder": "Client ABC/Client ABC Workspace"}

NOTE: if we want to use move as the resource, we can also include siteId in future, allowing a move between folders, sites, or both, e.g., sourceSiteId

500 Error in /search endpoint when using large "limit" with "responseFields"

I am able to reliably get results from the POST document search endpoint when providing a body parameter, but as soon as I add the "limit" query parameter, it returns with a 500 error.

Furthermore, the documentation says that the limit parameter has a default of "null", but the results are always limited to 10 in the absence of the limit query param.

Add FormKiQ Version to CloudFormation description

The FormKiQ version installed is displayed in the CloudFormation Outputs, but it would be nice if it was also displayed in the CloudFormation template description, so it would be easier to see the FK version of each stack.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.