@lax-wp/editor 0.4.13 → 0.4.15-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/dist/api/audit.d.ts +79 -0
- package/dist/api/derivedRulebook.d.ts +470 -0
- package/dist/api/documentVersions.d.ts +519 -0
- package/dist/api/effectiveRules.d.ts +372 -0
- package/dist/api/methodology.d.ts +62 -0
- package/dist/api/playbook.d.ts +604 -0
- package/dist/api/promotions.d.ts +1432 -0
- package/dist/api/r1.d.ts +1097 -0
- package/dist/api/r1.fixtures.d.ts +111 -0
- package/dist/api/redlineJobs.d.ts +377 -0
- package/dist/api/redlineStream.d.ts +2979 -0
- package/dist/api/redlines.d.ts +504 -0
- package/dist/api/regsync.d.ts +2355 -0
- package/dist/api/ruleAuthoring.d.ts +305 -0
- package/dist/api/ruleBuilder.d.ts +1009 -0
- package/dist/api/ruleOverrides.d.ts +31 -0
- package/dist/api/ruleStats.d.ts +84 -0
- package/dist/api/rulesCatalog.d.ts +234 -0
- package/dist/api/versions.d.ts +76 -0
- package/dist/api/workspace.d.ts +41 -0
- package/dist/components/EditorSidebar.d.ts +4 -1
- package/dist/components/audit/AuditView.d.ts +8 -0
- package/dist/components/capturededits/AddAsRuleModal.d.ts +8 -0
- package/dist/components/capturededits/CapturedEditCard.d.ts +15 -0
- package/dist/components/capturededits/CapturedEditsTray.d.ts +4 -0
- package/dist/components/capturededits/capturedEditIntent.d.ts +23 -0
- package/dist/components/common/EscDropdown.d.ts +2 -0
- package/dist/components/compliance/MethodologyPanel.d.ts +14 -0
- package/dist/components/compliance/RegSyncPanel.d.ts +18 -0
- package/dist/components/compliance/index.d.ts +8 -0
- package/dist/components/compliance/primitives.d.ts +41 -0
- package/dist/components/documents/DocumentVersionHistory.d.ts +12 -0
- package/dist/components/documents/documentDiff.d.ts +68 -0
- package/dist/components/documents/index.d.ts +4 -0
- package/dist/components/flowdown/FlowdownPanel.d.ts +28 -0
- package/dist/components/flowdown/FlowdownRowCard.d.ts +27 -0
- package/dist/components/flowdown/flowdownModel.d.ts +150 -0
- package/dist/components/history/PlaybookVersionHistory.d.ts +10 -0
- package/dist/components/history/versionDiff.d.ts +14 -0
- package/dist/components/playbook/AllPlaybooksView.d.ts +41 -0
- package/dist/components/playbook/DerivedRulebookView.d.ts +9 -0
- package/dist/components/playbook/DraftedRulePreview.d.ts +17 -0
- package/dist/components/playbook/EffectiveRulesView.d.ts +11 -0
- package/dist/components/playbook/NewRuleDrawer.d.ts +11 -0
- package/dist/components/playbook/PlaybookCard.d.ts +13 -0
- package/dist/components/playbook/PlaybookPage.d.ts +29 -0
- package/dist/components/playbook/PlaybookPanel.d.ts +73 -0
- package/dist/components/playbook/PromotionSuggestions.d.ts +1 -0
- package/dist/components/playbook/ReprioritizeDialog.d.ts +16 -0
- package/dist/components/playbook/RuleDetail.d.ts +27 -0
- package/dist/components/playbook/RuleEditorFields.d.ts +42 -0
- package/dist/components/playbook/RuleEditorModal.d.ts +27 -0
- package/dist/components/playbook/RulePerformancePanel.d.ts +4 -0
- package/dist/components/playbook/RuleRow.d.ts +26 -0
- package/dist/components/playbook/ThisDocumentView.d.ts +45 -0
- package/dist/components/playbook/ViewTabs.d.ts +8 -0
- package/dist/components/playbook/index.d.ts +14 -0
- package/dist/components/playbook/predicateSummary.d.ts +10 -0
- package/dist/components/playbook/primitives.d.ts +82 -0
- package/dist/components/playbook/useFocusTrap.d.ts +6 -0
- package/dist/components/playbook/usePlaybookData.d.ts +161 -0
- package/dist/components/playbook/usePlaybookLabel.d.ts +18 -0
- package/dist/components/r1/ApprovalPanel.d.ts +10 -0
- package/dist/components/r1/CandidateRuleCard.d.ts +8 -0
- package/dist/components/r1/ExecSummaryPanel.d.ts +23 -0
- package/dist/components/r1/PrimeUploadPanel.d.ts +8 -0
- package/dist/components/r1/ReviewStartControls.d.ts +24 -0
- package/dist/components/r1/ReviewSummaryTab.d.ts +38 -0
- package/dist/components/r1/index.d.ts +13 -0
- package/dist/components/r1/primitives.d.ts +59 -0
- package/dist/components/redline/AiReviewPanel.d.ts +194 -0
- package/dist/components/redline/RedlineHoverCard.d.ts +13 -0
- package/dist/components/redline/RedlineItem.d.ts +12 -0
- package/dist/components/redline/ReviewCard.d.ts +49 -0
- package/dist/components/redline/index.d.ts +6 -0
- package/dist/components/redline/reviewItems.d.ts +49 -0
- package/dist/components/redline/reviewPrefs.d.ts +18 -0
- package/dist/components/redline/useRunScopedCards.d.ts +16 -0
- package/dist/components/rulebuilder/AuthorForms.d.ts +28 -0
- package/dist/components/rulebuilder/CandidateQueue.d.ts +21 -0
- package/dist/components/rulebuilder/DraftPane.d.ts +12 -0
- package/dist/components/rulebuilder/RuleBuilderPanel.d.ts +6 -0
- package/dist/components/rulebuilder/RuleCard.d.ts +16 -0
- package/dist/components/rulebuilder/TestBench.d.ts +10 -0
- package/dist/components/rulebuilder/VocabularyPanel.d.ts +26 -0
- package/dist/components/rulebuilder/index.d.ts +13 -0
- package/dist/components/rulebuilder/primitives.d.ts +54 -0
- package/dist/components/rulebuilder/useRuleBuilder.d.ts +291 -0
- package/dist/components/sidebar/ExpandableSidebar.d.ts +2 -0
- package/dist/components/sidebar/WorkspaceRetentionPanel.d.ts +18 -0
- package/dist/components/sidebar/content/TrackChangesContent.d.ts +8 -0
- package/dist/components/sidebar/content/anonymization-page/PIIAnonymization.d.ts +1 -1
- package/dist/components/sidebar/content/anonymization-page/PiiIdleView.d.ts +12 -0
- package/dist/components/sidebar/content/anonymization-page/PiiRecoveryView.d.ts +16 -0
- package/dist/components/sidebar/content/anonymization-page/PiiSummaryView.d.ts +34 -0
- package/dist/components/sidebar/content/anonymization-page/PiiUnavailableView.d.ts +1 -0
- package/dist/components/sidebar/content/anonymization-page/RestoreConfirmDialog.d.ts +9 -0
- package/dist/components/sidebar/content/anonymization-page/anonymizationUtils.d.ts +38 -17
- package/dist/components/sidebar/content/anonymization-page/piiVault.d.ts +18 -0
- package/dist/components/sidebar/content/index.d.ts +0 -1
- package/dist/components/toolbar/AutocompletionToggle.d.ts +1 -0
- package/dist/components/trackChanges/TrackChangesCards.d.ts +1 -0
- package/dist/components/trackChanges/index.d.ts +2 -0
- package/dist/components/trackChanges/utils.d.ts +5 -0
- package/dist/config/EditorConfig.d.ts +197 -73
- package/dist/constants/Extensions.d.ts +12 -0
- package/dist/constants/playbook.d.ts +108 -0
- package/dist/contexts/CapturedEditsContext.d.ts +56 -0
- package/dist/contexts/EditorShellContext.d.ts +4 -1
- package/dist/editor.css +1 -1
- package/dist/extensions/AnonymizedText.d.ts +31 -2
- package/dist/extensions/VariableText.d.ts +20 -0
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/plugins/CapturedEditsPlugin.d.ts +90 -0
- package/dist/extensions/plugins/MarkHighlightPlugin.d.ts +0 -1
- package/dist/extensions/plugins/RedlinePlugin.d.ts +9 -0
- package/dist/extensions/redline/changeTypes.d.ts +70 -0
- package/dist/extensions/redline/constants.d.ts +25 -0
- package/dist/extensions/redline/engine/blockNodes.d.ts +31 -0
- package/dist/extensions/redline/engine/clipboard.d.ts +16 -0
- package/dist/extensions/redline/engine/deletion.d.ts +34 -0
- package/dist/extensions/redline/engine/formatSplit.d.ts +16 -0
- package/dist/extensions/redline/engine/insertion.d.ts +26 -0
- package/dist/extensions/redline/engine/predicates.d.ts +73 -0
- package/dist/extensions/redline/engine/textReplace.d.ts +19 -0
- package/dist/extensions/redline/id.d.ts +7 -0
- package/dist/extensions/redline/index.d.ts +36 -0
- package/dist/extensions/redline/plugin.d.ts +34 -0
- package/dist/extensions/redline/query/scan.d.ts +52 -0
- package/dist/extensions/redline/review/applyChange.d.ts +25 -0
- package/dist/extensions/redline/review/index.d.ts +1 -0
- package/dist/extensions/redline/review/nodeResolvers.d.ts +29 -0
- package/dist/extensions/redline/review/pairedNodes.d.ts +38 -0
- package/dist/extensions/redline/review/structuralRevert.d.ts +20 -0
- package/dist/extensions/redline/review/textResolver.d.ts +9 -0
- package/dist/extensions/redline/schema/marks.d.ts +65 -0
- package/dist/extensions/redline/schema/shared.d.ts +34 -0
- package/dist/extensions/redline/session.d.ts +71 -0
- package/dist/extensions/redline/types.d.ts +24 -0
- package/dist/extensions/trackedChanges/TrackedChanges.d.ts +64 -0
- package/dist/extensions/trackedChanges/constants.d.ts +34 -0
- package/dist/extensions/trackedChanges/engine.d.ts +32 -0
- package/dist/extensions/trackedChanges/index.d.ts +13 -0
- package/dist/extensions/trackedChanges/marks.d.ts +20 -0
- package/dist/extensions/trackedChanges/normalize.d.ts +2 -0
- package/dist/extensions/trackedChanges/plugin.d.ts +32 -0
- package/dist/extensions/trackedChanges/query.d.ts +3 -0
- package/dist/extensions/trackedChanges/review.d.ts +34 -0
- package/dist/extensions/trackedChanges/types.d.ts +72 -0
- package/dist/extensions/trackedChanges/utils.d.ts +20 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -0
- package/dist/hooks/useRedlineHover.d.ts +17 -0
- package/dist/hooks/useRedlineReview.d.ts +83 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.es.js +38491 -22189
- package/dist/index.umd.js +224 -125
- package/dist/utils/cdts.d.ts +37 -0
- package/dist/utils/groundingAdapter.d.ts +36 -0
- package/package.json +39 -33
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document version-control API module (git-store).
|
|
3
|
+
*
|
|
4
|
+
* Nine routes, registered in internal/git-store/lib/api/handler.go and
|
|
5
|
+
* forwarded by cmd/server/main.go as `/v1/documents` + `/v1/documents/*`:
|
|
6
|
+
*
|
|
7
|
+
* POST /v1/documents createDocument
|
|
8
|
+
* GET /v1/documents/{docId} getDocument
|
|
9
|
+
* POST /v1/documents/{docId}/commits commitVersion
|
|
10
|
+
* GET /v1/documents/{docId}/commits getHistory
|
|
11
|
+
* GET /v1/documents/{docId}/versions/{commitId} getVersion
|
|
12
|
+
* GET /v1/documents/{docId}/diff/{from}/{to} getDiff
|
|
13
|
+
* POST /v1/documents/{docId}/rollback rollbackDocument
|
|
14
|
+
* POST /v1/documents/{docId}/analyze triggerDocumentAnalysis
|
|
15
|
+
* GET /v1/documents/{docId}/annotations getAnnotations
|
|
16
|
+
*
|
|
17
|
+
* Shapes derived from the Go handlers + internal/git-store/lib/types/types.go
|
|
18
|
+
* and confirmed against live 200s from a local server. Two envelopes, which is
|
|
19
|
+
* why the schemas below are split:
|
|
20
|
+
*
|
|
21
|
+
* success → {"data": {...}, "meta": {"requestId": "..."}}
|
|
22
|
+
* error → {"code": "...", "message": "...", "trace_id"?: "..."} (FLAT)
|
|
23
|
+
*
|
|
24
|
+
* The error envelope is `clmerrors.Envelope` (api/response.go) — flat, NOT the
|
|
25
|
+
* nested {"error":{...}} some older services used. `DocumentVersionsApiError`
|
|
26
|
+
* exposes `.code` so callers can match on stable codes (NOT_FOUND,
|
|
27
|
+
* INVALID_JSON, NO_CHANGES, PATCH_INTEGRITY, CONFLICT, …).
|
|
28
|
+
*
|
|
29
|
+
* Mirrors `versions.ts` / `audit.ts` conventions: module-level mutable config
|
|
30
|
+
* merged with Vite env defaults, zod + `.passthrough()` at the boundary.
|
|
31
|
+
*/
|
|
32
|
+
import { z } from "zod";
|
|
33
|
+
export interface DocumentVersionsApiConfig {
|
|
34
|
+
baseUrl?: string;
|
|
35
|
+
workspaceId?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Configure once from the consumer (App.tsx / lax-web-portal). */
|
|
38
|
+
export declare const configureDocumentVersionsApi: (next: DocumentVersionsApiConfig) => void;
|
|
39
|
+
export declare class DocumentVersionsApiError extends Error {
|
|
40
|
+
readonly status?: number;
|
|
41
|
+
/** Stable `code` from the flat error envelope, when the body carried one. */
|
|
42
|
+
readonly code?: string;
|
|
43
|
+
constructor(message: string, status?: number, code?: string);
|
|
44
|
+
}
|
|
45
|
+
/** A ProseMirror/Tiptap node. `content` recurses; Go omits empty fields. */
|
|
46
|
+
export interface ProseMirrorNode {
|
|
47
|
+
type: string;
|
|
48
|
+
text?: string;
|
|
49
|
+
marks?: {
|
|
50
|
+
type: string;
|
|
51
|
+
attrs?: unknown;
|
|
52
|
+
}[];
|
|
53
|
+
attrs?: unknown;
|
|
54
|
+
content?: ProseMirrorNode[];
|
|
55
|
+
}
|
|
56
|
+
/** `types.Document` — `content` is a bare slice, so it serializes as null when empty. */
|
|
57
|
+
export declare const proseMirrorDocumentSchema: z.ZodObject<{
|
|
58
|
+
type: z.ZodString;
|
|
59
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
60
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
61
|
+
type: z.ZodString;
|
|
62
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
63
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
64
|
+
type: z.ZodString;
|
|
65
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
66
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
67
|
+
export type ProseMirrorDocument = z.infer<typeof proseMirrorDocumentSchema>;
|
|
68
|
+
/** `types.PatchStats`. */
|
|
69
|
+
declare const patchStatsSchema: z.ZodObject<{
|
|
70
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
71
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
72
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
73
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
74
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
75
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
76
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
77
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
78
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
79
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
80
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
81
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
82
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
83
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
84
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
85
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
86
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
87
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
88
|
+
export type PatchStats = z.infer<typeof patchStatsSchema>;
|
|
89
|
+
/**
|
|
90
|
+
* `types.Commit`. `timestamp` is epoch MILLISECONDS. `tags` serializes as null
|
|
91
|
+
* (bare slice, no omitempty). `parentId` is absent on the first commit.
|
|
92
|
+
*
|
|
93
|
+
* `author` is a DISPLAY NAME resolved at commit time — an IdP rename changes
|
|
94
|
+
* how old commits read. `author_id` (snake_case on the wire, `omitempty`) is
|
|
95
|
+
* the STABLE canonical identity (Keycloak sub; `insecure-dev-user` in dev)
|
|
96
|
+
* recorded alongside it; absent on commits made before it existed.
|
|
97
|
+
*/
|
|
98
|
+
declare const commitSchema: z.ZodObject<{
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
docId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
101
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
102
|
+
patchId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
103
|
+
blobId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
104
|
+
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
105
|
+
author: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
106
|
+
author_id: z.ZodOptional<z.ZodString>;
|
|
107
|
+
timestamp: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
108
|
+
tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
109
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
docId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
112
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
113
|
+
patchId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
114
|
+
blobId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
115
|
+
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
116
|
+
author: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
117
|
+
author_id: z.ZodOptional<z.ZodString>;
|
|
118
|
+
timestamp: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
119
|
+
tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
120
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
docId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
123
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
124
|
+
patchId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
125
|
+
blobId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
126
|
+
message: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
127
|
+
author: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
128
|
+
author_id: z.ZodOptional<z.ZodString>;
|
|
129
|
+
timestamp: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
130
|
+
tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
131
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
132
|
+
export type DocumentCommit = z.infer<typeof commitSchema>;
|
|
133
|
+
/** `types.Hunk`. See documentDiff.ts for the lineNo side-of-the-diff rules. */
|
|
134
|
+
export declare const hunkOpSchema: z.ZodEnum<["INSERT", "DELETE", "REPLACE"]>;
|
|
135
|
+
export type HunkOp = z.infer<typeof hunkOpSchema>;
|
|
136
|
+
declare const hunkSchema: z.ZodObject<{
|
|
137
|
+
op: z.ZodEnum<["INSERT", "DELETE", "REPLACE"]>;
|
|
138
|
+
lineNo: z.ZodNumber;
|
|
139
|
+
oldId: z.ZodOptional<z.ZodString>;
|
|
140
|
+
newId: z.ZodOptional<z.ZodString>;
|
|
141
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
142
|
+
op: z.ZodEnum<["INSERT", "DELETE", "REPLACE"]>;
|
|
143
|
+
lineNo: z.ZodNumber;
|
|
144
|
+
oldId: z.ZodOptional<z.ZodString>;
|
|
145
|
+
newId: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
147
|
+
op: z.ZodEnum<["INSERT", "DELETE", "REPLACE"]>;
|
|
148
|
+
lineNo: z.ZodNumber;
|
|
149
|
+
oldId: z.ZodOptional<z.ZodString>;
|
|
150
|
+
newId: z.ZodOptional<z.ZodString>;
|
|
151
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
152
|
+
export type DiffHunk = z.infer<typeof hunkSchema>;
|
|
153
|
+
/** `types.AIAnnotation`. */
|
|
154
|
+
declare const annotationSchema: z.ZodObject<{
|
|
155
|
+
id: z.ZodString;
|
|
156
|
+
docId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
157
|
+
commitId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
158
|
+
cleanId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
159
|
+
analyzerId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
160
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
161
|
+
lineNo: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
162
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
163
|
+
from: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
164
|
+
to: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
165
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
166
|
+
lineNo: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
167
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
168
|
+
from: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
169
|
+
to: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
170
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
171
|
+
lineNo: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
172
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
173
|
+
from: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
174
|
+
to: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
175
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
176
|
+
mark: z.ZodOptional<z.ZodObject<{
|
|
177
|
+
type: z.ZodString;
|
|
178
|
+
attrs: z.ZodOptional<z.ZodUnknown>;
|
|
179
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
180
|
+
type: z.ZodString;
|
|
181
|
+
attrs: z.ZodOptional<z.ZodUnknown>;
|
|
182
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
183
|
+
type: z.ZodString;
|
|
184
|
+
attrs: z.ZodOptional<z.ZodUnknown>;
|
|
185
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
186
|
+
confidence: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
187
|
+
createdAt: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
188
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
189
|
+
id: z.ZodString;
|
|
190
|
+
docId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
191
|
+
commitId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
192
|
+
cleanId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
193
|
+
analyzerId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
194
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
lineNo: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
196
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
197
|
+
from: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
198
|
+
to: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
199
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
200
|
+
lineNo: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
201
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
202
|
+
from: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
203
|
+
to: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
204
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
205
|
+
lineNo: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
206
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
207
|
+
from: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
208
|
+
to: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
209
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
210
|
+
mark: z.ZodOptional<z.ZodObject<{
|
|
211
|
+
type: z.ZodString;
|
|
212
|
+
attrs: z.ZodOptional<z.ZodUnknown>;
|
|
213
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
214
|
+
type: z.ZodString;
|
|
215
|
+
attrs: z.ZodOptional<z.ZodUnknown>;
|
|
216
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
217
|
+
type: z.ZodString;
|
|
218
|
+
attrs: z.ZodOptional<z.ZodUnknown>;
|
|
219
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
220
|
+
confidence: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
221
|
+
createdAt: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
222
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
223
|
+
id: z.ZodString;
|
|
224
|
+
docId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
225
|
+
commitId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
226
|
+
cleanId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
227
|
+
analyzerId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
228
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
229
|
+
lineNo: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
230
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
231
|
+
from: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
232
|
+
to: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
233
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
234
|
+
lineNo: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
235
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
236
|
+
from: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
237
|
+
to: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
238
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
239
|
+
lineNo: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
240
|
+
path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
241
|
+
from: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
242
|
+
to: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
243
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
244
|
+
mark: z.ZodOptional<z.ZodObject<{
|
|
245
|
+
type: z.ZodString;
|
|
246
|
+
attrs: z.ZodOptional<z.ZodUnknown>;
|
|
247
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
248
|
+
type: z.ZodString;
|
|
249
|
+
attrs: z.ZodOptional<z.ZodUnknown>;
|
|
250
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
251
|
+
type: z.ZodString;
|
|
252
|
+
attrs: z.ZodOptional<z.ZodUnknown>;
|
|
253
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
254
|
+
confidence: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
255
|
+
createdAt: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
256
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
257
|
+
export type DocumentAnnotation = z.infer<typeof annotationSchema>;
|
|
258
|
+
/**
|
|
259
|
+
* The value `authorOrAnonymous` (handler.go) writes when the request context
|
|
260
|
+
* carries no identity.
|
|
261
|
+
*
|
|
262
|
+
* Commits made while git-store was mounted on a bare router — no identity
|
|
263
|
+
* middleware, so no request ever carried one — all recorded this. Those rows
|
|
264
|
+
* are still in the store, so documents whose history predates the attribution
|
|
265
|
+
* fix will keep showing up here. New commits carry the real caller.
|
|
266
|
+
*/
|
|
267
|
+
export declare const UNATTRIBUTED_AUTHOR = "anonymous";
|
|
268
|
+
export interface CommitAuthor {
|
|
269
|
+
/** What to render. */
|
|
270
|
+
label: string;
|
|
271
|
+
/** False when the stored value names nobody who can be held to the change. */
|
|
272
|
+
attributed: boolean;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Version history exists to answer "who changed this, and when". A commit
|
|
276
|
+
* recorded as "anonymous" (or with no author at all) cannot answer the first
|
|
277
|
+
* half, so the UI says so rather than printing a name nobody can be held to.
|
|
278
|
+
*/
|
|
279
|
+
export declare const describeCommitAuthor: (author: string | undefined) => CommitAuthor;
|
|
280
|
+
declare const createDocumentSchema: z.ZodObject<{
|
|
281
|
+
commitId: z.ZodString;
|
|
282
|
+
docId: z.ZodString;
|
|
283
|
+
stats: z.ZodObject<{
|
|
284
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
285
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
286
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
287
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
288
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
289
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
290
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
291
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
292
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
293
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
294
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
295
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
296
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
297
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
298
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
299
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
300
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
301
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
302
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
303
|
+
commitId: z.ZodString;
|
|
304
|
+
docId: z.ZodString;
|
|
305
|
+
stats: z.ZodObject<{
|
|
306
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
307
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
308
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
309
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
310
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
311
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
312
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
313
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
314
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
315
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
316
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
317
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
318
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
319
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
320
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
321
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
322
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
323
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
324
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
325
|
+
commitId: z.ZodString;
|
|
326
|
+
docId: z.ZodString;
|
|
327
|
+
stats: z.ZodObject<{
|
|
328
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
329
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
330
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
331
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
332
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
333
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
334
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
335
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
336
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
337
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
338
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
339
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
340
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
341
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
342
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
343
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
344
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
345
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
346
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
347
|
+
export type CreateDocumentResult = z.infer<typeof createDocumentSchema>;
|
|
348
|
+
/**
|
|
349
|
+
* POST /v1/documents → 201. Body is the bare ProseMirror document (NOT
|
|
350
|
+
* wrapped). The first commit's id doubles as the document id.
|
|
351
|
+
*/
|
|
352
|
+
export declare const createDocument: (document: ProseMirrorDocument) => Promise<CreateDocumentResult>;
|
|
353
|
+
declare const getDocumentSchema: z.ZodObject<{
|
|
354
|
+
document: z.ZodObject<{
|
|
355
|
+
type: z.ZodString;
|
|
356
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
357
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
358
|
+
type: z.ZodString;
|
|
359
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
360
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
361
|
+
type: z.ZodString;
|
|
362
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
363
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
364
|
+
commitId: z.ZodString;
|
|
365
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
366
|
+
document: z.ZodObject<{
|
|
367
|
+
type: z.ZodString;
|
|
368
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
369
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
370
|
+
type: z.ZodString;
|
|
371
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
372
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
373
|
+
type: z.ZodString;
|
|
374
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
375
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
376
|
+
commitId: z.ZodString;
|
|
377
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
378
|
+
document: z.ZodObject<{
|
|
379
|
+
type: z.ZodString;
|
|
380
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
381
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
382
|
+
type: z.ZodString;
|
|
383
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
384
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
385
|
+
type: z.ZodString;
|
|
386
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<ProseMirrorNode, z.ZodTypeDef, ProseMirrorNode>, "many">>>;
|
|
387
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
388
|
+
commitId: z.ZodString;
|
|
389
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
390
|
+
export type GetDocumentResult = z.infer<typeof getDocumentSchema>;
|
|
391
|
+
/** GET /v1/documents/{docId} → the document at HEAD, plus the head commit id. */
|
|
392
|
+
export declare const getDocument: (docId: string) => Promise<GetDocumentResult>;
|
|
393
|
+
declare const commitVersionSchema: z.ZodObject<{
|
|
394
|
+
commitId: z.ZodString;
|
|
395
|
+
stats: z.ZodObject<{
|
|
396
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
397
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
398
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
399
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
400
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
401
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
402
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
403
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
404
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
405
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
406
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
407
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
408
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
409
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
410
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
411
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
412
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
413
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
414
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
415
|
+
commitId: z.ZodString;
|
|
416
|
+
stats: z.ZodObject<{
|
|
417
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
418
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
419
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
420
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
421
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
422
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
423
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
424
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
425
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
426
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
427
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
428
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
429
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
430
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
431
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
432
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
433
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
434
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
435
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
436
|
+
commitId: z.ZodString;
|
|
437
|
+
stats: z.ZodObject<{
|
|
438
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
439
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
440
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
441
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
442
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
443
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
444
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
445
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
446
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
447
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
448
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
449
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
450
|
+
inserted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
451
|
+
deleted: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
452
|
+
replaced: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
453
|
+
unchanged: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
454
|
+
changedBytes: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
455
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
456
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
457
|
+
export type CommitVersionResult = z.infer<typeof commitVersionSchema>;
|
|
458
|
+
/**
|
|
459
|
+
* POST /v1/documents/{docId}/commits → 201. Committing an unchanged document
|
|
460
|
+
* is a 409 NO_CHANGES.
|
|
461
|
+
*/
|
|
462
|
+
export declare const commitVersion: (docId: string, document: ProseMirrorDocument, message: string) => Promise<CommitVersionResult>;
|
|
463
|
+
export interface GetHistoryOptions {
|
|
464
|
+
/** Server default 20, clamped to 100. Non-positive values are a 400. */
|
|
465
|
+
limit?: number;
|
|
466
|
+
/** Cursor: the commit id to page after. */
|
|
467
|
+
after?: string;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* GET /v1/documents/{docId}/commits → the commit log, newest first.
|
|
471
|
+
*
|
|
472
|
+
* NOTE: an unknown docId is NOT a 404 here — it returns 200 with an empty
|
|
473
|
+
* list, so "no history" and "no such document" are indistinguishable on this
|
|
474
|
+
* route alone.
|
|
475
|
+
*/
|
|
476
|
+
export declare const getHistory: (docId: string, options?: GetHistoryOptions) => Promise<DocumentCommit[]>;
|
|
477
|
+
/** GET /v1/documents/{docId}/versions/{commitId} → that version's document. */
|
|
478
|
+
export declare const getVersion: (docId: string, commitId: string) => Promise<ProseMirrorDocument>;
|
|
479
|
+
/**
|
|
480
|
+
* GET /v1/documents/{docId}/diff/{from}/{to} → structural hunks only. The
|
|
481
|
+
* server sends line-node hashes, never text; documentDiff.ts aligns the hunks
|
|
482
|
+
* against both versions' documents to produce renderable rows.
|
|
483
|
+
*/
|
|
484
|
+
export declare const getDiff: (docId: string, from: string, to: string) => Promise<DiffHunk[]>;
|
|
485
|
+
/**
|
|
486
|
+
* POST /v1/documents/{docId}/rollback → the id of the NEW commit.
|
|
487
|
+
*
|
|
488
|
+
* Rollback is a FORWARD commit ("rollback to {id}") that restores the target
|
|
489
|
+
* blob over the current head. History is never rewritten — the commits being
|
|
490
|
+
* rolled back stay in the log. What changes is the document content at HEAD.
|
|
491
|
+
*/
|
|
492
|
+
export declare const rollbackDocument: (docId: string, toCommitId: string) => Promise<string>;
|
|
493
|
+
/**
|
|
494
|
+
* The code POST .../analyze returns (501) when the server has no analyzers
|
|
495
|
+
* configured. On such a server the route never queues work, so a caller that
|
|
496
|
+
* sees this must not report analysis as started.
|
|
497
|
+
*/
|
|
498
|
+
export declare const ANALYSIS_UNAVAILABLE = "ANALYSIS_UNAVAILABLE";
|
|
499
|
+
/**
|
|
500
|
+
* POST /v1/documents/{docId}/analyze → 202 {"status":"triggered"} when the
|
|
501
|
+
* server has analyzers, otherwise **501 with code ANALYSIS_UNAVAILABLE**
|
|
502
|
+
* (thrown as a DocumentVersionsApiError — check `.code`).
|
|
503
|
+
*
|
|
504
|
+
* The server previously answered a flat 202 whether or not anything could run;
|
|
505
|
+
* it now refuses honestly. Servers in this configuration register no analyzers
|
|
506
|
+
* at all, so annotations stay empty and no amount of calling this changes that.
|
|
507
|
+
*
|
|
508
|
+
* Kept here so the route has a typed client. It is deliberately NOT wired to a
|
|
509
|
+
* button in DocumentVersionHistory: an affordance whose only possible outcome
|
|
510
|
+
* is a 501 promises work that cannot happen.
|
|
511
|
+
*/
|
|
512
|
+
export declare const triggerDocumentAnalysis: (docId: string) => Promise<string>;
|
|
513
|
+
/**
|
|
514
|
+
* GET /v1/documents/{docId}/annotations → AI annotations for the CURRENT HEAD
|
|
515
|
+
* only (the service resolves head, then reads by that commit). Empty until an
|
|
516
|
+
* analyzer is actually wired — see `triggerDocumentAnalysis`.
|
|
517
|
+
*/
|
|
518
|
+
export declare const getAnnotations: (docId: string) => Promise<DocumentAnnotation[]>;
|
|
519
|
+
export {};
|