From 11f0d6c1bf59f7f7a08be631a9dd1a908b770aaa Mon Sep 17 00:00:00 2001
From: Salman Mohammed <smohammed@squareup.com>
Date: Mon, 13 Jan 2025 12:18:20 -0500
Subject: [PATCH 1/4] Add optional timestamp to Annotated

---
 schema/schema.json | 24 ++++++++++++++++++++++++
 schema/schema.ts   |  7 +++++++
 2 files changed, 31 insertions(+)

diff --git a/schema/schema.json b/schema/schema.json
index e8b8c783..23196ca9 100644
--- a/schema/schema.json
+++ b/schema/schema.json
@@ -18,6 +18,10 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
+                        },
+                        "timestamp": {
+                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
                         }
                     },
                     "type": "object"
@@ -455,6 +459,10 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
+                        },
+                        "timestamp": {
+                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
                         }
                     },
                     "type": "object"
@@ -557,6 +565,10 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
+                        },
+                        "timestamp": {
+                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
                         }
                     },
                     "type": "object"
@@ -1489,6 +1501,10 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
+                        },
+                        "timestamp": {
+                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
                         }
                     },
                     "type": "object"
@@ -1595,6 +1611,10 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
+                        },
+                        "timestamp": {
+                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
                         }
                     },
                     "type": "object"
@@ -1931,6 +1951,10 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
+                        },
+                        "timestamp": {
+                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
                         }
                     },
                     "type": "object"
diff --git a/schema/schema.ts b/schema/schema.ts
index eddca23e..949b2644 100644
--- a/schema/schema.ts
+++ b/schema/schema.ts
@@ -832,6 +832,13 @@ export interface Annotated {
      * @maximum 1
      */
     priority?: number;
+
+    /**
+     * The timestamp indicating when this annotation was created or last updated.
+     * 
+     * Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
+     */
+    timestamp?: string;
   }
 }
 

From ee4578a7aebd0ea0fac075b14b056ae21ae77b80 Mon Sep 17 00:00:00 2001
From: Salman Mohammed <smohammed@squareup.com>
Date: Tue, 28 Jan 2025 10:43:48 -0500
Subject: [PATCH 2/4] fix: rename to lastModified, add example

---
 schema/draft/schema.json | 28 ++++++++++++++++++++++++++++
 schema/draft/schema.ts   |  8 ++++++++
 2 files changed, 36 insertions(+)

diff --git a/schema/draft/schema.json b/schema/draft/schema.json
index 1f91ad46..8a80f8d1 100644
--- a/schema/draft/schema.json
+++ b/schema/draft/schema.json
@@ -13,6 +13,10 @@
                             },
                             "type": "array"
                         },
+                        "lastModified": {
+                            "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
+                        },
                         "priority": {
                             "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
                             "maximum": 1,
@@ -37,6 +41,10 @@
                             },
                             "type": "array"
                         },
+                        "lastModified": {
+                            "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
+                        },
                         "priority": {
                             "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
                             "maximum": 1,
@@ -495,6 +503,10 @@
                             },
                             "type": "array"
                         },
+                        "lastModified": {
+                            "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
+                        },
                         "priority": {
                             "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
                             "maximum": 1,
@@ -597,6 +609,10 @@
                             },
                             "type": "array"
                         },
+                        "lastModified": {
+                            "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
+                        },
                         "priority": {
                             "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
                             "maximum": 1,
@@ -1532,6 +1548,10 @@
                             },
                             "type": "array"
                         },
+                        "lastModified": {
+                            "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
+                        },
                         "priority": {
                             "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
                             "maximum": 1,
@@ -1638,6 +1658,10 @@
                             },
                             "type": "array"
                         },
+                        "lastModified": {
+                            "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
+                        },
                         "priority": {
                             "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
                             "maximum": 1,
@@ -1974,6 +1998,10 @@
                             },
                             "type": "array"
                         },
+                        "lastModified": {
+                            "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "type": "string"
+                        },
                         "priority": {
                             "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
                             "maximum": 1,
diff --git a/schema/draft/schema.ts b/schema/draft/schema.ts
index 02070496..ae2ae341 100644
--- a/schema/draft/schema.ts
+++ b/schema/draft/schema.ts
@@ -832,6 +832,14 @@ export interface Annotated {
      * @maximum 1
      */
     priority?: number;
+    
+    /**
+     * The timestamp when the resource was last modified.
+     * Examples: last activity timestamp in an open file, timestamp when resource is attached, etc.
+     * 
+     * Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
+     */
+    lastModified?: string;
   }
 }
 

