Skip to content

Commit 0b71d20

Browse files
authored
Rename timestamp fields (#12)
1 parent 85a0619 commit 0b71d20

4 files changed

Lines changed: 34 additions & 34 deletions

File tree

clients/python/lightfeed/models.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class LightfeedConfig(TypedDict, total=False):
1717
class Timestamps(TypedDict):
1818
"""Timestamp object for records"""
1919

20-
first_seen_time: str # ISO 8601 timestamp when the record was first seen
21-
last_changed_time: str # ISO 8601 timestamp when the record was last changed
22-
last_seen_time: str # ISO 8601 timestamp when the record was last seen
20+
created_at: str # ISO 8601 timestamp when the record was first created
21+
changed_at: str # ISO 8601 timestamp when the record was last changed
22+
synced_at: str # ISO 8601 timestamp when the record was last synced
2323

2424

2525
class Record(TypedDict, total=False):
@@ -49,17 +49,17 @@ class RecordsResponse(TypedDict):
4949
class GetRecordsParams(TypedDict, total=False):
5050
"""Query parameters for retrieving records"""
5151

52-
start_time: Optional[str] # Start of last seen time range (ISO 8601 timestamp)
53-
end_time: Optional[str] # End of last seen time range (ISO 8601 timestamp)
52+
start_time: Optional[str] # Start of last synced time range (ISO 8601 timestamp)
53+
end_time: Optional[str] # End of last synced time range (ISO 8601 timestamp)
5454
limit: Optional[int] # Maximum number of records to return (default: 100, max: 500)
5555
cursor: Optional[str] # Cursor for pagination (from previous response)
5656

5757

5858
class TimeRange(TypedDict, total=False):
5959
"""Time range for filtering records"""
6060

61-
start_time: Optional[str] # Start of last seen time range (ISO 8601 timestamp)
62-
end_time: Optional[str] # End of last seen time range (ISO 8601 timestamp)
61+
start_time: Optional[str] # Start of last synced time range (ISO 8601 timestamp)
62+
end_time: Optional[str] # End of last synced time range (ISO 8601 timestamp)
6363

6464

6565
class PaginationParams(TypedDict, total=False):

clients/python/tests/test_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def test_get_records(self, mock_get):
4848
"id": 1,
4949
"data": {"name": "Test Record"},
5050
"timestamps": {
51-
"first_seen_time": "2023-01-01T00:00:00Z",
52-
"last_changed_time": "2023-01-02T00:00:00Z",
53-
"last_seen_time": "2023-01-03T00:00:00Z"
51+
"created_at": "2023-01-01T00:00:00Z",
52+
"changed_at": "2023-01-02T00:00:00Z",
53+
"synced_at": "2023-01-03T00:00:00Z"
5454
}
5555
}
5656
],
@@ -94,9 +94,9 @@ def test_search_records(self, mock_post):
9494
"id": 1,
9595
"data": {"name": "Test Record"},
9696
"timestamps": {
97-
"first_seen_time": "2023-01-01T00:00:00Z",
98-
"last_changed_time": "2023-01-02T00:00:00Z",
99-
"last_seen_time": "2023-01-03T00:00:00Z"
97+
"created_at": "2023-01-01T00:00:00Z",
98+
"changed_at": "2023-01-02T00:00:00Z",
99+
"synced_at": "2023-01-03T00:00:00Z"
100100
},
101101
"relevance_score": 0.9
102102
}
@@ -143,9 +143,9 @@ def test_filter_records(self, mock_post):
143143
"id": 1,
144144
"data": {"name": "Test Record", "category": "Test"},
145145
"timestamps": {
146-
"first_seen_time": "2023-01-01T00:00:00Z",
147-
"last_changed_time": "2023-01-02T00:00:00Z",
148-
"last_seen_time": "2023-01-03T00:00:00Z"
146+
"created_at": "2023-01-01T00:00:00Z",
147+
"changed_at": "2023-01-02T00:00:00Z",
148+
"synced_at": "2023-01-03T00:00:00Z"
149149
}
150150
}
151151
],

clients/typescript/src/types.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export interface LightfeedConfig {
1818
* Timestamp object for records
1919
*/
2020
export interface Timestamps {
21-
/** ISO 8601 timestamp when the record was first seen */
22-
first_seen_time: string;
21+
/** ISO 8601 timestamp when the record was first created */
22+
created_at: string;
2323
/** ISO 8601 timestamp when the record was last changed */
24-
last_changed_time: string;
25-
/** ISO 8601 timestamp when the record was last seen */
26-
last_seen_time: string;
24+
changed_at: string;
25+
/** ISO 8601 timestamp when the record was last synced */
26+
synced_at: string;
2727
}
2828

2929
/**
@@ -66,9 +66,9 @@ export interface RecordsResponse {
6666
* Query parameters for retrieving records
6767
*/
6868
export interface GetRecordsParams {
69-
/** Start of last seen time range (ISO 8601 timestamp) */
69+
/** Start of last synced time range (ISO 8601 timestamp) */
7070
start_time?: string;
71-
/** End of last seen time range (ISO 8601 timestamp) */
71+
/** End of last synced time range (ISO 8601 timestamp) */
7272
end_time?: string;
7373
/** Maximum number of records to return (default: 100, max: 500) */
7474
limit?: number;
@@ -80,9 +80,9 @@ export interface GetRecordsParams {
8080
* Time range for filtering records
8181
*/
8282
export interface TimeRange {
83-
/** Start of last seen time range (ISO 8601 timestamp) */
83+
/** Start of last synced time range (ISO 8601 timestamp) */
8484
start_time?: string;
85-
/** End of last seen time range (ISO 8601 timestamp) */
85+
/** End of last synced time range (ISO 8601 timestamp) */
8686
end_time?: string;
8787
}
8888

clients/typescript/test/client.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ describe("LightfeedClient", () => {
6969
id: 1,
7070
data: { name: "Test Record" },
7171
timestamps: {
72-
first_seen_time: "2023-01-01T00:00:00Z",
73-
last_changed_time: "2023-01-02T00:00:00Z",
74-
last_seen_time: "2023-01-03T00:00:00Z",
72+
created_at: "2023-01-01T00:00:00Z",
73+
changed_at: "2023-01-02T00:00:00Z",
74+
synced_at: "2023-01-03T00:00:00Z",
7575
},
7676
},
7777
],
@@ -119,9 +119,9 @@ describe("LightfeedClient", () => {
119119
id: 1,
120120
data: { name: "Test Record" },
121121
timestamps: {
122-
first_seen_time: "2023-01-01T00:00:00Z",
123-
last_changed_time: "2023-01-02T00:00:00Z",
124-
last_seen_time: "2023-01-03T00:00:00Z",
122+
created_at: "2023-01-01T00:00:00Z",
123+
changed_at: "2023-01-02T00:00:00Z",
124+
synced_at: "2023-01-03T00:00:00Z",
125125
},
126126
relevance_score: 0.9,
127127
},
@@ -160,9 +160,9 @@ describe("LightfeedClient", () => {
160160
id: 1,
161161
data: { name: "Test Record", category: "Test" },
162162
timestamps: {
163-
first_seen_time: "2023-01-01T00:00:00Z",
164-
last_changed_time: "2023-01-02T00:00:00Z",
165-
last_seen_time: "2023-01-03T00:00:00Z",
163+
created_at: "2023-01-01T00:00:00Z",
164+
changed_at: "2023-01-02T00:00:00Z",
165+
synced_at: "2023-01-03T00:00:00Z",
166166
},
167167
},
168168
],

0 commit comments

Comments
 (0)