You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`--expected-current-version <value>`| No | Revert only while this is still the current version; otherwise the request fails with `409`. Omit to revert whatever is current. Collaborative edits and repeated workflow writes that fold into the current version keep its number. |
302
+
|`--expected-current-version <value>`| No | Revert only while this is still the current version; otherwise the request fails with `409`. Omit to revert whatever is current. Collaborative edits and repeated workflow writes that fold into the current version keep its number, so prefer `expectedRevision` to guard content. |
303
+
|`--expected-revision <value>`| No | Revert only while the file still holds the content this revision names, as returned by Get File Metadata or an earlier write; otherwise the request fails with `409`. Unlike a version number, it also catches edits that folded into the current version. |
|`--expected-current-version <value>`| No | Revert only while this is still the current version; otherwise the request fails with `409`. Omit to revert whatever is current. Collaborative edits and repeated workflow writes that fold into the current version keep its number. |
1047
+
|`--expected-current-version <value>`| No | Revert only while this is still the current version; otherwise the request fails with `409`. Omit to revert whatever is current. Collaborative edits and repeated workflow writes that fold into the current version keep its number, so prefer `expectedRevision` to guard content. |
1048
+
|`--expected-revision <value>`| No | Revert only while the file still holds the content this revision names, as returned by Get File Metadata or an earlier write; otherwise the request fails with `409`. Unlike a version number, it also catches edits that folded into the current version. |
Copy file name to clipboardExpand all lines: apps/docs/openapi-v2-files-audit.json
+22-3Lines changed: 22 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4988,10 +4988,15 @@
4988
4988
"description": "Workspace that owns the file."
4989
4989
},
4990
4990
"expectedCurrentVersion": {
4991
-
"description": "Revert only while this is still the current version; otherwise the request fails with `409`. Omit to revert whatever is current. Collaborative edits and repeated workflow writes that fold into the current version keep its number.",
4991
+
"description": "Revert only while this is still the current version; otherwise the request fails with `409`. Omit to revert whatever is current. Collaborative edits and repeated workflow writes that fold into the current version keep its number, so prefer `expectedRevision` to guard content.",
4992
4992
"type": "integer",
4993
4993
"minimum": 1,
4994
4994
"maximum": 2147483647
4995
+
},
4996
+
"expectedRevision": {
4997
+
"description": "Revert only while the file still holds the content this revision names, as returned by Get File Metadata or an earlier write; otherwise the request fails with `409`. Unlike a version number, it also catches edits that folded into the current version.",
4998
+
"type": "string",
4999
+
"minLength": 1
4995
5000
}
4996
5001
},
4997
5002
"required": ["workspaceId"],
@@ -5315,6 +5320,17 @@
5315
5320
],
5316
5321
"description": "Current public-share state, or null when the file has never been shared."
5317
5322
},
5323
+
"revision": {
5324
+
"anyOf": [
5325
+
{
5326
+
"type": "string"
5327
+
},
5328
+
{
5329
+
"type": "null"
5330
+
}
5331
+
],
5332
+
"description": "Opaque token for the file's current content. Send it back as `expectedRevision` so a write or revert is refused when the content moved on. Null for a file with no recorded content version."
Copy file name to clipboardExpand all lines: apps/sim/lib/api/contracts/v2/file-versions.ts
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,14 @@ export const v2RevertFileVersionBodySchema = z
129
129
expectedCurrentVersion: versionNumberSchema
130
130
.optional()
131
131
.describe(
132
-
'Revert only while this is still the current version; otherwise the request fails with `409`. Omit to revert whatever is current. Collaborative edits and repeated workflow writes that fold into the current version keep its number.'
132
+
'Revert only while this is still the current version; otherwise the request fails with `409`. Omit to revert whatever is current. Collaborative edits and repeated workflow writes that fold into the current version keep its number, so prefer `expectedRevision` to guard content.'
133
+
),
134
+
expectedRevision: z
135
+
.string()
136
+
.min(1)
137
+
.optional()
138
+
.describe(
139
+
'Revert only while the file still holds the content this revision names, as returned by Get File Metadata or an earlier write; otherwise the request fails with `409`. Unlike a version number, it also catches edits that folded into the current version.'
.describe('Current public-share state, or null when the file has never been shared.'),
159
+
revision: z
160
+
.string()
161
+
.nullable()
162
+
.describe(
163
+
"Opaque token for the file's current content. Send it back as `expectedRevision` so a write or revert is refused when the content moved on. Null for a file with no recorded content version."
164
+
),
159
165
currentVersion: versionNumberSchema.describe(
160
166
'Version number of the current content. List File Versions returns the history; pass this as `expectedCurrentVersion` to revert only if nothing changed since.'
0 commit comments