From 461630e5099571c4b86f545433d8a81b07f8273c Mon Sep 17 00:00:00 2001
From: Salman Mohammed <smohammed@squareup.com>
Date: Tue, 28 Jan 2025 10:47:22 -0500
Subject: [PATCH 3/4] checkout upstream/main for schema/2024-11-05/

---
 schema/2024-11-05/schema.json | 24 ------------------------
 schema/2024-11-05/schema.ts   |  7 -------
 2 files changed, 31 deletions(-)

diff --git a/schema/2024-11-05/schema.json b/schema/2024-11-05/schema.json
index 75a182b4..de1d5162 100644
--- a/schema/2024-11-05/schema.json
+++ b/schema/2024-11-05/schema.json
@@ -18,10 +18,6 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
-                        },
-                        "timestamp": {
-                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
-                            "type": "string"
                         }
                     },
                     "type": "object"
@@ -459,10 +455,6 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
-                        },
-                        "timestamp": {
-                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
-                            "type": "string"
                         }
                     },
                     "type": "object"
@@ -565,10 +557,6 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
-                        },
-                        "timestamp": {
-                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
-                            "type": "string"
                         }
                     },
                     "type": "object"
@@ -1501,10 +1489,6 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
-                        },
-                        "timestamp": {
-                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
-                            "type": "string"
                         }
                     },
                     "type": "object"
@@ -1615,10 +1599,6 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
-                        },
-                        "timestamp": {
-                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
-                            "type": "string"
                         }
                     },
                     "type": "object"
@@ -1955,10 +1935,6 @@
                             "maximum": 1,
                             "minimum": 0,
                             "type": "number"
-                        },
-                        "timestamp": {
-                            "description": "The timestamp indicating when this annotation was created or last updated.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
-                            "type": "string"
                         }
                     },
                     "type": "object"
diff --git a/schema/2024-11-05/schema.ts b/schema/2024-11-05/schema.ts
index c46bf801..589fb53b 100644
--- a/schema/2024-11-05/schema.ts
+++ b/schema/2024-11-05/schema.ts
@@ -839,13 +839,6 @@ export interface Annotated {
      * @maximum 1
      */
     priority?: number;
-
-    /**
-     * The timestamp indicating when this annotation was created or last updated.
-     * 
-     * Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
-     */
-    timestamp?: string;
   }
 }
 

From 82ab5290f8f2a27ff20cc2a996e6571a38993c1a Mon Sep 17 00:00:00 2001
From: Salman Mohammed <smohammed@squareup.com>
Date: Mon, 17 Feb 2025 18:09:38 -0500
Subject: [PATCH 4/4] use Date instead of string

---
 schema/draft/schema.json | 7 +++++++
 schema/draft/schema.ts   | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/schema/draft/schema.json b/schema/draft/schema.json
index 8a80f8d1..211a8205 100644
--- a/schema/draft/schema.json
+++ b/schema/draft/schema.json
@@ -15,6 +15,7 @@
                         },
                         "lastModified": {
                             "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "format": "date-time",
                             "type": "string"
                         },
                         "priority": {
@@ -43,6 +44,7 @@
                         },
                         "lastModified": {
                             "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "format": "date-time",
                             "type": "string"
                         },
                         "priority": {
@@ -505,6 +507,7 @@
                         },
                         "lastModified": {
                             "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "format": "date-time",
                             "type": "string"
                         },
                         "priority": {
@@ -611,6 +614,7 @@
                         },
                         "lastModified": {
                             "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "format": "date-time",
                             "type": "string"
                         },
                         "priority": {
@@ -1550,6 +1554,7 @@
                         },
                         "lastModified": {
                             "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "format": "date-time",
                             "type": "string"
                         },
                         "priority": {
@@ -1660,6 +1665,7 @@
                         },
                         "lastModified": {
                             "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "format": "date-time",
                             "type": "string"
                         },
                         "priority": {
@@ -2000,6 +2006,7 @@
                         },
                         "lastModified": {
                             "description": "The timestamp when the resource was last modified.\nExamples: last activity timestamp in an open file, timestamp when resource is attached, etc.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").",
+                            "format": "date-time",
                             "type": "string"
                         },
                         "priority": {
diff --git a/schema/draft/schema.ts b/schema/draft/schema.ts
index ae2ae341..a5e37f5d 100644
--- a/schema/draft/schema.ts
+++ b/schema/draft/schema.ts
@@ -839,7 +839,7 @@ export interface Annotated {
      * 
      * Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z").
      */
-    lastModified?: string;
+    lastModified?: Date;
   }
 }