Skip to content

api:list all connections and get by connection by id #29#37

Merged
aliamerj merged 1 commit intoDcup-dev:mainfrom
aliamerj:ingestion-api-endpoints
Apr 5, 2025
Merged

api:list all connections and get by connection by id #29#37
aliamerj merged 1 commit intoDcup-dev:mainfrom
aliamerj:ingestion-api-endpoints

Conversation

@aliamerj
Copy link
Collaborator

@aliamerj aliamerj commented Apr 5, 2025

Part: #29

Description:

  • define api endpoint /api/connections : list all connections for this api
  • define api endpoint /api/connections/[id] : get connection by id
API Response Object
{
    "connectionId": "56bd7773-507d-4a78-85a0-0377e1c59db6",
    "identifier": "game",
    "source": "DIRECT_UPLOAD",
    "sourceFolder": "*",
    "metadata": {
        "type": "my files"
    },
    "isConfigSet": true,
    "lastSynced": "2025-04-04T15:36:01.789Z",
    "createdAt": "2025-04-02T20:53:07.573Z",
    "chunkCount": 2,
    "pageCount": 1,
    "files": [
        {
            "name": "resume.pdf",
            "totalPages": 1,
            "chunksIds": [
                "09692e32-444b-4522-85fc-d0f6992c700f",
                "a0a84e26-7083-4e38-85f1-c8c86323e22b"
            ]
        }
    ]
}

@aliamerj aliamerj requested a review from Copilot April 5, 2025 08:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

lib/api_key.ts:32

  • [nitpick] For an unauthorized error, consider using a message that clearly indicates missing or invalid authorization rather than a generic 'not found' message.
message: "The requested resource was not found."

app/api/connections/[id]/route.ts:76

  • [nitpick] Consider using a consistent error code format such as 'not_found' and ensuring the message has proper capitalization (e.g., 'Connection not found').
code: "Not Found",

@aliamerj aliamerj requested a review from Copilot April 5, 2025 09:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

app/api/connections/[id]/route.ts:9

  • The definition of Params wraps 'params' in a Promise, which is unconventional as route parameters are typically provided directly rather than as a Promise. Consider defining it as a plain object.
type Params = { params: Promise<{ id: string }> }

app/api/connections/[id]/route.ts:77

  • The error message 'connection Not Found' should be capitalized consistently (i.e., 'Connection Not Found') to improve clarity and consistency in error responses.
message: "connection Not Found",

Signed-off-by: aliamerj <aliamer19ali@gmail.com>
@aliamerj aliamerj merged commit a0a4671 into Dcup-dev:main Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants