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

[content-nodes] Add a log and update the doc for lastUpdatedAt #9969

Merged
merged 5 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const config = {
* description: 'Reserved for internal use, should not be set. Document and ancestor ids, with the following convention: parents[0] === documentId, parents[1] === parent_id, and then ancestors ids in order.'
* timestamp:
* type: number
* description: Unix timestamp (in seconds) for the document (e.g. 1698225000). Can be null or omitted.
* description: Reserved for internal use, should not be set. Unix timestamp (in seconds) of the time the document was last updated (e.g. 1698225000).
* light_document_output:
* type: boolean
* description: If true, a lightweight version of the document will be returned in the response (excluding the text, chunks and vectors). Defaults to false.
Expand Down Expand Up @@ -388,6 +388,19 @@ async function handler(
});
}

// TODO(content-node): get rid of this once the use of timestamp columns in core has been rationalized
if (!auth.isSystemKey() && r.data.timestamp) {
logger.info(
{
workspaceId: owner.id,
dataSourceId: dataSource.sId,
timestamp: r.data.timestamp,
currentDate: Date.now(),
},
"[ContentNode] User-set timestamp."
);
}

let sourceUrl: string | null = null;
if (r.data.source_url) {
const { valid: isSourceUrlValid, standardized: standardizedSourceUrl } =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ import { apiError } from "@app/logger/withlogging";
* description: Description of the table
* timestamp:
* type: number
* description: Timestamp of the table
* description: Reserved for internal use, should not be set. Unix timestamp (in seconds) of the time the document was last updated (e.g. 1698225000).
* tags:
* type: array
* items:
Expand Down Expand Up @@ -308,6 +308,18 @@ async function handler(
mimeType = r.data.mime_type;
title = r.data.title;
} else {
// TODO(content-node): get rid of this once the use of timestamp columns in core has been rationalized
if (r.data.timestamp) {
logger.info(
{
workspaceId: owner.id,
dataSourceId: dataSource.sId,
timestamp: r.data.timestamp,
currentDate: Date.now(),
},
"[ContentNode] User-set timestamp."
);
}
// If the request is from a regular API key, the request must not provide mimeType.
if (r.data.mime_type) {
return apiError(req, res, {
Expand Down
2 changes: 1 addition & 1 deletion front/pages/api/v1/w/[wId]/spaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type GetSpacesResponseBody =
* @swagger
* /api/v1/w/{wId}/spaces:
* get:
* summary: List Spaces accessible.
* summary: List available spaces.
* description: Retrieves a list of accessible spaces for the authenticated workspace.
* tags:
* - Spaces
Expand Down
6 changes: 3 additions & 3 deletions front/public/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,7 @@
},
"timestamp": {
"type": "number",
"description": "Unix timestamp (in seconds) for the document (e.g. 1698225000). Can be null or omitted."
"description": "Reserved for internal use, should not be set. Unix timestamp (in seconds) of the time the document was last updated (e.g. 1698225000)."
},
"light_document_output": {
"type": "boolean",
Expand Down Expand Up @@ -3185,7 +3185,7 @@
},
"timestamp": {
"type": "number",
"description": "Timestamp of the table"
"description": "Reserved for internal use, should not be set. Unix timestamp (in seconds) of the time the document was last updated (e.g. 1698225000)."
},
"tags": {
"type": "array",
Expand Down Expand Up @@ -3296,7 +3296,7 @@
},
"/api/v1/w/{wId}/spaces": {
"get": {
"summary": "List Spaces accessible.",
"summary": "List available spaces.",
"description": "Retrieves a list of accessible spaces for the authenticated workspace.",
"tags": [
"Spaces"
Expand Down
Loading